Search in sources :

Example 51 with Argument

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

the class GuiDimletWorkbench method suggestParts.

private void suggestParts() {
    int selected = itemList.getSelected();
    if (selected == -1) {
        return;
    }
    Widget widget = itemList.getChild(selected);
    Object userObject = widget.getUserObject();
    if (userObject instanceof DimletKey) {
        DimletKey key = (DimletKey) userObject;
        sendServerCommand(RFToolsDimMessages.INSTANCE, DimletWorkbenchTileEntity.CMD_SUGGESTPARTS, new Argument("type", key.getType().dimletType.getName()), new Argument("id", key.getId()));
    }
}
Also used : Argument(mcjty.lib.network.Argument) DimletKey(mcjty.rftoolsdim.dimensions.dimlets.DimletKey)

Example 52 with Argument

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

the class GuiDimensionBuilder method changeRedstoneMode.

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

Example 53 with Argument

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

the class ScreenTileEntity method focusModuleClient.

public void focusModuleClient(double hitX, double hitY, double hitZ, EnumFacing side, EnumFacing horizontalFacing) {
    ModuleRaytraceResult result = getHitModule(hitX, hitY, hitZ, side, horizontalFacing);
    if (result == null) {
        RFToolsMessages.INSTANCE.sendToServer(new PacketServerCommand(getPos(), CMD_HOVER, new Argument("x", -1), new Argument("y", -1), new Argument("module", -1)));
        return;
    }
    RFToolsMessages.INSTANCE.sendToServer(new PacketServerCommand(getPos(), CMD_HOVER, new Argument("x", result.getX()), new Argument("y", result.getY() - result.getCurrenty()), new Argument("module", result.getModuleIndex())));
}
Also used : Argument(mcjty.lib.network.Argument) PacketServerCommand(mcjty.lib.network.PacketServerCommand)

Example 54 with Argument

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

the class GuiRelay method addArgument.

private void addArgument(List<Argument> arguments, int i, String suffix) {
    char prefix = RelayTileEntity.DUNSWE.charAt(i);
    String key = prefix + suffix;
    int energy = Integer.parseInt(energyValues.get(key).getText());
    boolean input = "Input".equals(inputOutputs.get(key).getCurrentChoice());
    arguments.add(new Argument(key, energy));
    arguments.add(new Argument(prefix + "In" + suffix, input));
}
Also used : Argument(mcjty.lib.network.Argument)

Example 55 with Argument

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

the class GuiDialingDevice method interruptDial.

private void interruptDial() {
    int transmitterSelected = transmitterList.getSelected();
    TransmitterInfo transmitterInfo = getSelectedTransmitter(transmitterSelected);
    if (transmitterInfo == null) {
        return;
    }
    RFToolsMessages.INSTANCE.sendToServer(new PacketRequestIntegerFromServer(RFTools.MODID, tileEntity.getPos(), 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", (BlockPos) null), new Argument("dim", 0)));
    lastDialedTransmitter = true;
    listDirty = 0;
}
Also used : Argument(mcjty.lib.network.Argument) PacketRequestIntegerFromServer(mcjty.lib.network.PacketRequestIntegerFromServer)

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