use of com.builtbroken.mc.core.network.packet.PacketSelectionData in project Engine by VoltzEngine-Project.
the class SelectionHandler method updatePlayerRenderData.
public static void updatePlayerRenderData(EntityPlayerMP player) {
List<Cube> cubes = new ArrayList();
List<Cube> regions = new ArrayList();
Cube selection = getSelection(player);
for (Cube cube : selections.values()) {
if (cube != selection && cube.distance(new Pos(player)) <= 160) {
cubes.add(cube);
}
}
for (Region region : RegionManager.getControllerForWorld(player.worldObj).getRegionsNear(player, 160)) {
for (Cube cube : region.segments) {
if (cube.isCloseToAnyCorner(new Pos(player), 160)) {
regions.add(cube);
}
}
}
Engine.instance.packetHandler.sendToPlayer(new PacketSelectionData(selection, cubes, regions), player);
}
Aggregations