From 761c24fae94a2e2e696d04a1fe0956f67a7fdf42 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 24 Nov 2019 00:02:47 -0600 Subject: [PATCH] Fix stuck in sneak when changing worlds (MC-10657) (#2627) --- ...-sneak-when-changing-worlds-MC-10657.patch | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Spigot-Server-Patches/0422-Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch diff --git a/Spigot-Server-Patches/0422-Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch b/Spigot-Server-Patches/0422-Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch new file mode 100644 index 0000000000..5fb51bd71e --- /dev/null +++ b/Spigot-Server-Patches/0422-Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch @@ -0,0 +1,35 @@ +From 0d0548d6c0dae5a044a5e52dcf56c6a4a1eb7a73 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath +Date: Wed, 9 Oct 2019 21:51:43 -0500 +Subject: [PATCH] Fix stuck in sneak when changing worlds (MC-10657) + + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index 7801879c8..8541dbe8d 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -963,6 +963,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + this.lastHealthSent = -1.0F; + this.lastFoodSent = -1; + ++ setSneaking(false); // Paper - fix MC-10657 ++ + // CraftBukkit start + PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver.getWorld()); + this.world.getServer().getPluginManager().callEvent(changeEvent); +diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java +index 3cb443c4f..4ba349e1a 100644 +--- a/src/main/java/net/minecraft/server/PlayerList.java ++++ b/src/main/java/net/minecraft/server/PlayerList.java +@@ -728,6 +728,8 @@ public abstract class PlayerList { + entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobEffect)); + } + ++ entityplayer.setSneaking(false); // Paper - fix MC-10657 ++ + // Fire advancement trigger + entityplayer.b(((CraftWorld) fromWorld).getHandle()); + +-- +2.23.0.rc1 +