use of mcjty.rftoolscontrol.api.parameters.Inventory in project RFToolsControl by McJty.
the class InventoryUtil method readBuf.
public static Inventory readBuf(ByteBuf buf) {
String nodeName = NetworkTools.readString(buf);
int sideIdx = buf.readByte();
EnumFacing side = EnumFacing.values()[sideIdx];
sideIdx = buf.readByte();
EnumFacing intSide = sideIdx == -1 ? null : EnumFacing.values()[sideIdx];
return new Inventory(nodeName, side, intSide);
}
use of mcjty.rftoolscontrol.api.parameters.Inventory in project RFToolsControl by McJty.
the class InventoryUtil method readFromNBT.
public static Inventory readFromNBT(NBTTagCompound tag) {
String nodeName = null;
if (tag.hasKey("node")) {
nodeName = tag.getString("node");
}
int sideIdx = tag.getByte("side");
EnumFacing side = EnumFacing.values()[sideIdx];
sideIdx = tag.getByte("intside");
EnumFacing intSide = sideIdx == -1 ? null : EnumFacing.values()[sideIdx];
return new Inventory(nodeName, side, intSide);
}
Aggregations