Search in sources :

Example 6 with Inventory

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);
}
Also used : EnumFacing(net.minecraft.util.EnumFacing) Inventory(mcjty.rftoolscontrol.api.parameters.Inventory)

Example 7 with Inventory

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);
}
Also used : EnumFacing(net.minecraft.util.EnumFacing) Inventory(mcjty.rftoolscontrol.api.parameters.Inventory)

Aggregations

Inventory (mcjty.rftoolscontrol.api.parameters.Inventory)7 EnumFacing (net.minecraft.util.EnumFacing)5 Nullable (javax.annotation.Nullable)1 DefaultSidedInventory (mcjty.lib.container.DefaultSidedInventory)1 Window (mcjty.lib.gui.Window)1 VerticalLayout (mcjty.lib.gui.layout.VerticalLayout)1 ChoiceLabel (mcjty.lib.gui.widgets.ChoiceLabel)1 Panel (mcjty.lib.gui.widgets.Panel)1 TextField (mcjty.lib.gui.widgets.TextField)1 ParameterType (mcjty.rftoolscontrol.api.parameters.ParameterType)1 ParameterValue (mcjty.rftoolscontrol.api.parameters.ParameterValue)1 ProgException (mcjty.rftoolscontrol.logic.running.ProgException)1 Minecraft (net.minecraft.client.Minecraft)1 Gui (net.minecraft.client.gui.Gui)1 IItemHandler (net.minecraftforge.items.IItemHandler)1 StringUtils (org.apache.commons.lang3.StringUtils)1