33 lines
1.8 KiB
Diff
33 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 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/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
index dc0b6b9a22b31940cc997431af644ea9c772f8cb..259536a667d64ff4a81aa7f7b8c8ffb7ff593c5c 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -1097,6 +1097,8 @@ public class ServerPlayer extends Player {
|
|
this.lastSentHealth = -1.0F;
|
|
this.lastSentFood = -1;
|
|
|
|
+ setShiftKeyDown(false); // Paper - fix MC-10657
|
|
+
|
|
// CraftBukkit start
|
|
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
|
|
this.level.getCraftServer().getPluginManager().callEvent(changeEvent);
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
index 993f31b9106b5e20c62bfd405daa9fe55046840f..4ba978af436cb114aa5274df5cd8bd25ff7be2c9 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -828,6 +828,8 @@ public abstract class PlayerList {
|
|
entityplayer.connection.send(new ClientboundUpdateMobEffectPacket(entityplayer.getId(), mobEffect));
|
|
}
|
|
|
|
+ entityplayer.setShiftKeyDown(false); // Paper - fix MC-10657
|
|
+
|
|
// Fire advancement trigger
|
|
entityplayer.triggerDimensionChangeTriggers(((CraftWorld) fromWorld).getHandle());
|
|
|