Giter Club home page Giter Club logo

Comments (15)

ST-DDT avatar ST-DDT commented on August 12, 2024

@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.

AlphaModder avatar AlphaModder commented on August 12, 2024

@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.

Aaron1011 avatar Aaron1011 commented on August 12, 2024

@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.

ryantheleach avatar ryantheleach commented on August 12, 2024

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.

bensku avatar bensku commented on August 12, 2024

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.

gabizou avatar gabizou commented on August 12, 2024

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.

bensku avatar bensku commented on August 12, 2024

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.

gabizou avatar gabizou commented on August 12, 2024

@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 avatar Aaron1011 commented on August 12, 2024

@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.

ryantheleach avatar ryantheleach commented on August 12, 2024

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.

filbert66 avatar filbert66 commented on August 12, 2024

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.

maxov avatar maxov commented on August 12, 2024

@Aaron1011 could you put this in a PR?

from spongeapi.

Aaron1011 avatar Aaron1011 commented on August 12, 2024

@gratimax: Sure!

from spongeapi.

gabizou avatar gabizou commented on August 12, 2024

@Aaron1011 did you write a PR for this yet?

from spongeapi.

maxov avatar maxov commented on August 12, 2024

Continued in #468

from spongeapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.