Added method at end of explosions to allow custom code after destroying blocks

This commit is contained in:
jglrxavpok 2020-07-16 21:24:14 +02:00
parent a1c0a84d3a
commit fa8b2bc49c

View File

@ -74,8 +74,17 @@ public abstract class Explosion {
packet.records[i*3+2] = z;
}
postExplosion(instance, blocks);
instance.getPlayers().forEach(player -> {
player.sendPacketToViewersAndSelf(packet);
});
}
/**
* Called after removing blocks and preparing the packet, but before sending it.
* @param instance the instance in which the explosion occurs
* @param blocks the block positions returned by prepare
*/
protected void postExplosion(Instance instance, List<BlockPosition> blocks) {}
}