mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-03 05:26:50 +01:00
SPIGOT-2694: Update other half of door on BlockBreakEvent
This commit is contained in:
parent
270a3a66ce
commit
70aace0312
1 changed files with 9 additions and 4 deletions
|
@ -123,7 +123,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -192,13 +251,76 @@
|
@@ -192,13 +251,81 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean breakBlock(BlockPosition blockposition) {
|
public boolean breakBlock(BlockPosition blockposition) {
|
||||||
|
@ -175,6 +175,11 @@
|
||||||
+ }
|
+ }
|
||||||
+ // Let the client know the block still exists
|
+ // Let the client know the block still exists
|
||||||
+ ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
|
+ ((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
|
+ // Update any tile entity data for this block
|
||||||
+ TileEntity tileentity = this.world.getTileEntity(blockposition);
|
+ TileEntity tileentity = this.world.getTileEntity(blockposition);
|
||||||
+ if (tileentity != null) {
|
+ if (tileentity != null) {
|
||||||
|
@ -201,7 +206,7 @@
|
||||||
if ((block instanceof BlockCommand || block instanceof BlockStructure) && !this.player.dh()) {
|
if ((block instanceof BlockCommand || block instanceof BlockStructure) && !this.player.dh()) {
|
||||||
this.world.notify(blockposition, iblockdata, iblockdata, 3);
|
this.world.notify(blockposition, iblockdata, iblockdata, 3);
|
||||||
return false;
|
return false;
|
||||||
@@ -243,6 +365,12 @@
|
@@ -243,6 +370,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +219,7 @@
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -283,7 +411,13 @@
|
@@ -283,7 +416,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +233,7 @@
|
||||||
if (this.gamemode == EnumGamemode.SPECTATOR) {
|
if (this.gamemode == EnumGamemode.SPECTATOR) {
|
||||||
TileEntity tileentity = world.getTileEntity(blockposition);
|
TileEntity tileentity = world.getTileEntity(blockposition);
|
||||||
|
|
||||||
@@ -340,6 +474,74 @@
|
@@ -340,6 +479,74 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue