use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class SmartWrenchItem method addInformation.
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean whatIsThis) {
super.addInformation(itemStack, player, list, whatIsThis);
GlobalCoordinate b = getCurrentBlock(itemStack);
if (b != null) {
list.add(EnumChatFormatting.GREEN + "Block: " + b.getCoordinate().toString() + " at dimension " + b.getDimension());
}
SmartWrenchMode mode = getCurrentMode(itemStack);
list.add(EnumChatFormatting.WHITE + "Right-click on air to change mode.");
list.add(EnumChatFormatting.GREEN + "Mode: " + mode.getName());
if (mode == SmartWrenchMode.MODE_WRENCH) {
list.add(EnumChatFormatting.WHITE + "Use as a normal wrench:");
list.add(EnumChatFormatting.WHITE + " Sneak-right-click to pick up machines.");
list.add(EnumChatFormatting.WHITE + " Right-click to rotate machines.");
} else if (mode == SmartWrenchMode.MODE_SELECT) {
list.add(EnumChatFormatting.WHITE + "Use as a block selector:");
list.add(EnumChatFormatting.WHITE + " Sneak-right-click select master block.");
list.add(EnumChatFormatting.WHITE + " Right-click to associate blocks with master.");
}
}
use of mcjty.lib.varia.GlobalCoordinate 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;
}
use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class MatterReceiverTileEntity method getOrCalculateID.
public int getOrCalculateID() {
if (id == -1) {
TeleportDestinations destinations = TeleportDestinations.getDestinations(worldObj);
GlobalCoordinate gc = new GlobalCoordinate(new Coordinate(xCoord, yCoord, zCoord), worldObj.provider.dimensionId);
id = destinations.getNewId(gc);
destinations.save(worldObj);
setId(id);
}
return id;
}
use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class MatterReceiverTileEntity method updateDestination.
/**
* This method is called after putting down a receiver that was earlier wrenched. We need to fix the data in
* the destination.
*/
public void updateDestination() {
TeleportDestinations destinations = TeleportDestinations.getDestinations(worldObj);
GlobalCoordinate gc = new GlobalCoordinate(new Coordinate(xCoord, yCoord, zCoord), worldObj.provider.dimensionId);
TeleportDestination destination = destinations.getDestination(gc.getCoordinate(), gc.getDimension());
if (destination != null) {
destination.setName(name);
if (id == -1) {
id = destinations.getNewId(gc);
markDirty();
} else {
destinations.assignId(gc, id);
}
destinations.save(worldObj);
}
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class MatterTransmitterTileEntity method getTeleportDestination.
public TeleportDestination getTeleportDestination() {
if (teleportId != null) {
TeleportDestinations teleportDestinations = TeleportDestinations.getDestinations(worldObj);
GlobalCoordinate gc = teleportDestinations.getCoordinateForId(teleportId);
if (gc == null) {
return null;
} else {
return teleportDestinations.getDestination(gc.getCoordinate(), gc.getDimension());
}
}
return teleportDestination;
}
Aggregations