From 0000000000000000000000000000000000000000 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 8965141ab85df736e6adad6a3cf728864f582949..4cdd2612b41f7fe16f307dfdc05350009df2cbca 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1016,6 +1016,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(), worldserver1.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 0144e3ac2f0c09fe49b6cbc21799caf2352b85d0..15a12ebc266c54d2b29f368fc31df76b994b28ae 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -759,6 +759,8 @@ public abstract class PlayerList { entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobEffect)); } + entityplayer.setSneaking(false); // Paper - fix MC-10657 + // Fire advancement trigger entityplayer.triggerDimensionAdvancements(((CraftWorld) fromWorld).getHandle());