Paper/patches/server/0345-Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch

33 Zeilen
1.8 KiB
Diff

2021-06-11 14:02:28 +02:00
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
2021-06-15 07:49:09 +02:00
index 62a43f3e6f27245a0baec7ff703ec023dd4e5e05..6086f86e6fd0395553aef42df4aef6a117231896 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
2021-06-13 21:29:58 +02:00
@@ -1101,6 +1101,8 @@ public class ServerPlayer extends Player {
2021-06-11 14:02:28 +02:00
this.lastSentHealth = -1.0F;
this.lastSentFood = -1;
2021-06-13 21:29:58 +02:00
+ setShiftKeyDown(false); // Paper - fix MC-10657
2021-06-11 14:02:28 +02:00
+
// 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
2021-06-13 21:29:58 +02:00
index 6f9bd5da1504af296e7ee2a69d8afdd3bc4cfd5e..bcc946d2747443c34ee8ac2485a5ab41773c93af 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
2021-06-13 21:29:58 +02:00
@@ -820,6 +820,8 @@ public abstract class PlayerList {
2021-06-11 14:02:28 +02:00
entityplayer.connection.send(new ClientboundUpdateMobEffectPacket(entityplayer.getId(), mobEffect));
}
+ entityplayer.setShiftKeyDown(false); // Paper - fix MC-10657
+
// Fire advancement trigger
entityplayer.triggerDimensionChangeTriggers(((CraftWorld) fromWorld).getHandle());