Search in sources :

Example 16 with Argument

use of mcjty.lib.network.Argument in project RFTools by McJty.

the class GuiStorageScanner method moveBottom.

private void moveBottom() {
    sendServerCommand(RFToolsMessages.INSTANCE, tileEntity.getDimension(), StorageScannerTileEntity.CMD_BOTTOM, new Argument("index", storageList.getSelected() - 1));
    storageList.setSelected(storageList.getChildCount() - 1);
    listDirty = 0;
}
Also used : Argument(mcjty.lib.network.Argument)

Example 17 with Argument

use of mcjty.lib.network.Argument in project RFTools by McJty.

the class GuiStorageScanner method removeFromList.

private void removeFromList() {
    sendServerCommand(RFToolsMessages.INSTANCE, tileEntity.getDimension(), StorageScannerTileEntity.CMD_REMOVE, new Argument("index", storageList.getSelected() - 1));
    listDirty = 0;
}
Also used : Argument(mcjty.lib.network.Argument)

Example 18 with Argument

use of mcjty.lib.network.Argument in project XNet by McJty.

the class AbstractEditorPanel method performUpdate.

protected void performUpdate(Argument[] args, int i, String cmd) {
    for (Map.Entry<String, Object> entry : data.entrySet()) {
        Object o = entry.getValue();
        if (o instanceof String) {
            args[i++] = new Argument(entry.getKey(), ArgumentType.TYPE_STRING, o);
        } else if (o instanceof Integer) {
            args[i++] = new Argument(entry.getKey(), ArgumentType.TYPE_INTEGER, o);
        } else if (o instanceof Boolean) {
            args[i++] = new Argument(entry.getKey(), ArgumentType.TYPE_BOOLEAN, o);
        } else if (o instanceof Double) {
            args[i++] = new Argument(entry.getKey(), ArgumentType.TYPE_DOUBLE, o);
        } else if (o instanceof ItemStack) {
            args[i++] = new Argument(entry.getKey(), ArgumentType.TYPE_STACK, o);
        } else {
            args[i++] = new Argument(entry.getKey(), ArgumentType.TYPE_STRING, o);
        }
    }
    gui.sendServerCommand(XNetMessages.INSTANCE, cmd, args);
    gui.refresh();
}
Also used : Argument(mcjty.lib.network.Argument) ItemStack(net.minecraft.item.ItemStack) HashMap(java.util.HashMap) Map(java.util.Map)

Example 19 with Argument

use of mcjty.lib.network.Argument in project XNet by McJty.

the class ConnectorEditorPanel method update.

@Override
protected void update(String tag, Object value) {
    data.put(tag, value);
    Argument[] args = new Argument[data.size() + 3];
    int i = 0;
    args[i++] = new Argument("pos", sidedPos.getPos());
    args[i++] = new Argument("side", sidedPos.getSide().ordinal());
    args[i++] = new Argument("channel", channel);
    performUpdate(args, i, TileEntityController.CMD_UPDATECONNECTOR);
}
Also used : Argument(mcjty.lib.network.Argument)

Example 20 with Argument

use of mcjty.lib.network.Argument in project XNet by McJty.

the class GuiController method removeConnector.

private void removeConnector(SidedPos sidedPos) {
    sendServerCommand(XNetMessages.INSTANCE, TileEntityController.CMD_REMOVECONNECTOR, new Argument("channel", getSelectedChannel()), new Argument("pos", sidedPos.getPos()), new Argument("side", sidedPos.getSide().ordinal()));
    refresh();
}
Also used : Argument(mcjty.lib.network.Argument)

Aggregations

Argument (mcjty.lib.network.Argument)97 PositionalLayout (mcjty.lib.gui.layout.PositionalLayout)8 Window (mcjty.lib.gui.Window)7 Panel (mcjty.lib.gui.widgets.Panel)6 ItemStack (net.minecraft.item.ItemStack)6 PacketServerCommand (mcjty.lib.network.PacketServerCommand)4 ArrayList (java.util.ArrayList)3 GenericGuiContainer (mcjty.lib.container.GenericGuiContainer)3 HorizontalLayout (mcjty.lib.gui.layout.HorizontalLayout)3 Label (mcjty.lib.gui.widgets.Label)3 PacketRequestIntegerFromServer (mcjty.lib.network.PacketRequestIntegerFromServer)3 java.awt (java.awt)2 Rectangle (java.awt.Rectangle)2 StyleConfig (mcjty.lib.base.StyleConfig)2 GenericEnergyStorageTileEntity (mcjty.lib.entity.GenericEnergyStorageTileEntity)2 HorizontalAlignment (mcjty.lib.gui.layout.HorizontalAlignment)2 VerticalLayout (mcjty.lib.gui.layout.VerticalLayout)2 mcjty.lib.gui.widgets (mcjty.lib.gui.widgets)2 ChoiceLabel (mcjty.lib.gui.widgets.ChoiceLabel)2 TextField (mcjty.lib.gui.widgets.TextField)2