use of mcjty.rftools.shapes.PacketUpdateNBTShapeCard 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.rftools.shapes.PacketUpdateNBTShapeCard 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()))));
}
}
Aggregations