mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-30 23:47:37 +02:00
Added method at end of explosions to allow custom code after destroying blocks
This commit is contained in:
parent
a1c0a84d3a
commit
fa8b2bc49c
@ -74,8 +74,17 @@ public abstract class Explosion {
|
|||||||
packet.records[i*3+2] = z;
|
packet.records[i*3+2] = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
postExplosion(instance, blocks);
|
||||||
|
|
||||||
instance.getPlayers().forEach(player -> {
|
instance.getPlayers().forEach(player -> {
|
||||||
player.sendPacketToViewersAndSelf(packet);
|
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) {}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user