Fix stuck in sneak when changing worlds (MC-10657) (#2627)

This commit is contained in:
BillyGalbreath 2019-11-24 00:02:47 -06:00 committed by Zach
parent 10c29e7369
commit 761c24fae9

View file

@ -0,0 +1,35 @@
From 0d0548d6c0dae5a044a5e52dcf56c6a4a1eb7a73 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
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