Use new map chunk packet constructor
This commit is contained in:
parent
b71055b0b4
commit
469b3816cc
@ -105,7 +105,8 @@ public class MultiBlockUpdaterAgent
|
|||||||
{
|
{
|
||||||
for(Player p : players)
|
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
|
else
|
||||||
|
@ -1167,7 +1167,7 @@ public class UtilPlayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
Packet packet;
|
Packet packet;
|
||||||
int protocol = ((CraftPlayer) player).getHandle().getProtocol();
|
int protocol = getProtocol(player);
|
||||||
Location location = player.getLocation();
|
Location location = player.getLocation();
|
||||||
|
|
||||||
if (protocol >= ProtocolVersion.v1_12)
|
if (protocol >= ProtocolVersion.v1_12)
|
||||||
@ -1209,7 +1209,7 @@ public class UtilPlayer
|
|||||||
teleportUniform(players, locations, Entity::teleport);
|
teleportUniform(players, locations, Entity::teleport);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getProtocolVersion(Player player)
|
public static int getProtocol(Player player)
|
||||||
{
|
{
|
||||||
return ((CraftPlayer) player).getHandle().getProtocol();
|
return ((CraftPlayer) player).getHandle().getProtocol();
|
||||||
}
|
}
|
||||||
|
@ -554,7 +554,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
|||||||
|
|
||||||
if (pDisguise.getSleepingDirection() != null)
|
if (pDisguise.getSleepingDirection() != null)
|
||||||
{
|
{
|
||||||
for (Packet packet : getBedPackets(pDisguise))
|
for (Packet packet : getBedPackets(protocol, pDisguise))
|
||||||
{
|
{
|
||||||
handlePacket(packet, packetVerifier);
|
handlePacket(packet, packetVerifier);
|
||||||
}
|
}
|
||||||
@ -821,14 +821,15 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
|||||||
{
|
{
|
||||||
List<Packet> packets = new ArrayList<>();
|
List<Packet> 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.a = BED_POS_NORTH[0] >> 4;
|
||||||
chunk.b = BED_POS_NORTH[2] >> 4;
|
chunk.b = BED_POS_NORTH[2] >> 4;
|
||||||
|
|
||||||
packets.add(chunk);
|
packets.add(chunk);
|
||||||
|
|
||||||
EntityPlayer nmsPlayer = ((CraftPlayer) player).getHandle();
|
|
||||||
|
|
||||||
_spawnPacketMap.entrySet().stream()
|
_spawnPacketMap.entrySet().stream()
|
||||||
.filter(entry -> entry.getValue().size() > 0 && entry.getValue().getFirst() instanceof DisguisePlayer && ((DisguisePlayer) entry.getValue().getFirst()).getSleepingDirection() != null)
|
.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()))
|
.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))
|
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?!?!?!
|
* fixme can we make this better at all?!?!?!
|
||||||
*/
|
*/
|
||||||
private List<Packet> getBedPackets(DisguisePlayer playerDisguise)
|
private List<Packet> getBedPackets(int protocol, DisguisePlayer playerDisguise)
|
||||||
{
|
{
|
||||||
int[] coords = getCoordsFor(playerDisguise);
|
int[] coords = getCoordsFor(playerDisguise);
|
||||||
|
|
||||||
@ -874,7 +875,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
|||||||
double d2 = posZ + (targetZ - posZ) / (double) partitions;
|
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.a = (int) Math.floor(d0) >> 4;
|
||||||
chunk.b = (int) Math.floor(d2) >> 4;
|
chunk.b = (int) Math.floor(d2) >> 4;
|
||||||
packets.add(chunk);
|
packets.add(chunk);
|
||||||
|
@ -153,7 +153,8 @@ public abstract class Crumbleable
|
|||||||
|
|
||||||
for (Player player : UtilServer.getPlayers())
|
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();
|
_lastChunk = System.currentTimeMillis();
|
||||||
|
Loading…
Reference in New Issue
Block a user