diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/MultiBlockUpdaterAgent.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/MultiBlockUpdaterAgent.java index 607288295..83a1d8159 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/MultiBlockUpdaterAgent.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/block/MultiBlockUpdaterAgent.java @@ -105,7 +105,8 @@ public class MultiBlockUpdaterAgent { for(Player p : players) { - UtilPlayer.sendPacket(p, new PacketPlayOutMapChunk(c, true, 65535)); + int protocol = UtilPlayer.getProtocol(p); + UtilPlayer.sendPacket(p, new PacketPlayOutMapChunk(protocol, c, true, 65535)); } } else diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java index d528336c1..940890c8a 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java @@ -1167,7 +1167,7 @@ public class UtilPlayer } Packet packet; - int protocol = ((CraftPlayer) player).getHandle().getProtocol(); + int protocol = getProtocol(player); Location location = player.getLocation(); if (protocol >= ProtocolVersion.v1_12) @@ -1209,7 +1209,7 @@ public class UtilPlayer teleportUniform(players, locations, Entity::teleport); } - public static int getProtocolVersion(Player player) + public static int getProtocol(Player player) { return ((CraftPlayer) player).getHandle().getProtocol(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index 6a5e4fd54..69d46f978 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -554,7 +554,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler if (pDisguise.getSleepingDirection() != null) { - for (Packet packet : getBedPackets(pDisguise)) + for (Packet packet : getBedPackets(protocol, pDisguise)) { handlePacket(packet, packetVerifier); } @@ -821,14 +821,15 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler { List packets = new ArrayList<>(); - PacketPlayOutMapChunk chunk = new PacketPlayOutMapChunk(_bedChunk, true, '\uffff'); + EntityPlayer nmsPlayer = ((CraftPlayer) player).getHandle(); + int protocol = nmsPlayer.getProtocol(); + + PacketPlayOutMapChunk chunk = new PacketPlayOutMapChunk(protocol, _bedChunk, true, '\uffff'); chunk.a = BED_POS_NORTH[0] >> 4; chunk.b = BED_POS_NORTH[2] >> 4; packets.add(chunk); - EntityPlayer nmsPlayer = ((CraftPlayer) player).getHandle(); - _spawnPacketMap.entrySet().stream() .filter(entry -> entry.getValue().size() > 0 && entry.getValue().getFirst() instanceof DisguisePlayer && ((DisguisePlayer) entry.getValue().getFirst()).getSleepingDirection() != null) .filter(entry -> this.containsSpawnDisguise(player, entry.getValue().getFirst())) @@ -838,7 +839,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler if (tracker != null && tracker.trackedPlayers.contains(nmsPlayer)) { - packets.addAll(getBedPackets((DisguisePlayer) entry.getValue().getFirst())); + packets.addAll(getBedPackets(protocol, (DisguisePlayer) entry.getValue().getFirst())); } }); @@ -853,7 +854,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler * * fixme can we make this better at all?!?!?! */ - private List getBedPackets(DisguisePlayer playerDisguise) + private List getBedPackets(int protocol, DisguisePlayer playerDisguise) { int[] coords = getCoordsFor(playerDisguise); @@ -874,7 +875,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler double d2 = posZ + (targetZ - posZ) / (double) partitions; - PacketPlayOutMapChunk chunk = new PacketPlayOutMapChunk(_bedChunk, true, '\uffff'); + PacketPlayOutMapChunk chunk = new PacketPlayOutMapChunk(protocol, _bedChunk, true, '\uffff'); chunk.a = (int) Math.floor(d0) >> 4; chunk.b = (int) Math.floor(d2) >> 4; packets.add(chunk); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skyfall/Crumbleable.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skyfall/Crumbleable.java index 35d61e3d4..b9a6a4aae 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skyfall/Crumbleable.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skyfall/Crumbleable.java @@ -153,7 +153,8 @@ public abstract class Crumbleable for (Player player : UtilServer.getPlayers()) { - UtilPlayer.sendPacket(player, new PacketPlayOutMapChunk(chunk, false, mask)); + int protocol = UtilPlayer.getProtocol(player); + UtilPlayer.sendPacket(player, new PacketPlayOutMapChunk(protocol, chunk, false, mask)); } _lastChunk = System.currentTimeMillis();