use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class TeleportDestinations method removeDestination.
public void removeDestination(Coordinate coordinate, int dimension) {
GlobalCoordinate key = new GlobalCoordinate(coordinate, dimension);
destinations.remove(key);
Integer id = destinationIdByCoordinate.get(key);
if (id != null) {
destinationById.remove(id);
destinationIdByCoordinate.remove(key);
}
}
use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class TeleportDestinations method readDestinationsFromNBT.
private void readDestinationsFromNBT(NBTTagCompound tagCompound) {
NBTTagList lst = tagCompound.getTagList("destinations", Constants.NBT.TAG_COMPOUND);
for (int i = 0; i < lst.tagCount(); i++) {
NBTTagCompound tc = lst.getCompoundTagAt(i);
Coordinate c = new Coordinate(tc.getInteger("x"), tc.getInteger("y"), tc.getInteger("z"));
int dim = tc.getInteger("dim");
String name = tc.getString("name");
TeleportDestination destination = new TeleportDestination(c, dim);
destination.setName(name);
GlobalCoordinate gc = new GlobalCoordinate(c, dim);
destinations.put(gc, destination);
int id;
if (tc.hasKey("id")) {
id = tc.getInteger("id");
destinationById.put(id, gc);
destinationIdByCoordinate.put(gc, id);
}
}
}
use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class PeacefulEModule method tick.
@Override
public void tick(World world, int x, int y, int z, int radius, int miny, int maxy, EnvironmentalControllerTileEntity controllerTileEntity) {
if (!isActive()) {
return;
}
super.tick(world, x, y, z, radius, miny, maxy, controllerTileEntity);
PeacefulAreaManager.markArea(new GlobalCoordinate(new Coordinate(x, y, z), world.provider.dimensionId), radius, miny, maxy);
}
use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class BlockProtectorBlock method onBlockPlaced.
@Override
public int onBlockPlaced(World world, int x, int y, int z, int side, float sx, float sy, float sz, int meta) {
int rc = super.onBlockPlaced(world, x, y, z, side, sx, sy, sz, meta);
if (world.isRemote) {
return rc;
}
BlockProtectors protectors = BlockProtectors.getProtectors(world);
GlobalCoordinate gc = new GlobalCoordinate(new Coordinate(x, y, z), world.provider.dimensionId);
protectors.getNewId(gc);
protectors.save(world);
return rc;
}
use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class BlockProtectorBlock method wrenchSneakSelect.
@Override
protected boolean wrenchSneakSelect(World world, int x, int y, int z, EntityPlayer player) {
if (!world.isRemote) {
GlobalCoordinate currentBlock = SmartWrenchItem.getCurrentBlock(player.getHeldItem());
if (currentBlock == null) {
SmartWrenchItem.setCurrentBlock(player.getHeldItem(), new GlobalCoordinate(new Coordinate(x, y, z), world.provider.dimensionId));
Logging.message(player, EnumChatFormatting.YELLOW + "Selected block");
} else {
SmartWrenchItem.setCurrentBlock(player.getHeldItem(), null);
Logging.message(player, EnumChatFormatting.YELLOW + "Cleared selected block");
}
}
return true;
}
Aggregations