Search in sources :

Example 41 with Coordinate

use of mcjty.lib.varia.Coordinate in project RFTools by McJty.

the class MachineInformationScreenModule method setupFromNBT.

@Override
public void setupFromNBT(NBTTagCompound tagCompound, int dim, int x, int y, int z) {
    if (tagCompound != null) {
        coordinate = Coordinate.INVALID;
        tag = tagCompound.getInteger("monitorTag");
        if (tagCompound.hasKey("monitorx")) {
            this.dim = tagCompound.getInteger("dim");
            if (dim == this.dim) {
                Coordinate c = new Coordinate(tagCompound.getInteger("monitorx"), tagCompound.getInteger("monitory"), tagCompound.getInteger("monitorz"));
                int dx = Math.abs(c.getX() - x);
                int dy = Math.abs(c.getY() - y);
                int dz = Math.abs(c.getZ() - z);
                if (dx <= 64 && dy <= 64 && dz <= 64) {
                    coordinate = c;
                }
            }
        }
    }
}
Also used : Coordinate(mcjty.lib.varia.Coordinate)

Example 42 with Coordinate

use of mcjty.lib.varia.Coordinate in project RFTools by McJty.

the class EnergyPlusBarScreenModule method setupFromNBT.

@Override
public void setupFromNBT(NBTTagCompound tagCompound, int dim, int x, int y, int z) {
    if (tagCompound != null) {
        helper.setShowdiff(tagCompound.getBoolean("showdiff"));
        coordinate = Coordinate.INVALID;
        if (tagCompound.hasKey("monitorx")) {
            this.dim = tagCompound.getInteger("dim");
            coordinate = new Coordinate(tagCompound.getInteger("monitorx"), tagCompound.getInteger("monitory"), tagCompound.getInteger("monitorz"));
        }
    }
}
Also used : Coordinate(mcjty.lib.varia.Coordinate)

Example 43 with Coordinate

use of mcjty.lib.varia.Coordinate in project RFTools by McJty.

the class FluidPlusBarScreenModule method setupFromNBT.

@Override
public void setupFromNBT(NBTTagCompound tagCompound, int dim, int x, int y, int z) {
    if (tagCompound != null) {
        helper.setShowdiff(tagCompound.getBoolean("showdiff"));
        coordinate = Coordinate.INVALID;
        if (tagCompound.hasKey("monitorx")) {
            this.dim = tagCompound.getInteger("dim");
            coordinate = new Coordinate(tagCompound.getInteger("monitorx"), tagCompound.getInteger("monitory"), tagCompound.getInteger("monitorz"));
        }
    }
}
Also used : Coordinate(mcjty.lib.varia.Coordinate)

Example 44 with Coordinate

use of mcjty.lib.varia.Coordinate in project RFTools by McJty.

the class ItemStackScreenModule method setupCoordinateFromNBT.

protected void setupCoordinateFromNBT(NBTTagCompound tagCompound, int dim, int x, int y, int z) {
    coordinate = Coordinate.INVALID;
    if (tagCompound.hasKey("monitorx")) {
        this.dim = tagCompound.getInteger("dim");
        if (dim == this.dim) {
            Coordinate c = new Coordinate(tagCompound.getInteger("monitorx"), tagCompound.getInteger("monitory"), tagCompound.getInteger("monitorz"));
            int dx = Math.abs(c.getX() - x);
            int dy = Math.abs(c.getY() - y);
            int dz = Math.abs(c.getZ() - z);
            if (dx <= 64 && dy <= 64 && dz <= 64) {
                coordinate = c;
            }
        }
    }
}
Also used : Coordinate(mcjty.lib.varia.Coordinate)

Example 45 with Coordinate

use of mcjty.lib.varia.Coordinate in project RFTools by McJty.

the class ScreenControllerTileEntity method readFromNBT.

@Override
public void readFromNBT(NBTTagCompound tagCompound) {
    super.readFromNBT(tagCompound);
    int[] xes = tagCompound.getIntArray("screensx");
    int[] yes = tagCompound.getIntArray("screensy");
    int[] zes = tagCompound.getIntArray("screensz");
    connectedScreens.clear();
    for (int i = 0; i < xes.length; i++) {
        connectedScreens.add(new Coordinate(xes[i], yes[i], zes[i]));
    }
}
Also used : Coordinate(mcjty.lib.varia.Coordinate)

Aggregations

Coordinate (mcjty.lib.varia.Coordinate)181 GlobalCoordinate (mcjty.lib.varia.GlobalCoordinate)63 TileEntity (net.minecraft.tileentity.TileEntity)30 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)19 Block (net.minecraft.block.Block)14 HashMap (java.util.HashMap)13 Map (java.util.Map)13 GenericEnergyReceiverTileEntity (mcjty.lib.entity.GenericEnergyReceiverTileEntity)13 World (net.minecraft.world.World)12 NBTTagList (net.minecraft.nbt.NBTTagList)11 Callback (li.cil.oc.api.machine.Callback)10 HorizontalLayout (mcjty.lib.gui.layout.HorizontalLayout)10 Panel (mcjty.lib.gui.widgets.Panel)10 ItemStack (net.minecraft.item.ItemStack)10 ArrayList (java.util.ArrayList)9 Label (mcjty.lib.gui.widgets.Label)8 BlockInfo (mcjty.rftools.BlockInfo)7 SyncedCoordinate (mcjty.lib.entity.SyncedCoordinate)5 ChoiceEvent (mcjty.lib.gui.events.ChoiceEvent)4 TeleportDestinationClientInfo (mcjty.rftools.blocks.teleporter.TeleportDestinationClientInfo)4