use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiShield method changeRedstoneMode.
private void changeRedstoneMode() {
tileEntity.setRSMode(RedstoneMode.values()[redstoneMode.getCurrentChoiceIndex()]);
sendServerCommand(RFToolsMessages.INSTANCE, ShieldTEBase.CMD_RSMODE, new Argument("rs", RedstoneMode.values()[redstoneMode.getCurrentChoiceIndex()].getDescription()));
}
use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiShield method addNewFilter.
private void addNewFilter() {
String actionName = actionOptions.getCurrentChoice();
int action;
if (ACTION_PASS.equals(actionName)) {
action = ShieldFilter.ACTION_PASS;
} else if (ACTION_SOLID.equals(actionName)) {
action = ShieldFilter.ACTION_SOLID;
} else if (ACTION_SOLIDDAMAGE.equals(actionName)) {
action = ShieldFilter.ACTION_DAMAGE + ShieldFilter.ACTION_SOLID;
} else {
action = ShieldFilter.ACTION_DAMAGE;
}
String filterName = typeOptions.getCurrentChoice();
String type;
if ("All".equals(filterName)) {
type = DefaultFilter.DEFAULT;
} else if ("Passive".equals(filterName)) {
type = AnimalFilter.ANIMAL;
} else if ("Hostile".equals(filterName)) {
type = HostileFilter.HOSTILE;
} else if ("Item".equals(filterName)) {
type = ItemFilter.ITEM;
} else {
type = PlayerFilter.PLAYER;
}
String playerName = player.getText();
int selected = filterList.getSelected();
sendServerCommand(RFToolsMessages.INSTANCE, ShieldTEBase.CMD_ADDFILTER, new Argument("action", action), new Argument("type", type), new Argument("player", playerName), new Argument("selected", selected));
listDirty = 0;
}
use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiShield method changeVisibilityMode.
private void changeVisibilityMode() {
ShieldRenderingMode newMode = ShieldRenderingMode.getMode(visibilityOptions.getCurrentChoice());
tileEntity.setShieldRenderingMode(newMode);
sendServerCommand(RFToolsMessages.INSTANCE, ShieldTEBase.CMD_SHIELDVISMODE, new Argument("mode", newMode.getDescription()));
}
use of mcjty.lib.network.Argument in project RFTools by McJty.
the class GuiSecurityManager method updateSettings.
private void updateSettings() {
// Make sure we don't request new info from server too fast
listDirty = 20;
boolean whitelist = blacklistMode.getCurrentChoiceIndex() == 0;
if (channelFromServer != null) {
channelFromServer.setWhitelist(whitelist);
}
sendServerCommand(RFToolsMessages.INSTANCE, SecurityManagerTileEntity.CMD_SETMODE, new Argument("whitelist", whitelist));
}
use of mcjty.lib.network.Argument in project XNet by McJty.
the class GuiConnector method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
nameField = new TextField(mc, this).setTooltips("Set the name of this connector").addTextEvent((parent, newText) -> updateName());
nameField.setText(tileEntity.getConnectorName());
Panel namePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Name:")).addChild(nameField);
toplevel.addChild(namePanel);
Panel togglePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Directions:"));
for (EnumFacing facing : EnumFacing.VALUES) {
toggleButtons[facing.ordinal()] = new ToggleButton(mc, this).setText(facing.getName().substring(0, 1).toUpperCase()).addButtonEvent(parent -> {
sendServerCommand(XNetMessages.INSTANCE, ConnectorTileEntity.CMD_ENABLE, new Argument("facing", facing.ordinal()), new Argument("enabled", toggleButtons[facing.ordinal()].isPressed()));
});
toggleButtons[facing.ordinal()].setPressed(tileEntity.isEnabled(facing));
togglePanel.addChild(toggleButtons[facing.ordinal()]);
}
toplevel.addChild(togglePanel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, WIDTH, HEIGHT));
window = new Window(this, toplevel);
}
Aggregations