Search in sources :

Example 1 with PacketSToggleOption

use of net.geforcemods.securitycraft.network.packets.PacketSToggleOption in project SecurityCraft by Geforce132.

the class GuiCustomizeBlock method actionPerformed.

@Override
protected void actionPerformed(GuiButton guibutton) {
    if (!(guibutton instanceof GuiItemButton)) {
        Option<?> tempOption = tileEntity.customOptions()[guibutton.id];
        tempOption.toggle();
        guibutton.packedFGColour = tempOption.toString().matches(tempOption.getDefaultValue().toString()) ? 16777120 : 14737632;
        guibutton.displayString = getOptionButtonTitle(tempOption);
        mod_SecurityCraft.network.sendToServer(new PacketSToggleOption(tileEntity.getPos().getX(), tileEntity.getPos().getY(), tileEntity.getPos().getZ(), guibutton.id));
    }
}
Also used : PacketSToggleOption(net.geforcemods.securitycraft.network.packets.PacketSToggleOption) GuiItemButton(net.geforcemods.securitycraft.gui.components.GuiItemButton)

Aggregations

GuiItemButton (net.geforcemods.securitycraft.gui.components.GuiItemButton)1 PacketSToggleOption (net.geforcemods.securitycraft.network.packets.PacketSToggleOption)1