use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class PorterTools method checkTarget.
private static int checkTarget(EntityPlayer playerEntity, NBTTagCompound tagCompound, TeleportDestinations destinations, int curtarget, int donext, int tgt) {
if (tagCompound.hasKey("target" + tgt)) {
int target = tagCompound.getInteger("target" + tgt);
GlobalCoordinate gc = destinations.getCoordinateForId(target);
if (gc != null) {
TeleportDestination destination = destinations.getDestination(gc);
if (destination != null) {
if (donext == 1) {
String name = destination.getName() + " (dimension " + destination.getDimension() + ")";
tagCompound.setInteger("target", target);
ITextComponent component = new TextComponentString(TextFormatting.GREEN + "Target: " + TextFormatting.WHITE + name);
if (playerEntity != null) {
playerEntity.sendStatusMessage(component, false);
}
donext = 2;
} else if (target == curtarget) {
donext = 1;
}
}
}
}
return donext;
}
use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class PacketGetScreenData method fromBytes.
@Override
public void fromBytes(ByteBuf buf) {
modid = NetworkTools.readString(buf);
pos = new GlobalCoordinate(NetworkTools.readPos(buf), buf.readInt());
millis = buf.readLong();
}
use of mcjty.lib.varia.GlobalCoordinate in project RFTools by McJty.
the class PacketReturnScreenData method fromBytes.
@Override
public void fromBytes(ByteBuf buf) {
pos = new GlobalCoordinate(NetworkTools.readPos(buf), buf.readInt());
int size = buf.readInt();
screenData = new HashMap<>(size);
for (int i = 0; i < size; i++) {
int key = buf.readInt();
int shortId = buf.readInt();
String id = RFTools.screenModuleRegistry.getNormalId(shortId);
IModuleDataFactory<?> dataFactory = RFTools.screenModuleRegistry.getModuleDataFactory(id);
IModuleData data = dataFactory.createData(buf);
screenData.put(key, data);
}
}
Aggregations