Fix Y issue in falling block disguise grid lock

This commit is contained in:
libraryaddict 2020-09-03 16:11:02 +12:00
parent 14cf777cab
commit 865326eda7

View File

@ -39,7 +39,7 @@ public class PacketHandlerMovement implements IPacketHandler {
@Override @Override
public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer,
Entity entity) { Entity entity) {
handle2(disguise, sentPacket, packets, observer, entity); handle2(disguise, sentPacket, packets, observer, entity);
int len = disguise.getMultiNameLength(); int len = disguise.getMultiNameLength();
@ -69,7 +69,7 @@ public class PacketHandlerMovement implements IPacketHandler {
} }
public void handle2(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, public void handle2(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer,
Entity entity) { Entity entity) {
if (invalid && RandomUtils.nextDouble() < 0.1) { if (invalid && RandomUtils.nextDouble() < 0.1) {
packets.clear(); packets.clear();
return; return;
@ -115,8 +115,7 @@ public class PacketHandlerMovement implements IPacketHandler {
double y = loc.getBlockY(); double y = loc.getBlockY();
// Force into a multiple of 0.25 y += (loc.getY() % 1 >= 0.85 ? 1 : loc.getY() % 1 >= 0.35 ? .5 : 0);
y += Math.floor((loc.getY() % 1) * 4) / 4D;
doubles.write(1, y); doubles.write(1, y);
doubles.write(2, loc.getBlockZ() + 0.5); doubles.write(2, loc.getBlockZ() + 0.5);