From f48d4299689c6f51e50a2349fb251edf73cd5667 Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Sun, 19 Apr 2020 12:26:07 +0200 Subject: [PATCH] Allow sleeping players to float This change lets players who are in their bed have a position which is above ground for a longer period of time. This is because of the server not setting their position to the ground/exit location when entering the bed, resulting in the server believing they're still in the air. --- ...0489-Allow-sleeping-players-to-float.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Spigot-Server-Patches/0489-Allow-sleeping-players-to-float.patch diff --git a/Spigot-Server-Patches/0489-Allow-sleeping-players-to-float.patch b/Spigot-Server-Patches/0489-Allow-sleeping-players-to-float.patch new file mode 100644 index 0000000000..1aaf899dbf --- /dev/null +++ b/Spigot-Server-Patches/0489-Allow-sleeping-players-to-float.patch @@ -0,0 +1,26 @@ +From 745817e332e81fcd0cf237255f0ed25855c44d07 Mon Sep 17 00:00:00 2001 +From: Mariell Hoversholm +Date: Sun, 19 Apr 2020 12:25:20 +0200 +Subject: [PATCH] Allow sleeping players to float + +This change lets players who are in their bed have a position which is above +ground for a longer period of time. This is because of the server not setting +their position to the ground/exit location when entering the bed, resulting in +the server believing they're still in the air. + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 7929fcc800..8f93a7758c 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -150,7 +150,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + this.player.setLocation(this.l, this.m, this.n, this.player.yaw, this.player.pitch); + ++this.e; + this.processedMovePackets = this.receivedMovePackets; +- if (this.B) { ++ if (this.B && !this.player.isSleeping()) { // Paper - #3176 Allow sleeping players to float + if (++this.C > 80) { + PlayerConnection.LOGGER.warn("{} was kicked for floating too long!", this.player.getDisplayName().getString()); + this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickPlayerMessage); // Paper - use configurable kick message +-- +2.25.1 +