IC2Explosion doesn't extend NMS Explosion
clienthax opened this issue ยท 5 comments
IC2Explosion not extending NMS explosion is causing issues with protection plugins that expect the detonate event to be sent when it is not.
This is not the case with IC2 as that extends explosion as expected.
https://github.com/MinecraftPortCentral/GriefPrevention/issues/938
@clienthax thats has to be done like that (I support the pre event because of the issue) because its a really large scale explosion and on top of that it is needed for the radiation effects.
Eh I am throwing the Explosion Event.
public void doExplosion()
{
if(power <= 0F)
{
return;
}
if(ForgeEventFactory.onExplosionStart(world, fakeExplosion))
{
return;
}
}
And the explosion contains the "Nuke Entity" so you could easily detect the IC2 Nuke by just comparing to the IC2C Nuke. The code you are showing could be 1.7.10 which i doubt honestly
Also take down that class for "Obviouse Legal reasons" (IC2C/Exp source is not allowed to be opensourced)
@clienthax. So yeah...
@Speiger I believe this can be reworked just fine to extend NMS explosion and also fire the right events.
The main one we are missing is the detonate event, which allows the affected block positions and entities to be modified, I currently have to call this twice in my attempt, as I need to move some stuff around to get it down to one call, shouldn't cause issues however.
I have given it a decent go here, not finished however: https://gist.github.com/clienthax/7ba1ef90e55f299d5ffbc06122e67a63
Code removed as requested.
I am aware of the first event, however it seems GriefPrevention is not handling this one correctly, I have also raised it to them to look into.
I still think it would make sense to restructure this to be more equivilent to the NMS Explosion, as it seems perfectly possible to store the results of the rays /destroyed blocks and fire the Explosion.Detonate event to allow modification of them too, before processing them.
Do you have an email etc I could send a further attempt to, I'm mainly doing this to improve compatibility all around with Sponge etc, since a player decided to grief using the reactor explosion :)
Just turn of the Explosion power inside the config if you set it to a lower number and the griefing issue should be solved. (0 is supported)
About the Detonate event. You really want me to support that event? Because you can not cancel it? And ic2c would throwing a lot of these events at once. And manipulating them is not helping either.
So from my standpoint I am providing enough support to manage it on your end.
The reason why I am not touching that right now is because I had specific reasons to create it that way and I am so out of touch with the project that I can not remember why. And I will not touch a working system just to make a "fix" that is not needed on my side just to break extra things.
About Emails? No. My issue trackers are the best source to access me. Even if you had my email the github tracker would be still better because I dont check my emails frequently enough. (And I don't want spam)
So yeah here is the tldr:
- PreEvent is the right event that I should be calling, the other one that you guys use is just a dirty hack compare the actual cancelable function that allows you to prevent these things in the first place.
- Configs for disabling nuke explosions of both kinds are there and they are also doing the same thing for the Nuclear Jetpack. (Its a suicide attack but still nuke)
- Email: No. Github is enough.
Anything left here to do?