From 865326eda7864f22e4dd35a5cbf7c479f6f27b91 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 3 Sep 2020 16:11:02 +1200 Subject: [PATCH] Fix Y issue in falling block disguise grid lock --- .../packets/packethandlers/PacketHandlerMovement.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java index a49ea613..049f08be 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java @@ -39,7 +39,7 @@ public class PacketHandlerMovement implements IPacketHandler { @Override public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, - Entity entity) { + Entity entity) { handle2(disguise, sentPacket, packets, observer, entity); int len = disguise.getMultiNameLength(); @@ -69,7 +69,7 @@ public class PacketHandlerMovement implements IPacketHandler { } public void handle2(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, - Entity entity) { + Entity entity) { if (invalid && RandomUtils.nextDouble() < 0.1) { packets.clear(); return; @@ -115,8 +115,7 @@ public class PacketHandlerMovement implements IPacketHandler { double y = loc.getBlockY(); - // Force into a multiple of 0.25 - y += Math.floor((loc.getY() % 1) * 4) / 4D; + y += (loc.getY() % 1 >= 0.85 ? 1 : loc.getY() % 1 >= 0.35 ? .5 : 0); doubles.write(1, y); doubles.write(2, loc.getBlockZ() + 0.5);