mirror of
https://github.com/Minestom/Minestom.git
synced 2025-04-02 01:45:58 +02:00
Allow postExplosion to modify the ExplosionPacket
This commit is contained in:
parent
fa8b2bc49c
commit
2c74589599
@ -1 +1 @@
|
|||||||
Subproject commit a637148b634ee3f1ae839f93eadc90b4274b8c5b
|
Subproject commit 7979a3350d61d89c0d101ff12f2b8864beeff250
|
@ -74,7 +74,7 @@ public abstract class Explosion {
|
|||||||
packet.records[i*3+2] = z;
|
packet.records[i*3+2] = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
postExplosion(instance, blocks);
|
postExplosion(instance, blocks, packet);
|
||||||
|
|
||||||
instance.getPlayers().forEach(player -> {
|
instance.getPlayers().forEach(player -> {
|
||||||
player.sendPacketToViewersAndSelf(packet);
|
player.sendPacketToViewersAndSelf(packet);
|
||||||
@ -85,6 +85,10 @@ public abstract class Explosion {
|
|||||||
* Called after removing blocks and preparing the packet, but before sending it.
|
* Called after removing blocks and preparing the packet, but before sending it.
|
||||||
* @param instance the instance in which the explosion occurs
|
* @param instance the instance in which the explosion occurs
|
||||||
* @param blocks the block positions returned by prepare
|
* @param blocks the block positions returned by prepare
|
||||||
|
* @param packet the explosion packet to sent to the client. Be careful with what you're doing.
|
||||||
|
* It is initialized with the center and radius of the explosion. The positions in 'blocks' are also
|
||||||
|
* stored in the packet before this call, but you are free to modify 'records' to modify the blocks sent to the client.
|
||||||
|
* Just be careful, you might just crash the server or the client. Or you're lucky, both at the same time.
|
||||||
*/
|
*/
|
||||||
protected void postExplosion(Instance instance, List<BlockPosition> blocks) {}
|
protected void postExplosion(Instance instance, List<BlockPosition> blocks, ExplosionPacket packet) {}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user