Search in sources :

Example 1 with PacketSelectionData

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);
}
Also used : PacketSelectionData(com.builtbroken.mc.core.network.packet.PacketSelectionData) Cube(com.builtbroken.mc.imp.transform.region.Cube) Pos(com.builtbroken.mc.imp.transform.vector.Pos) ArrayList(java.util.ArrayList) Region(com.builtbroken.mc.modflag.Region)

Aggregations

PacketSelectionData (com.builtbroken.mc.core.network.packet.PacketSelectionData)1 Cube (com.builtbroken.mc.imp.transform.region.Cube)1 Pos (com.builtbroken.mc.imp.transform.vector.Pos)1 Region (com.builtbroken.mc.modflag.Region)1 ArrayList (java.util.ArrayList)1