Fix error when visualizing outside view distance
This commit is contained in:
parent
cba04dc208
commit
c474917ec2
@ -406,11 +406,11 @@ public class BukkitQueue_1_10 extends BukkitQueue_0<net.minecraft.server.v1_10_R
|
|||||||
try {
|
try {
|
||||||
PlayerChunkMap playerManager = ((CraftWorld) getWorld()).getHandle().getPlayerChunkMap();
|
PlayerChunkMap playerManager = ((CraftWorld) getWorld()).getHandle().getPlayerChunkMap();
|
||||||
boolean watching = false;
|
boolean watching = false;
|
||||||
|
boolean[] watchingArr = new boolean[players.length];
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
EntityPlayer player = ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle();
|
EntityPlayer player = ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle();
|
||||||
if (!playerManager.a(player, chunk.getX(), chunk.getZ())) {
|
if (playerManager.a(player, chunk.getX(), chunk.getZ())) {
|
||||||
players[i] = null;
|
watchingArr[i] = true;
|
||||||
} else {
|
|
||||||
watching = true;
|
watching = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -445,8 +445,8 @@ public class BukkitQueue_1_10 extends BukkitQueue_0<net.minecraft.server.v1_10_R
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
packet.a(buffer);
|
packet.a(buffer);
|
||||||
for (FawePlayer player : players) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
if (player != null) ((CraftPlayer) ((BukkitPlayer) player).parent).getHandle().playerConnection.sendPacket(packet);
|
if (watchingArr[i]) ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -406,11 +406,11 @@ public class BukkitQueue_1_11 extends BukkitQueue_0<net.minecraft.server.v1_11_R
|
|||||||
try {
|
try {
|
||||||
PlayerChunkMap playerManager = ((CraftWorld) getWorld()).getHandle().getPlayerChunkMap();
|
PlayerChunkMap playerManager = ((CraftWorld) getWorld()).getHandle().getPlayerChunkMap();
|
||||||
boolean watching = false;
|
boolean watching = false;
|
||||||
|
boolean[] watchingArr = new boolean[players.length];
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
EntityPlayer player = ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle();
|
EntityPlayer player = ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle();
|
||||||
if (!playerManager.a(player, chunk.getX(), chunk.getZ())) {
|
if (playerManager.a(player, chunk.getX(), chunk.getZ())) {
|
||||||
players[i] = null;
|
watchingArr[i] = true;
|
||||||
} else {
|
|
||||||
watching = true;
|
watching = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -445,8 +445,8 @@ public class BukkitQueue_1_11 extends BukkitQueue_0<net.minecraft.server.v1_11_R
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
packet.a(buffer);
|
packet.a(buffer);
|
||||||
for (FawePlayer player : players) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
if (player != null) ((CraftPlayer) ((BukkitPlayer) player).parent).getHandle().playerConnection.sendPacket(packet);
|
if (watchingArr[i]) ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -267,11 +267,11 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<net.minecraft.server.v1_9_
|
|||||||
try {
|
try {
|
||||||
PlayerChunkMap playerManager = ((CraftWorld) getWorld()).getHandle().getPlayerChunkMap();
|
PlayerChunkMap playerManager = ((CraftWorld) getWorld()).getHandle().getPlayerChunkMap();
|
||||||
boolean watching = false;
|
boolean watching = false;
|
||||||
|
boolean[] watchingArr = new boolean[players.length];
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
EntityPlayer player = ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle();
|
EntityPlayer player = ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle();
|
||||||
if (!playerManager.a(player, chunk.getX(), chunk.getZ())) {
|
if (playerManager.a(player, chunk.getX(), chunk.getZ())) {
|
||||||
players[i] = null;
|
watchingArr[i] = true;
|
||||||
} else {
|
|
||||||
watching = true;
|
watching = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -306,8 +306,8 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<net.minecraft.server.v1_9_
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
packet.a(buffer);
|
packet.a(buffer);
|
||||||
for (FawePlayer player : players) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
if (player != null) ((CraftPlayer) ((BukkitPlayer) player).parent).getHandle().playerConnection.sendPacket(packet);
|
if (watchingArr[i]) ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -154,11 +154,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
try {
|
try {
|
||||||
PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
|
PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
|
||||||
boolean watching = false;
|
boolean watching = false;
|
||||||
|
boolean[] watchingArr = new boolean[players.length];
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
||||||
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
||||||
players[i] = null;
|
watchingArr[i] = true;
|
||||||
} else {
|
|
||||||
watching = true;
|
watching = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -192,8 +192,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
packet.readPacketData(buffer);
|
packet.readPacketData(buffer);
|
||||||
for (FawePlayer player : players) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).connection.sendPacket(packet);
|
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).connection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -169,11 +169,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
try {
|
try {
|
||||||
PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
|
PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
|
||||||
boolean watching = false;
|
boolean watching = false;
|
||||||
|
boolean[] watchingArr = new boolean[players.length];
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
||||||
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
||||||
players[i] = null;
|
watchingArr[i] = true;
|
||||||
} else {
|
|
||||||
watching = true;
|
watching = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,8 +207,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
packet.readPacketData(buffer);
|
packet.readPacketData(buffer);
|
||||||
for (FawePlayer player : players) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).connection.sendPacket(packet);
|
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).connection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -330,11 +330,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
try {
|
try {
|
||||||
PlayerManager playerManager = ((WorldServer) getWorld()).getPlayerManager();
|
PlayerManager playerManager = ((WorldServer) getWorld()).getPlayerManager();
|
||||||
boolean watching = false;
|
boolean watching = false;
|
||||||
|
boolean[] watchingArr = new boolean[players.length];
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
||||||
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
||||||
players[i] = null;
|
watchingArr[i] = true;
|
||||||
} else {
|
|
||||||
watching = true;
|
watching = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -368,8 +368,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
packet.readPacketData(buffer);
|
packet.readPacketData(buffer);
|
||||||
for (FawePlayer player : players) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).playerNetServerHandler.sendPacket(packet);
|
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).playerNetServerHandler.sendPacket(packet);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -211,11 +211,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
try {
|
try {
|
||||||
PlayerManager playerManager = ((WorldServer) getWorld()).getPlayerManager();
|
PlayerManager playerManager = ((WorldServer) getWorld()).getPlayerManager();
|
||||||
boolean watching = false;
|
boolean watching = false;
|
||||||
|
boolean[] watchingArr = new boolean[players.length];
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
||||||
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
||||||
players[i] = null;
|
watchingArr[i] = true;
|
||||||
} else {
|
|
||||||
watching = true;
|
watching = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -249,8 +249,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
packet.readPacketData(buffer);
|
packet.readPacketData(buffer);
|
||||||
for (FawePlayer player : players) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).playerNetServerHandler.sendPacket(packet);
|
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).playerNetServerHandler.sendPacket(packet);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -252,11 +252,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
try {
|
try {
|
||||||
PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
|
PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
|
||||||
boolean watching = false;
|
boolean watching = false;
|
||||||
|
boolean[] watchingArr = new boolean[players.length];
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
|
||||||
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
|
||||||
players[i] = null;
|
watchingArr[i] = true;
|
||||||
} else {
|
|
||||||
watching = true;
|
watching = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -290,8 +290,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
packet.readPacketData(buffer);
|
packet.readPacketData(buffer);
|
||||||
for (FawePlayer player : players) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).connection.sendPacket(packet);
|
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).connection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user