Search in sources :

Example 1 with PacketRequestIntegerFromServer

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

the class GuiDialingDevice method checkStatus.

private void checkStatus() {
    int receiverSelected = receiverList.getSelected();
    TeleportDestination destination = getSelectedReceiver(receiverSelected);
    if (destination == null) {
        return;
    }
    BlockPos c = destination.getCoordinate();
    RFToolsMessages.INSTANCE.sendToServer(new PacketRequestIntegerFromServer(RFTools.MODID, tileEntity.getPos(), DialingDeviceTileEntity.CMD_CHECKSTATUS, DialingDeviceTileEntity.CLIENTCMD_STATUS, new Argument("c", c), new Argument("dim", destination.getDimension())));
    lastCheckedReceiver = true;
    listDirty = 0;
}
Also used : Argument(mcjty.lib.network.Argument) PacketRequestIntegerFromServer(mcjty.lib.network.PacketRequestIntegerFromServer) BlockPos(net.minecraft.util.math.BlockPos)

Example 2 with PacketRequestIntegerFromServer

use of mcjty.lib.network.PacketRequestIntegerFromServer 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)

Example 3 with PacketRequestIntegerFromServer

use of mcjty.lib.network.PacketRequestIntegerFromServer 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 4 with PacketRequestIntegerFromServer

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

the class GuiEndergenic method checkStats.

private void checkStats() {
    timer--;
    if (timer <= 0) {
        timer = 20;
        RFToolsMessages.INSTANCE.sendToServer(new PacketRequestIntegerFromServer(RFTools.MODID, tileEntity.getPos(), EndergenicTileEntity.CMD_GETSTAT_RF, EndergenicTileEntity.CLIENTCMD_GETSTAT_RF));
        RFToolsMessages.INSTANCE.sendToServer(new PacketRequestIntegerFromServer(RFTools.MODID, tileEntity.getPos(), EndergenicTileEntity.CMD_GETSTAT_LOST, EndergenicTileEntity.CLIENTCMD_GETSTAT_LOST));
        RFToolsMessages.INSTANCE.sendToServer(new PacketRequestIntegerFromServer(RFTools.MODID, tileEntity.getPos(), EndergenicTileEntity.CMD_GETSTAT_LAUNCHED, EndergenicTileEntity.CLIENTCMD_GETSTAT_LAUNCHED));
        RFToolsMessages.INSTANCE.sendToServer(new PacketRequestIntegerFromServer(RFTools.MODID, tileEntity.getPos(), EndergenicTileEntity.CMD_GETSTAT_OPPORTUNITIES, EndergenicTileEntity.CLIENTCMD_GETSTAT_OPPORTUNITIES));
    }
}
Also used : PacketRequestIntegerFromServer(mcjty.lib.network.PacketRequestIntegerFromServer)

Aggregations

PacketRequestIntegerFromServer (mcjty.lib.network.PacketRequestIntegerFromServer)4 Argument (mcjty.lib.network.Argument)3 BlockPos (net.minecraft.util.math.BlockPos)1