mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
SPIGOT-2694: Update other half of door on BlockBreakEvent
This commit is contained in:
parent
270a3a66ce
commit
70aace0312
@ -123,7 +123,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -192,13 +251,76 @@
|
||||
@@ -192,13 +251,81 @@
|
||||
}
|
||||
|
||||
public boolean breakBlock(BlockPosition blockposition) {
|
||||
@ -175,6 +175,11 @@
|
||||
+ }
|
||||
+ // Let the client know the block still exists
|
||||
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
|
||||
+ // Send other half of the door
|
||||
+ if (nmsBlock instanceof BlockDoor) {
|
||||
+ boolean bottom = nmsData.get(BlockDoor.HALF) == BlockDoor.EnumDoorHalf.LOWER;
|
||||
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? blockposition.up() : blockposition.down()));
|
||||
+ }
|
||||
+ // Update any tile entity data for this block
|
||||
+ TileEntity tileentity = this.world.getTileEntity(blockposition);
|
||||
+ if (tileentity != null) {
|
||||
@ -201,7 +206,7 @@
|
||||
if ((block instanceof BlockCommand || block instanceof BlockStructure) && !this.player.dh()) {
|
||||
this.world.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
return false;
|
||||
@@ -243,6 +365,12 @@
|
||||
@@ -243,6 +370,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,7 +219,7 @@
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -283,7 +411,13 @@
|
||||
@@ -283,7 +416,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,7 +233,7 @@
|
||||
if (this.gamemode == EnumGamemode.SPECTATOR) {
|
||||
TileEntity tileentity = world.getTileEntity(blockposition);
|
||||
|
||||
@@ -340,6 +474,74 @@
|
||||
@@ -340,6 +479,74 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user