Revert "Used getEntitiesWithinAABB instead of getting all the players of the world for sendToPlayers."
This reverts commit 93cd7fe74e
.
This commit is contained in:
parent
4d3851ca28
commit
03752e43d9
1 changed files with 7 additions and 5 deletions
|
@ -10,9 +10,7 @@
|
|||
package net.minecraft.src.buildcraft.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.src.AxisAlignedBB;
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.EntityItem;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
|
@ -55,9 +53,13 @@ public class CoreProxy {
|
|||
public static void sendToPlayers(Packet packet, World w, int x, int y,
|
||||
int z, int maxDistance, NetworkMod mod) {
|
||||
if (packet != null) {
|
||||
List<EntityPlayerMP> players = w.getEntitiesWithinAABB(EntityPlayerMP.class, AxisAlignedBB.getBoundingBoxFromPool(x - maxDistance, y - maxDistance, z - maxDistance, x + maxDistance, y + maxDistance, z + maxDistance));
|
||||
for (EntityPlayerMP player: players) {
|
||||
player.playerNetServerHandler.sendPacket(packet);
|
||||
for (int j = 0; j < w.playerEntities.size(); j++) {
|
||||
EntityPlayerMP player = (EntityPlayerMP)w.playerEntities.get(j);
|
||||
|
||||
if (Math.abs(player.posX - x) <= maxDistance
|
||||
&& Math.abs(player.posY - y) <= maxDistance
|
||||
&& Math.abs(player.posZ - z) <= maxDistance)
|
||||
player.playerNetServerHandler.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue