Comments (15)
@Aaron1011 Is there a difference in the explosion (underlying class) or is the block damage only a flag that i can turn of and on like i can do for fire?
The CB code from net.minecraft.server.Explosion
has a flag called b = true
.
The 1.8 MCP code from net.minecraft.world.Explosion
has a flag called isSmoking
. (which is basically the same as above)
from spongeapi.
@Aaron1011 There is no such thing in vanilla as a non-block-damaging explosion. It's simply an explosion with low enough power to not break all but the weakest blocks.
from spongeapi.
@AlphaModder: That's true, but it could still be implemented to provide other types of explosions. With the addition of related events, this could be used by plugins to create custom explosions.
EDIT: Actually, Vanilla does have non-block-damaging explosions. It's controlled through a boolean passed to the constructor of Explosion
. It's currently only used by creepers, to disable block damage when the mobGriefing
game rule is false
.
from spongeapi.
keep in mind that the api needs to work on future refactoring of vanilla as well. Not just what works at the moment
from spongeapi.
Actually Vanilla fireballs lack customization.
All movement stuff is in EntityFireball class. In EntityLargeFireball there is simple hit method with hard coded (as I remember correctly) explosion power. EntitySmallFireball has also hard coded damage.
Creating custom fireball object would be one possible solution. If we extend EntityLargeFireball/EntitySmallFireball, client can handle customized entities. I used that in Bukkit to customize fireball damage without event mess.
from spongeapi.
In EntityLargeFireball there is simple hit method with hard coded (as I remember correctly) explosion power. EntitySmallFireball has also hard coded damage.
I do believe it's possible to override these hard coded damages with Mixins, though @Mumfrey would have to verify that statement.
from spongeapi.
Yes, overriding it is possible with mixins also. And actually, its pretty easy... I don't know why I didn't think about that.
from spongeapi.
@Aaron1011 would it be feasible to say that explosive projectiles do have explosion power but normally are nominal in terms of their explosion power? Or possibly, even have some event to handle the logic where an "EntityExplosionEvent" would have the prescribed explosion power to manipulate, ergo, allowing for things like fireballs and wither skulls lacking said explosive meanings?
from spongeapi.
@Aaron1011 would it be feasible to say that explosive projectiles do have explosion power but normally are nominal in terms of their explosion power?
I think it makes more sense to separate block-damaging explosions, and non-block-damaging explosions.
You could just make all non-block-damaging block-damaging explosions with a power 0. However, it think it makes more sense to have them logically separate. It also allows for increased granularity in event subscription.
from spongeapi.
The only issue I see with that, is what happens if the power is adjusted for an explosion in an event? Suddenly it's gone from not doing block damage to doing block damage and the explosion type would need to change.
The other option is you make it impossible to change from one to the other, and cause people to cancel it and issue their own explosion causing it's own events which has it's own complications.
from spongeapi.
Yes, please don't sesprate explosive projectile classes. One of my plugins is designed to permit users to adjust explosive power of ANY explosion, including skulls, fire charges, and ender dragons-- yes, they actually explode the blocks they fly through w 0 power. I don't want to have to change classes just to make it damage books or not.
from spongeapi.
@Aaron1011 could you put this in a PR?
from spongeapi.
@gratimax: Sure!
from spongeapi.
@Aaron1011 did you write a PR for this yet?
from spongeapi.
Continued in #468
from spongeapi.
Related Issues (20)
- Can't get Biome Volume Factory with factory provider HOT 1
- Server-scoped PlayerChatRouter
- Ability to Hide Entities - "Sending Single Client Data" HOT 1
- Add method to retrieve level name from world properties
- Add Java Modules to Sponge API
- Amendments to API org.spongepowered.api.service.permission.SubjectData
- Enhanced Loot Table support HOT 1
- Typo
- automatic parameterized registration of plugin derived permission sets HOT 1
- Add a DataFormats.SNBT
- DataTranslator registry HOT 1
- Unregister an existing command registration
- Compile API 9 in Java 8 HOT 1
- Review content of util package HOT 1
- Make ServersideConnectionEvent.Handshake a Cancellable MessageEvent, like Auth
- Inventory from BlockSnapshot
- Return type of Container#type()
- Ability to get active bossbars on player
- error which mod spongepowered HOT 1
- Structure and Feature placement callbacks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spongeapi.