Flan's Mod: Legacy

Flan's Mod: Legacy

2M Downloads

[CB Compatibility] Explosions and protection from them

ChrisLane opened this issue ยท 0 comments

commented

Using regular Minecraft explosions instead of Flan's mod's own ones (blockBreakEvent where the thrower is the player is not the best option) should allow for craftbukkit servers to be able to protect against explosions with explosion related flags, rather than the current system which is to block the explosions with block break protections.

If using them directly is not possible for some reason, get the grenade position at the detonation moment and create an explosion at that position.

e.g.

public void Explosion(Player player, double posX, double posY, double posZ, float strenght, float f, float explosionRadius, boolean explosiveson)
{
    worldObject.createExplosion(player, posX, posY, posZ, strenght, (float)*(explosionRadius*2), explosionson);
}

f is a formula that gives back "float f=(float)^3_Math.PI_(4/3)"
player object should be given, to customize death messages to "someone was blown up by another_guy",
otherwise it probably looks like "someone was blown up by null" which would lead to null pointers if you use kill reward systems.