Fix error when visualizing outside view distance

This commit is contained in:
Jesse Boyd 2017-03-31 12:27:33 +11:00
parent cba04dc208
commit c474917ec2
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
8 changed files with 40 additions and 40 deletions

View File

@ -406,11 +406,11 @@ public class BukkitQueue_1_10 extends BukkitQueue_0<net.minecraft.server.v1_10_R
try {
PlayerChunkMap playerManager = ((CraftWorld) getWorld()).getHandle().getPlayerChunkMap();
boolean watching = false;
boolean[] watchingArr = new boolean[players.length];
for (int i = 0; i < players.length; i++) {
EntityPlayer player = ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle();
if (!playerManager.a(player, chunk.getX(), chunk.getZ())) {
players[i] = null;
} else {
if (playerManager.a(player, chunk.getX(), chunk.getZ())) {
watchingArr[i] = true;
watching = true;
}
}
@ -445,8 +445,8 @@ public class BukkitQueue_1_10 extends BukkitQueue_0<net.minecraft.server.v1_10_R
}
});
packet.a(buffer);
for (FawePlayer player : players) {
if (player != null) ((CraftPlayer) ((BukkitPlayer) player).parent).getHandle().playerConnection.sendPacket(packet);
for (int i = 0; i < players.length; i++) {
if (watchingArr[i]) ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle().playerConnection.sendPacket(packet);
}
} catch (IOException e) {
e.printStackTrace();

View File

@ -406,11 +406,11 @@ public class BukkitQueue_1_11 extends BukkitQueue_0<net.minecraft.server.v1_11_R
try {
PlayerChunkMap playerManager = ((CraftWorld) getWorld()).getHandle().getPlayerChunkMap();
boolean watching = false;
boolean[] watchingArr = new boolean[players.length];
for (int i = 0; i < players.length; i++) {
EntityPlayer player = ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle();
if (!playerManager.a(player, chunk.getX(), chunk.getZ())) {
players[i] = null;
} else {
if (playerManager.a(player, chunk.getX(), chunk.getZ())) {
watchingArr[i] = true;
watching = true;
}
}
@ -445,8 +445,8 @@ public class BukkitQueue_1_11 extends BukkitQueue_0<net.minecraft.server.v1_11_R
}
});
packet.a(buffer);
for (FawePlayer player : players) {
if (player != null) ((CraftPlayer) ((BukkitPlayer) player).parent).getHandle().playerConnection.sendPacket(packet);
for (int i = 0; i < players.length; i++) {
if (watchingArr[i]) ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle().playerConnection.sendPacket(packet);
}
} catch (IOException e) {
e.printStackTrace();

View File

@ -267,11 +267,11 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<net.minecraft.server.v1_9_
try {
PlayerChunkMap playerManager = ((CraftWorld) getWorld()).getHandle().getPlayerChunkMap();
boolean watching = false;
boolean[] watchingArr = new boolean[players.length];
for (int i = 0; i < players.length; i++) {
EntityPlayer player = ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle();
if (!playerManager.a(player, chunk.getX(), chunk.getZ())) {
players[i] = null;
} else {
if (playerManager.a(player, chunk.getX(), chunk.getZ())) {
watchingArr[i] = true;
watching = true;
}
}
@ -306,8 +306,8 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<net.minecraft.server.v1_9_
}
});
packet.a(buffer);
for (FawePlayer player : players) {
if (player != null) ((CraftPlayer) ((BukkitPlayer) player).parent).getHandle().playerConnection.sendPacket(packet);
for (int i = 0; i < players.length; i++) {
if (watchingArr[i]) ((CraftPlayer) ((BukkitPlayer) players[i]).parent).getHandle().playerConnection.sendPacket(packet);
}
} catch (IOException e) {
e.printStackTrace();

View File

@ -154,11 +154,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
try {
PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
boolean watching = false;
boolean[] watchingArr = new boolean[players.length];
for (int i = 0; i < players.length; i++) {
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
players[i] = null;
} else {
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
watchingArr[i] = true;
watching = true;
}
}
@ -192,8 +192,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
}
});
packet.readPacketData(buffer);
for (FawePlayer player : players) {
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).connection.sendPacket(packet);
for (int i = 0; i < players.length; i++) {
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).connection.sendPacket(packet);
}
} catch (IOException e) {
e.printStackTrace();

View File

@ -169,11 +169,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
try {
PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
boolean watching = false;
boolean[] watchingArr = new boolean[players.length];
for (int i = 0; i < players.length; i++) {
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
players[i] = null;
} else {
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
watchingArr[i] = true;
watching = true;
}
}
@ -207,8 +207,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
}
});
packet.readPacketData(buffer);
for (FawePlayer player : players) {
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).connection.sendPacket(packet);
for (int i = 0; i < players.length; i++) {
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).connection.sendPacket(packet);
}
} catch (IOException e) {
e.printStackTrace();

View File

@ -330,11 +330,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
try {
PlayerManager playerManager = ((WorldServer) getWorld()).getPlayerManager();
boolean watching = false;
boolean[] watchingArr = new boolean[players.length];
for (int i = 0; i < players.length; i++) {
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
players[i] = null;
} else {
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
watchingArr[i] = true;
watching = true;
}
}
@ -368,8 +368,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
}
});
packet.readPacketData(buffer);
for (FawePlayer player : players) {
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).playerNetServerHandler.sendPacket(packet);
for (int i = 0; i < players.length; i++) {
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).playerNetServerHandler.sendPacket(packet);
}
} catch (IOException e) {
e.printStackTrace();

View File

@ -211,11 +211,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
try {
PlayerManager playerManager = ((WorldServer) getWorld()).getPlayerManager();
boolean watching = false;
boolean[] watchingArr = new boolean[players.length];
for (int i = 0; i < players.length; i++) {
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
players[i] = null;
} else {
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
watchingArr[i] = true;
watching = true;
}
}
@ -249,8 +249,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
}
});
packet.readPacketData(buffer);
for (FawePlayer player : players) {
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).playerNetServerHandler.sendPacket(packet);
for (int i = 0; i < players.length; i++) {
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).playerNetServerHandler.sendPacket(packet);
}
} catch (IOException e) {
e.printStackTrace();

View File

@ -252,11 +252,11 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
try {
PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
boolean watching = false;
boolean[] watchingArr = new boolean[players.length];
for (int i = 0; i < players.length; i++) {
EntityPlayerMP player = (EntityPlayerMP) ((ForgePlayer) players[i]).parent;
if (!playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
players[i] = null;
} else {
if (playerManager.isPlayerWatchingChunk(player, chunk.getX(), chunk.getZ())) {
watchingArr[i] = true;
watching = true;
}
}
@ -290,8 +290,8 @@ public class ForgeQueue_All extends NMSMappedFaweQueue<World, Chunk, ExtendedBlo
}
});
packet.readPacketData(buffer);
for (FawePlayer player : players) {
if (player != null) ((EntityPlayerMP) ((ForgePlayer) player).parent).connection.sendPacket(packet);
for (int i = 0; i < players.length; i++) {
if (watchingArr[i]) ((EntityPlayerMP) ((ForgePlayer) players[i]).parent).connection.sendPacket(packet);
}
} catch (IOException e) {
e.printStackTrace();