use of mcjty.lib.varia.Coordinate in project RFTools by McJty.
the class GuiTeleportProbe method teleport.
private void teleport(int index) {
TeleportDestinationClientInfo destination = destinationList.get(index);
Coordinate c = destination.getCoordinate();
RFToolsMessages.INSTANCE.sendToServer(new PacketForceTeleport(c.getX(), c.getY(), c.getZ(), destination.getDimension()));
}
use of mcjty.lib.varia.Coordinate in project RFTools by McJty.
the class GuiTeleportProbe method populateList.
private void populateList() {
if (serverDestinationList == null) {
return;
}
if (serverDestinationList.equals(destinationList)) {
return;
}
destinationList = new ArrayList<TeleportDestinationClientInfo>(serverDestinationList);
list.removeChildren();
for (TeleportDestinationClientInfo destination : destinationList) {
Coordinate coordinate = destination.getCoordinate();
int dim = destination.getDimension();
Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout());
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText(destination.getName()).setDesiredWidth(100));
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText(coordinate.toString()).setDesiredWidth(75));
panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText("Id " + dim).setDesiredWidth(75));
list.addChild(panel);
}
}
use of mcjty.lib.varia.Coordinate in project RFTools by McJty.
the class SmartWrenchItem method getCurrentBlock.
public static GlobalCoordinate getCurrentBlock(ItemStack itemStack) {
NBTTagCompound tagCompound = itemStack.getTagCompound();
if (tagCompound != null && tagCompound.hasKey("selectedX")) {
int x = tagCompound.getInteger("selectedX");
int y = tagCompound.getInteger("selectedY");
int z = tagCompound.getInteger("selectedZ");
int dim = tagCompound.getInteger("selectedDim");
return new GlobalCoordinate(new Coordinate(x, y, z), dim);
}
return null;
}
use of mcjty.lib.varia.Coordinate in project RFTools by McJty.
the class ShapeCardItem method composePrism.
private static void composePrism(World worldObj, Coordinate thisCoord, Coordinate dimension, Coordinate offset, Collection<Coordinate> blocks, int maxSize, boolean forquarry, ChunkCoordIntPair chunk) {
int xCoord = thisCoord.getX();
int yCoord = thisCoord.getY();
int zCoord = thisCoord.getZ();
int dx = dimension.getX();
int dy = dimension.getY();
int dz = dimension.getZ();
Coordinate tl = new Coordinate(xCoord - dx / 2 + offset.getX(), yCoord - dy / 2 + offset.getY(), zCoord - dz / 2 + offset.getZ());
for (int oy = 0; oy < dy; oy++) {
int y = tl.getY() + oy;
if (y >= 0 && y < 255) {
int yoffset = oy;
for (int ox = 0; ox < dx; ox++) {
if (ox >= yoffset && ox < dx - yoffset) {
int x = tl.getX() + ox;
if (xInChunk(x, chunk)) {
for (int oz = yoffset; oz < dz - yoffset; oz++) {
int z = tl.getZ() + oz;
if (zInChunk(z, chunk)) {
if (ox == yoffset || oy == 0 || oz == yoffset || ox == (dx - yoffset - 1) || oz == (dz - yoffset - 1)) {
placeBlockIfPossible(worldObj, blocks, maxSize, x, y, z, forquarry);
}
}
}
}
}
}
}
}
}
use of mcjty.lib.varia.Coordinate in project RFTools by McJty.
the class ShapeCardItem method getCurrentBlock.
public static GlobalCoordinate getCurrentBlock(ItemStack itemStack) {
NBTTagCompound tagCompound = itemStack.getTagCompound();
if (tagCompound != null && tagCompound.hasKey("selectedX")) {
int x = tagCompound.getInteger("selectedX");
int y = tagCompound.getInteger("selectedY");
int z = tagCompound.getInteger("selectedZ");
int dim = tagCompound.getInteger("selectedDim");
return new GlobalCoordinate(new Coordinate(x, y, z), dim);
}
return null;
}
Aggregations