Search in sources :

Example 1 with Option

use of net.geforcemods.securitycraft.api.Option in project SecurityCraft by Geforce132.

the class TileEntityLaserBlock method onLinkedBlockAction.

@Override
protected void onLinkedBlockAction(EnumLinkedAction action, Object[] parameters, ArrayList<CustomizableSCTE> excludedTEs) {
    if (action == EnumLinkedAction.OPTION_CHANGED) {
        Option<?> option = (Option<?>) parameters[0];
        enabledOption.copy(option);
        toggleLaser((OptionBoolean) option);
        excludedTEs.add(this);
        createLinkedBlockAction(EnumLinkedAction.OPTION_CHANGED, new Option[] { option }, excludedTEs);
    } else if (action == EnumLinkedAction.MODULE_INSERTED) {
        ItemStack module = (ItemStack) parameters[0];
        insertModule(module);
        excludedTEs.add(this);
        createLinkedBlockAction(EnumLinkedAction.MODULE_INSERTED, parameters, excludedTEs);
    } else if (action == EnumLinkedAction.MODULE_REMOVED) {
        EnumCustomModules module = (EnumCustomModules) parameters[1];
        removeModule(module);
        excludedTEs.add(this);
        createLinkedBlockAction(EnumLinkedAction.MODULE_REMOVED, parameters, excludedTEs);
    }
}
Also used : Option(net.geforcemods.securitycraft.api.Option) ItemStack(net.minecraft.item.ItemStack) EnumCustomModules(net.geforcemods.securitycraft.misc.EnumCustomModules)

Aggregations

Option (net.geforcemods.securitycraft.api.Option)1 EnumCustomModules (net.geforcemods.securitycraft.misc.EnumCustomModules)1 ItemStack (net.minecraft.item.ItemStack)1