3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/patches/server/0347-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-07-07 08:52:40 +02:00
index 3796a288b42a2f636ba78cb02d8127ee244b8eed..c7629749204f20e64b7fb8b68a58465553585c14 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-07-07 08:52:40 +02:00
@@ -1097,6 +1097,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-07-07 08:52:40 +02:00
index 993f31b9106b5e20c62bfd405daa9fe55046840f..4ba978af436cb114aa5274df5cd8bd25ff7be2c9 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-07-07 08:52:40 +02:00
@@ -828,6 +828,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());