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;
}
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;
}
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)));
}
}
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();
}
}
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));
}
Aggregations