use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiShapeCard method updateVoidSettings.
private void updateVoidSettings() {
if (fromTE) {
ItemStack stack = getStackToEdit();
if (!stack.isEmpty()) {
NBTTagCompound tag = stack.getTagCompound();
if (tag == null) {
tag = new NBTTagCompound();
}
tag.setBoolean("voidstone", stone.isPressed());
tag.setBoolean("voidcobble", cobble.isPressed());
tag.setBoolean("voiddirt", dirt.isPressed());
tag.setBoolean("voidgravel", gravel.isPressed());
tag.setBoolean("voidsand", sand.isPressed());
tag.setBoolean("voidnetherrack", netherrack.isPressed());
tag.setBoolean("voidendstone", endstone.isPressed());
tag.setBoolean("oredict", oredict.isPressed());
RFToolsMessages.INSTANCE.sendToServer(new PacketUpdateNBTItemInventoryShape(fromTEPos, fromTEStackSlot, tag));
}
} else {
RFToolsMessages.INSTANCE.sendToServer(new PacketUpdateNBTShapeCard(new Argument("voidstone", stone.isPressed()), new Argument("voidcobble", cobble.isPressed()), new Argument("voiddirt", dirt.isPressed()), new Argument("voidgravel", gravel.isPressed()), new Argument("voidsand", sand.isPressed()), new Argument("voidnetherrack", netherrack.isPressed()), new Argument("voidendstone", endstone.isPressed()), new Argument("oredict", oredict.isPressed())));
}
}
use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiShapeCard method updateSettings.
private void updateSettings() {
int dx = parseInt(dimX.getText());
int dy = parseInt(dimY.getText());
int dz = parseInt(dimZ.getText());
int max = Math.max(ScannerConfiguration.maxScannerDimension, BuilderConfiguration.maxBuilderDimension);
if (dx < 0) {
dx = 0;
} else if (dx > max) {
dx = max;
}
dimX.setText(Integer.toString(dx));
if (dz < 0) {
dz = 0;
} else if (dz > max) {
dz = max;
}
dimZ.setText(Integer.toString(dz));
if (dy < 0) {
dy = 0;
} else if (dy > 256) {
dy = 256;
}
dimY.setText(Integer.toString(dy));
if (isTorus()) {
dimZ.setText(dimX.getText());
}
if (fromTE) {
ItemStack stack = getStackToEdit();
if (!stack.isEmpty()) {
NBTTagCompound tag = stack.getTagCompound();
if (tag == null) {
tag = new NBTTagCompound();
}
ShapeCardItem.setShape(stack, getCurrentShape(), isSolid());
ShapeCardItem.setDimension(stack, dx, dy, dz);
ShapeCardItem.setOffset(stack, parseInt(offsetX.getText()), parseInt(offsetY.getText()), parseInt(offsetZ.getText()));
RFToolsMessages.INSTANCE.sendToServer(new PacketUpdateNBTItemInventoryShape(fromTEPos, fromTEStackSlot, tag));
}
} else {
RFToolsMessages.INSTANCE.sendToServer(new PacketUpdateNBTShapeCard(new Argument("shapenew", getCurrentShape().getDescription()), new Argument("solid", isSolid()), new Argument("dimX", dx), new Argument("dimY", dy), new Argument("dimZ", dz), new Argument("offsetX", parseInt(offsetX.getText())), new Argument("offsetY", parseInt(offsetY.getText())), new Argument("offsetZ", parseInt(offsetZ.getText()))));
}
}
use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiBuilder method updateMode.
private void updateMode() {
String currentChoice = modeChoice.getCurrentChoice();
int mode = 0;
for (int i = 0; i < MODES.length; i++) {
if (currentChoice.equals(MODES[i])) {
mode = i;
break;
}
}
sendServerCommand(RFToolsMessages.INSTANCE, CMD_SETMODE, new Argument("mode", mode));
}
use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiBooster method changeRedstoneMode.
private void changeRedstoneMode() {
tileEntity.setRSMode(RedstoneMode.values()[redstoneMode.getCurrentChoiceIndex()]);
sendServerCommand(RFToolsMessages.INSTANCE, BoosterTileEntity.CMD_RSMODE, new Argument("rs", RedstoneMode.values()[redstoneMode.getCurrentChoiceIndex()].getDescription()));
}
use of mcjty.lib.network.Argument 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;
}
Aggregations