mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 11:38:29 +01:00
Trick the client instead of modifying the world. Fixes BUKKIT-637
This commit is contained in:
parent
5451788eb9
commit
5bcb23502e
@ -205,12 +205,11 @@ public class ItemInWorldManager {
|
|||||||
|
|
||||||
// Tell client the block is gone immediately then process events
|
// Tell client the block is gone immediately then process events
|
||||||
if (world.getTileEntity(i, j, k) == null) {
|
if (world.getTileEntity(i, j, k) == null) {
|
||||||
int id = block.getTypeId();
|
Packet53BlockChange packet = new Packet53BlockChange(i, j, k, this.world);
|
||||||
byte data = block.getData();
|
|
||||||
|
|
||||||
block.setTypeId(0, false);
|
packet.material = block.getTypeId();
|
||||||
((EntityPlayer) this.player).netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, this.world));
|
packet.data = block.getData();
|
||||||
block.setTypeIdAndData(id, data, false);
|
((EntityPlayer) this.player).netServerHandler.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockBreakEvent event = new BlockBreakEvent(block, (org.bukkit.entity.Player) this.player.getBukkitEntity());
|
BlockBreakEvent event = new BlockBreakEvent(block, (org.bukkit.entity.Player) this.player.getBukkitEntity());
|
||||||
|
Loading…
Reference in New Issue
Block a user