Search in sources :

Example 56 with Argument

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

the class GuiDialingDevice method changeFavorite.

private void changeFavorite() {
    int receiverSelected = receiverList.getSelected();
    TeleportDestinationClientInfo destination = getSelectedReceiver(receiverSelected);
    if (destination == null) {
        return;
    }
    boolean favorite = destination.isFavorite();
    destination.setFavorite(!favorite);
    sendServerCommand(RFToolsMessages.INSTANCE, DialingDeviceTileEntity.CMD_FAVORITE, new Argument("player", mc.player.getName()), new Argument("receiver", destination.getCoordinate()), new Argument("dimension", destination.getDimension()), new Argument("favorite", !favorite));
    listDirty = 0;
}
Also used : Argument(mcjty.lib.network.Argument)

Example 57 with Argument

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

the class GuiDialingDevice method dial.

private void dial(boolean once) {
    int transmitterSelected = transmitterList.getSelected();
    TransmitterInfo transmitterInfo = getSelectedTransmitter(transmitterSelected);
    if (transmitterInfo == null) {
        return;
    }
    int receiverSelected = receiverList.getSelected();
    TeleportDestination destination = getSelectedReceiver(receiverSelected);
    if (destination == null) {
        return;
    }
    RFToolsMessages.INSTANCE.sendToServer(new PacketRequestIntegerFromServer(RFTools.MODID, tileEntity.getPos(), once ? DialingDeviceTileEntity.CMD_DIALONCE : DialingDeviceTileEntity.CMD_DIAL, DialingDeviceTileEntity.CLIENTCMD_DIAL, new Argument("player", mc.player.getName()), new Argument("trans", transmitterInfo.getCoordinate()), new Argument("transDim", mc.world.provider.getDimension()), new Argument("c", destination.getCoordinate()), new Argument("dim", destination.getDimension())));
    lastDialedTransmitter = true;
    listDirty = 0;
}
Also used : Argument(mcjty.lib.network.Argument) PacketRequestIntegerFromServer(mcjty.lib.network.PacketRequestIntegerFromServer)

Example 58 with Argument

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

the class GuiModularStorage method updateSettings.

private void updateSettings() {
    if (tileEntity != null) {
        tileEntity.setSortMode(sortMode.getCurrentChoice());
        tileEntity.setViewMode(viewMode.getCurrentChoice());
        tileEntity.setFilter(filter.getText());
        tileEntity.setGroupMode(groupMode.getCurrentChoiceIndex() == 1);
        sendServerCommand(RFToolsMessages.INSTANCE, ModularStorageTileEntity.CMD_SETTINGS, new Argument("sortMode", sortMode.getCurrentChoice()), new Argument("viewMode", viewMode.getCurrentChoice()), new Argument("filter", filter.getText()), new Argument("groupMode", groupMode.getCurrentChoiceIndex() == 1));
    } else {
        RFToolsMessages.INSTANCE.sendToServer(new PacketUpdateNBTItemStorage(new Argument("sortMode", sortMode.getCurrentChoice()), new Argument("viewMode", viewMode.getCurrentChoice()), new Argument("filter", filter.getText()), new Argument("groupMode", groupMode.getCurrentChoiceIndex() == 1)));
    }
}
Also used : Argument(mcjty.lib.network.Argument)

Example 59 with Argument

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

the class MatterBeamerTileEntity method setDestination.

public void setDestination(BlockPos destination) {
    this.destination = destination;
    disableBlockGlow();
    markDirty();
    if (getWorld().isRemote) {
        // We're on the client. Send change to server.
        RFToolsMessages.INSTANCE.sendToServer(new PacketServerCommand(getPos(), MatterBeamerTileEntity.CMD_SETDESTINATION, new Argument("dest", destination)));
    } else {
        markDirtyClient();
    }
}
Also used : Argument(mcjty.lib.network.Argument) PacketServerCommand(mcjty.lib.network.PacketServerCommand)

Example 60 with Argument

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

the class GuiLevelEmitter 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, LevelEmitterTileEntity.CMD_SETAMOUNT, new Argument("amount", amount));
}
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