use of mcjty.lib.network.Argument in project RFToolsDimensions by McJty.
the class GuiDimletWorkbench method cheatDimlet.
private void cheatDimlet() {
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_CHEATDIMLET, new Argument("type", key.getType().dimletType.getName()), new Argument("id", key.getId()));
}
}
use of mcjty.lib.network.Argument in project RFToolsDimensions by McJty.
the class GuiDimletWorkbench method setExtractMode.
private void setExtractMode() {
tileEntity.setExtractMode(extractButton.isPressed());
sendServerCommand(RFToolsDimMessages.INSTANCE, DimletWorkbenchTileEntity.CMD_EXTRACTMODE, new Argument("mode", extractButton.isPressed()));
}
use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiEnvironmentalController method initAreaPanel.
private Panel initAreaPanel() {
int r = tileEntity.getRadius();
if (r < 5) {
r = 5;
} else if (r > 100) {
r = 100;
}
int miny = tileEntity.getMiny();
int maxy = tileEntity.getMaxy();
Panel areaPanel = new Panel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(28, 6, ENV_WIDTH - 33, 37)).setLayout(new VerticalLayout().setVerticalMargin(2).setSpacing(0)).setFilledRectThickness(-2).setFilledBackground(StyleConfig.colorListBackground);
Panel radiusPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredHeight(16);
ScrollableLabel radius = new ScrollableLabel(mc, this).setRealMinimum(5).setRealMaximum(100).setRealValue(r).setDesiredWidth(24).addValueEvent((parent, newValue) -> sendServerCommand(RFToolsMessages.INSTANCE, EnvironmentalControllerTileEntity.CMD_SETRADIUS, new Argument("radius", newValue)));
Slider slider = new Slider(mc, this).setHorizontal().setScrollable(radius).setMinimumKnobSize(12);
radiusPanel.addChild(new Label(mc, this).setText("Radius:")).addChild(slider).addChild(radius);
Panel minPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredHeight(17);
minyTextField = new TextField(mc, this).setText(Integer.toString(miny)).addTextEvent((parent, newText) -> sendBounds(true));
maxyTextField = new TextField(mc, this).setText(Integer.toString(maxy)).addTextEvent((parent, newText) -> sendBounds(false));
minPanel.addChild(new Label(mc, this).setText("Height:")).addChild(minyTextField).addChild(maxyTextField);
areaPanel.addChild(radiusPanel).addChild(minPanel);
return areaPanel;
}
use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiEnvironmentalController method sendBounds.
private void sendBounds(boolean minchanged) {
int miny;
int maxy;
try {
miny = Integer.parseInt(minyTextField.getText());
} catch (NumberFormatException e) {
miny = 0;
}
try {
maxy = Integer.parseInt(maxyTextField.getText());
} catch (NumberFormatException e) {
maxy = 0;
}
if (minchanged) {
if (miny > maxy) {
maxy = miny;
maxyTextField.setText(Integer.toString(maxy));
}
} else {
if (miny > maxy) {
miny = maxy;
minyTextField.setText(Integer.toString(miny));
}
}
sendServerCommand(RFToolsMessages.INSTANCE, EnvironmentalControllerTileEntity.CMD_SETBOUNDS, new Argument("miny", miny), new Argument("maxy", maxy));
}
use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiEnvironmentalController method changeMode.
private void changeMode(String newAccess) {
EnvironmentalControllerTileEntity.EnvironmentalMode newmode;
if (MODE_ALL.equals(newAccess)) {
newmode = EnvironmentalControllerTileEntity.EnvironmentalMode.MODE_ALL;
} else if (MODE_BLACKLIST.equals(newAccess)) {
newmode = EnvironmentalControllerTileEntity.EnvironmentalMode.MODE_BLACKLIST;
} else if (MODE_WHITELIST.equals(newAccess)) {
newmode = EnvironmentalControllerTileEntity.EnvironmentalMode.MODE_WHITELIST;
} else if (MODE_MOBS.equals(newAccess)) {
newmode = EnvironmentalControllerTileEntity.EnvironmentalMode.MODE_MOBS;
} else if (MODE_PASSIVE.equals(newAccess)) {
newmode = EnvironmentalControllerTileEntity.EnvironmentalMode.MODE_PASSIVE;
} else {
newmode = EnvironmentalControllerTileEntity.EnvironmentalMode.MODE_HOSTILE;
}
sendServerCommand(RFToolsMessages.INSTANCE, EnvironmentalControllerTileEntity.CMD_SETMODE, new Argument("mode", newmode.ordinal()));
}
Aggregations