Search in sources :

Example 6 with Argument

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

the class GuiEnvironmentalController method changeRedstoneMode.

private void changeRedstoneMode() {
    tileEntity.setRSMode(RedstoneMode.values()[redstoneMode.getCurrentChoiceIndex()]);
    sendServerCommand(RFToolsMessages.INSTANCE, EnvironmentalControllerTileEntity.CMD_RSMODE, new Argument("rs", RedstoneMode.values()[redstoneMode.getCurrentChoiceIndex()].getDescription()));
}
Also used : Argument(mcjty.lib.network.Argument)

Example 7 with Argument

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

the class GuiCounter method setCounter.

private void setCounter() {
    String d = counterField.getText();
    int counter;
    try {
        counter = Integer.parseInt(d);
    } catch (NumberFormatException e) {
        counter = 1;
    }
    tileEntity.setCounter(counter);
    sendServerCommand(RFToolsMessages.INSTANCE, CounterTileEntity.CMD_SETCOUNTER, new Argument("counter", counter));
}
Also used : Argument(mcjty.lib.network.Argument)

Example 8 with Argument

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

the class GuiCounter method setCurrent.

private void setCurrent() {
    String d = currentField.getText();
    int current;
    try {
        current = Integer.parseInt(d);
    } catch (NumberFormatException e) {
        current = 0;
    }
    tileEntity.setCounter(current);
    sendServerCommand(RFToolsMessages.INSTANCE, CounterTileEntity.CMD_SETCURRENT, new Argument("current", current));
}
Also used : Argument(mcjty.lib.network.Argument)

Example 9 with Argument

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

the class GuiInvChecker method setAmount.

private void setAmount() {
    String d = amountField.getText();
    int amount;
    try {
        amount = Integer.parseInt(d);
    } catch (NumberFormatException e) {
        amount = 1;
    }
    tileEntity.setAmount(amount);
    sendServerCommand(RFToolsMessages.INSTANCE, InvCheckerTileEntity.CMD_SETAMOUNT, new Argument("amount", amount));
}
Also used : Argument(mcjty.lib.network.Argument)

Example 10 with Argument

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

the class GuiInvChecker method setMetaUsage.

private void setMetaUsage() {
    boolean b = META_MATCH.equals(metaLabel.getCurrentChoice());
    tileEntity.setUseMeta(b);
    sendServerCommand(RFToolsMessages.INSTANCE, InvCheckerTileEntity.CMD_SETMETA, new Argument("b", b));
}
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