From df8c42d4ad93f8994ed6a47598768e936dc7cb8d Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Sat, 21 Jul 2018 14:47:22 +0200 Subject: [PATCH] 1.13: Resend bed on cancelled interaction (#1245) Minecraft 1.13 requires resending the block for both parts of the bed --- .../Extend-Player-Interact-cancellation.patch | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch index 42c3579dfa..616fe9715f 100644 --- a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch +++ b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch @@ -13,7 +13,7 @@ Update adjacent blocks of doors, double plants, pistons and beds when cancelling interaction. diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index e34198e40..620efb1ac 100644 +index e34198e4..e375e255 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -0,0 +0,0 @@ public class PlayerInteractManager { @@ -42,15 +42,14 @@ index e34198e40..620efb1ac 100644 + BlockPosition piston = position.shift(data.get(BlockPistonExtension.FACING).opposite()); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, piston)); + } else if (block instanceof BlockBed) { -+ if (data.get(BlockBed.PART) == BlockPropertyBedPart.FOOT) { -+ // Restore head of bed -+ BlockPosition head = position.shift(data.get(BlockBed.FACING)); -+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, head)); ++ // Restore other half of bed ++ boolean foot = data.get(BlockBed.PART) == BlockPropertyBedPart.FOOT; ++ BlockPosition otherBlock = position.shift(foot ? data.get(BlockBed.FACING) : data.get(BlockBed.FACING).opposite()); ++ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, otherBlock)); + -+ TileEntity tileentity = this.world.getTileEntity(head); -+ if (tileentity != null) { -+ this.player.playerConnection.sendPacket(tileentity.getUpdatePacket()); -+ } ++ TileEntity tileentity = this.world.getTileEntity(otherBlock); ++ if (tileentity != null) { ++ this.player.playerConnection.sendPacket(tileentity.getUpdatePacket()); + } + } + }