diff --git a/api/buildcraft/api/robots/AIRobot.java b/api/buildcraft/api/robots/AIRobot.java index 79592fea..b59905b5 100755 --- a/api/buildcraft/api/robots/AIRobot.java +++ b/api/buildcraft/api/robots/AIRobot.java @@ -89,4 +89,12 @@ public class AIRobot { delegateAI.abort(); } } + + public final AIRobot getActiveAI() { + if (delegateAI != null) { + return delegateAI.getActiveAI(); + } else { + return this; + } + } } diff --git a/api/buildcraft/api/robots/EntityRobotBase.java b/api/buildcraft/api/robots/EntityRobotBase.java index b6a04272..9450f038 100755 --- a/api/buildcraft/api/robots/EntityRobotBase.java +++ b/api/buildcraft/api/robots/EntityRobotBase.java @@ -52,8 +52,6 @@ public abstract class EntityRobotBase extends EntityLiving implements IInventory public abstract boolean linkToStation(IDockingStation station); - public abstract void workInArea(IBox box); - public abstract IBox getAreaToWork(); } diff --git a/buildcraft_resources/assets/buildcraft/lang/en_US.lang b/buildcraft_resources/assets/buildcraft/lang/en_US.lang index e9ea3ee4..39901e47 100755 --- a/buildcraft_resources/assets/buildcraft/lang/en_US.lang +++ b/buildcraft_resources/assets/buildcraft/lang/en_US.lang @@ -58,6 +58,7 @@ gate.action.pipe.close=Close Pipe gate.action.station.provide_items=Provide Items gate.action.station.request_items=Request Items gate.action.robot.work_in_area=Work in Area +gate.action.robot.wakeup=Wake Up gate.expansion.fader=Redstone Fader gate.expansion.pulsar=Autarchic Pulsar @@ -101,6 +102,7 @@ gate.trigger.pipe.tooMuchEnergy=Power Overloaded gate.trigger.pipe.wire.active=%s Pipe Signal On gate.trigger.pipe.wire.inactive=%s Pipe Signal Off gate.trigger.timer=%s Sec Timer +gate.trigger.robot.sleep=Sleep gui.building.resources=Building Resources gui.building.fluids=Fluid Tanks diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java index 23eee1d9..b23567c4 100644 --- a/common/buildcraft/BuildCraftCore.java +++ b/common/buildcraft/BuildCraftCore.java @@ -63,6 +63,8 @@ import buildcraft.api.core.BlockIndex; import buildcraft.api.core.BuildCraftAPI; import buildcraft.api.core.IIconProvider; import buildcraft.api.core.JavaTools; +import buildcraft.api.gates.IAction; +import buildcraft.api.gates.ITrigger; import buildcraft.api.gates.StatementManager; import buildcraft.api.recipes.BuildcraftRecipeRegistry; import buildcraft.api.robots.DockingStationRegistry; @@ -94,7 +96,6 @@ import buildcraft.core.robots.EntityRobot; import buildcraft.core.triggers.ActionMachineControl; import buildcraft.core.triggers.ActionMachineControl.Mode; import buildcraft.core.triggers.ActionRedstoneOutput; -import buildcraft.core.triggers.BCAction; import buildcraft.core.triggers.BCTrigger; import buildcraft.core.triggers.DefaultActionProvider; import buildcraft.core.triggers.DefaultTriggerProvider; @@ -153,28 +154,28 @@ public class BuildCraftCore extends BuildCraftMod { public static int blockByEntityModel; public static int legacyPipeModel; public static int markerModel; - public static BCTrigger triggerMachineActive = new TriggerMachine(true); - public static BCTrigger triggerMachineInactive = new TriggerMachine(false); - public static BCTrigger triggerEmptyInventory = new TriggerInventory(TriggerInventory.State.Empty); - public static BCTrigger triggerContainsInventory = new TriggerInventory(TriggerInventory.State.Contains); - public static BCTrigger triggerSpaceInventory = new TriggerInventory(TriggerInventory.State.Space); - public static BCTrigger triggerFullInventory = new TriggerInventory(TriggerInventory.State.Full); - public static BCTrigger triggerEmptyFluid = new TriggerFluidContainer(TriggerFluidContainer.State.Empty); - public static BCTrigger triggerContainsFluid = new TriggerFluidContainer(TriggerFluidContainer.State.Contains); - public static BCTrigger triggerSpaceFluid = new TriggerFluidContainer(TriggerFluidContainer.State.Space); - public static BCTrigger triggerFullFluid = new TriggerFluidContainer(TriggerFluidContainer.State.Full); - public static BCTrigger triggerRedstoneActive = new TriggerRedstoneInput(true); - public static BCTrigger triggerRedstoneInactive = new TriggerRedstoneInput(false); - public static BCTrigger triggerInventoryBelow25 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_25); - public static BCTrigger triggerInventoryBelow50 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_50); - public static BCTrigger triggerInventoryBelow75 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_75); - public static BCTrigger triggerFluidContainerBelow25 = new TriggerFluidContainerLevel(TriggerFluidContainerLevel.TriggerType.BELOW_25); - public static BCTrigger triggerFluidContainerBelow50 = new TriggerFluidContainerLevel(TriggerFluidContainerLevel.TriggerType.BELOW_50); - public static BCTrigger triggerFluidContainerBelow75 = new TriggerFluidContainerLevel(TriggerFluidContainerLevel.TriggerType.BELOW_75); - public static BCAction actionRedstone = new ActionRedstoneOutput(); - public static BCAction actionOn = new ActionMachineControl(Mode.On); - public static BCAction actionOff = new ActionMachineControl(Mode.Off); - public static BCAction actionLoop = new ActionMachineControl(Mode.Loop); + public static ITrigger triggerMachineActive = new TriggerMachine(true); + public static ITrigger triggerMachineInactive = new TriggerMachine(false); + public static ITrigger triggerEmptyInventory = new TriggerInventory(TriggerInventory.State.Empty); + public static ITrigger triggerContainsInventory = new TriggerInventory(TriggerInventory.State.Contains); + public static ITrigger triggerSpaceInventory = new TriggerInventory(TriggerInventory.State.Space); + public static ITrigger triggerFullInventory = new TriggerInventory(TriggerInventory.State.Full); + public static ITrigger triggerEmptyFluid = new TriggerFluidContainer(TriggerFluidContainer.State.Empty); + public static ITrigger triggerContainsFluid = new TriggerFluidContainer(TriggerFluidContainer.State.Contains); + public static ITrigger triggerSpaceFluid = new TriggerFluidContainer(TriggerFluidContainer.State.Space); + public static ITrigger triggerFullFluid = new TriggerFluidContainer(TriggerFluidContainer.State.Full); + public static ITrigger triggerRedstoneActive = new TriggerRedstoneInput(true); + public static ITrigger triggerRedstoneInactive = new TriggerRedstoneInput(false); + public static ITrigger triggerInventoryBelow25 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_25); + public static ITrigger triggerInventoryBelow50 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_50); + public static ITrigger triggerInventoryBelow75 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_75); + public static ITrigger triggerFluidContainerBelow25 = new TriggerFluidContainerLevel(TriggerFluidContainerLevel.TriggerType.BELOW_25); + public static ITrigger triggerFluidContainerBelow50 = new TriggerFluidContainerLevel(TriggerFluidContainerLevel.TriggerType.BELOW_50); + public static ITrigger triggerFluidContainerBelow75 = new TriggerFluidContainerLevel(TriggerFluidContainerLevel.TriggerType.BELOW_75); + public static IAction actionRedstone = new ActionRedstoneOutput(); + public static IAction actionOn = new ActionMachineControl(Mode.On); + public static IAction actionOff = new ActionMachineControl(Mode.Off); + public static IAction actionLoop = new ActionMachineControl(Mode.Loop); public static boolean loadDefaultRecipes = true; public static boolean consumeWaterSources = false; //public static BptItem[] itemBptProps = new BptItem[Item.itemsList.length]; diff --git a/common/buildcraft/BuildCraftSilicon.java b/common/buildcraft/BuildCraftSilicon.java index f4001bc3..66056775 100644 --- a/common/buildcraft/BuildCraftSilicon.java +++ b/common/buildcraft/BuildCraftSilicon.java @@ -27,6 +27,8 @@ import net.minecraftforge.oredict.OreDictionary; import buildcraft.api.blueprints.SchematicRegistry; import buildcraft.api.boards.RedstoneBoardRegistry; import buildcraft.api.gates.ActionParameterItemStack; +import buildcraft.api.gates.IAction; +import buildcraft.api.gates.ITrigger; import buildcraft.api.gates.StatementManager; import buildcraft.api.gates.TriggerParameterItemStack; import buildcraft.api.recipes.BuildcraftRecipeRegistry; @@ -48,7 +50,6 @@ import buildcraft.core.robots.boards.BoardRobotLumberjackNBT; import buildcraft.core.robots.boards.BoardRobotMinerNBT; import buildcraft.core.robots.boards.BoardRobotPickerNBT; import buildcraft.core.robots.boards.BoardRobotPlanterNBT; -import buildcraft.core.triggers.BCAction; import buildcraft.silicon.BlockLaser; import buildcraft.silicon.BlockLaserTable; import buildcraft.silicon.GuiHandler; @@ -67,11 +68,14 @@ import buildcraft.silicon.network.PacketHandlerSilicon; import buildcraft.silicon.recipes.AdvancedFacadeRecipe; import buildcraft.silicon.recipes.GateExpansionRecipe; import buildcraft.silicon.recipes.GateLogicSwapRecipe; -import buildcraft.silicon.statements.ActionRobotGoToStation; +import buildcraft.silicon.statements.ActionRobotGotoStation; +import buildcraft.silicon.statements.ActionRobotWakeUp; import buildcraft.silicon.statements.ActionRobotWorkInArea; import buildcraft.silicon.statements.ActionStationProvideItems; import buildcraft.silicon.statements.ActionStationRequestItems; import buildcraft.silicon.statements.RobotsActionProvider; +import buildcraft.silicon.statements.RobotsTriggerProvider; +import buildcraft.silicon.statements.TriggerRobotSleep; import buildcraft.transport.gates.GateDefinition.GateLogic; import buildcraft.transport.gates.GateDefinition.GateMaterial; import buildcraft.transport.gates.GateExpansionPulsar; @@ -94,10 +98,13 @@ public class BuildCraftSilicon extends BuildCraftMod { public static Item redstoneCrystal; public static Item robotItem; - public static BCAction actionRobotGotoStation = new ActionRobotGoToStation(); - public static BCAction actionRobotWorkInArea = new ActionRobotWorkInArea(); - public static BCAction actionStationRequestItems = new ActionStationRequestItems(); - public static BCAction actionStationProvideItems = new ActionStationProvideItems(); + public static IAction actionRobotGotoStation = new ActionRobotGotoStation(); + public static IAction actionRobotWakeUp = new ActionRobotWakeUp(); + public static IAction actionRobotWorkInArea = new ActionRobotWorkInArea(); + public static IAction actionStationRequestItems = new ActionStationRequestItems(); + public static IAction actionStationProvideItems = new ActionStationProvideItems(); + + public static ITrigger triggerRobotSleep = new TriggerRobotSleep(); @Mod.EventHandler public void preInit(FMLPreInitializationEvent evt) { @@ -140,6 +147,7 @@ public class BuildCraftSilicon extends BuildCraftMod { RedstoneBoardRegistry.instance.registerBoardClass(BoardRobotBomberNBT.instance, 1); StatementManager.registerActionProvider(new RobotsActionProvider()); + StatementManager.registerTriggerProvider(new RobotsTriggerProvider()); } @Mod.EventHandler diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index 98745426..5423cb17 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -36,6 +36,8 @@ import buildcraft.api.blueprints.SchematicRegistry; import buildcraft.api.core.IIconProvider; import buildcraft.api.core.JavaTools; import buildcraft.api.gates.GateExpansions; +import buildcraft.api.gates.IAction; +import buildcraft.api.gates.ITrigger; import buildcraft.api.gates.StatementManager; import buildcraft.api.recipes.BuildcraftRecipeRegistry; import buildcraft.api.transport.IExtractionHandler; @@ -49,8 +51,6 @@ import buildcraft.core.Version; import buildcraft.core.network.BuildCraftChannelHandler; import buildcraft.core.proxy.CoreProxy; import buildcraft.core.triggers.ActionPipeClose; -import buildcraft.core.triggers.BCAction; -import buildcraft.core.triggers.BCTrigger; import buildcraft.core.utils.EnumColor; import buildcraft.transport.BlockFilteredBuffer; import buildcraft.transport.BlockGenericPipe; @@ -170,23 +170,23 @@ public class BuildCraftTransport extends BuildCraftMod { public static int groupItemsTrigger; public static String[] facadeBlacklist; - public static BCTrigger[] triggerPipe = new BCTrigger[PipeContents.values().length]; - public static BCTrigger[] triggerPipeWireActive = new BCTrigger[PipeWire.values().length]; - public static BCTrigger[] triggerPipeWireInactive = new BCTrigger[PipeWire.values().length]; - public static BCTrigger[] triggerTimer = new BCTrigger[TriggerClockTimer.Time.VALUES.length]; - public static BCTrigger[] triggerRedstoneLevel = new BCTrigger[15]; - public static BCAction[] actionPipeWire = new ActionSignalOutput[PipeWire.values().length]; - public static BCAction actionPipeClose = new ActionPipeClose(); - public static BCAction actionEnergyPulser = new ActionEnergyPulsar(); - public static BCAction actionSingleEnergyPulse = new ActionSingleEnergyPulse(); - public static BCAction[] actionPipeColor = new BCAction[16]; - public static BCAction[] actionPipeDirection = new BCAction[16]; - public static BCAction[] actionPowerLimiter = new BCAction[7]; - public static BCAction[] actionRedstoneLevel = new BCAction[15]; - public static BCAction actionExtractionPresetRed = new ActionExtractionPreset(EnumColor.RED); - public static BCAction actionExtractionPresetBlue = new ActionExtractionPreset(EnumColor.BLUE); - public static BCAction actionExtractionPresetGreen = new ActionExtractionPreset(EnumColor.GREEN); - public static BCAction actionExtractionPresetYellow = new ActionExtractionPreset(EnumColor.YELLOW); + public static ITrigger[] triggerPipe = new ITrigger[PipeContents.values().length]; + public static ITrigger[] triggerPipeWireActive = new ITrigger[PipeWire.values().length]; + public static ITrigger[] triggerPipeWireInactive = new ITrigger[PipeWire.values().length]; + public static ITrigger[] triggerTimer = new ITrigger[TriggerClockTimer.Time.VALUES.length]; + public static ITrigger[] triggerRedstoneLevel = new ITrigger[15]; + public static IAction[] actionPipeWire = new ActionSignalOutput[PipeWire.values().length]; + public static IAction actionPipeClose = new ActionPipeClose(); + public static IAction actionEnergyPulser = new ActionEnergyPulsar(); + public static IAction actionSingleEnergyPulse = new ActionSingleEnergyPulse(); + public static IAction[] actionPipeColor = new IAction[16]; + public static IAction[] actionPipeDirection = new IAction[16]; + public static IAction[] actionPowerLimiter = new IAction[7]; + public static IAction[] actionRedstoneLevel = new IAction[15]; + public static IAction actionExtractionPresetRed = new ActionExtractionPreset(EnumColor.RED); + public static IAction actionExtractionPresetBlue = new ActionExtractionPreset(EnumColor.BLUE); + public static IAction actionExtractionPresetGreen = new ActionExtractionPreset(EnumColor.GREEN); + public static IAction actionExtractionPresetYellow = new ActionExtractionPreset(EnumColor.YELLOW); @Mod.Instance("BuildCraft|Transport") public static BuildCraftTransport instance; diff --git a/common/buildcraft/builders/triggers/ActionFiller.java b/common/buildcraft/builders/triggers/ActionFiller.java index dbfa4d20..1c28bf5c 100644 --- a/common/buildcraft/builders/triggers/ActionFiller.java +++ b/common/buildcraft/builders/triggers/ActionFiller.java @@ -11,9 +11,9 @@ package buildcraft.builders.triggers; import net.minecraft.util.IIcon; import buildcraft.builders.filler.pattern.FillerPattern; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionPassive; -public class ActionFiller extends BCAction { +public class ActionFiller extends BCActionPassive { public final FillerPattern pattern; diff --git a/common/buildcraft/core/ItemMapLocation.java b/common/buildcraft/core/ItemMapLocation.java index a23f1bcc..70597dca 100755 --- a/common/buildcraft/core/ItemMapLocation.java +++ b/common/buildcraft/core/ItemMapLocation.java @@ -186,7 +186,7 @@ public class ItemMapLocation extends ItemBuildCraft { } } - public static IBox getBlox(ItemStack item) { + public static IBox getBox(ItemStack item) { NBTTagCompound cpt = NBTUtils.getItemData(item); if (cpt.hasKey("kind") && cpt.getByte("kind") == 1) { diff --git a/common/buildcraft/core/robots/AIRobotFetchAndEquipItemStack.java b/common/buildcraft/core/robots/AIRobotFetchAndEquipItemStack.java index 5b1ff827..1e3b9d22 100755 --- a/common/buildcraft/core/robots/AIRobotFetchAndEquipItemStack.java +++ b/common/buildcraft/core/robots/AIRobotFetchAndEquipItemStack.java @@ -63,5 +63,7 @@ public class AIRobotFetchAndEquipItemStack extends AIRobot { terminate(); } } + + terminate(); } } diff --git a/common/buildcraft/core/robots/AIRobotFindRandomGroundBlock.java b/common/buildcraft/core/robots/AIRobotFindRandomGroundBlock.java index 0f0e1595..24c14fd4 100755 --- a/common/buildcraft/core/robots/AIRobotFindRandomGroundBlock.java +++ b/common/buildcraft/core/robots/AIRobotFindRandomGroundBlock.java @@ -16,11 +16,14 @@ import buildcraft.core.Box; public class AIRobotFindRandomGroundBlock extends AIRobot { + private static final int MAX_ATTEMPTS = 4096; + public BlockIndex blockFound; private int range; private IBlockFilter filter; private IBox area; + private int attempts = 0; public AIRobotFindRandomGroundBlock(EntityRobotBase iRobot, int iRange, IBlockFilter iFilter, IBox iArea) { super(iRobot, 2, 1); @@ -32,29 +35,33 @@ public class AIRobotFindRandomGroundBlock extends AIRobot { @Override public void update() { - if (blockFound == null) { - int x = 0; - int z = 0; + attempts++; - if (area == null) { - double r = robot.worldObj.rand.nextFloat() * range; - double a = robot.worldObj.rand.nextFloat() * 2.0 * Math.PI; + if (attempts > MAX_ATTEMPTS) { + terminate(); + } - x = (int) (Math.cos(a) * r + Math.floor(robot.posX)); - z = (int) (Math.sin(a) * r + Math.floor(robot.posZ)); - } else { - x = (int) area.pMin().x + robot.worldObj.rand.nextInt(((Box) area).sizeX()); - z = (int) area.pMin().z + robot.worldObj.rand.nextInt(((Box) area).sizeZ()); - } + int x = 0; + int z = 0; - for (int y = robot.worldObj.getHeight(); y >= 0; --y) { - if (filter.matches(robot.worldObj, x, y, z)) { - blockFound = new BlockIndex(x, y, z); - terminate(); - return; - } else if (!robot.worldObj.isAirBlock(x, y, z)) { - return; - } + if (area == null) { + double r = robot.worldObj.rand.nextFloat() * range; + double a = robot.worldObj.rand.nextFloat() * 2.0 * Math.PI; + + x = (int) (Math.cos(a) * r + Math.floor(robot.posX)); + z = (int) (Math.sin(a) * r + Math.floor(robot.posZ)); + } else { + x = (int) area.pMin().x + robot.worldObj.rand.nextInt(((Box) area).sizeX()); + z = (int) area.pMin().z + robot.worldObj.rand.nextInt(((Box) area).sizeZ()); + } + + for (int y = robot.worldObj.getHeight(); y >= 0; --y) { + if (filter.matches(robot.worldObj, x, y, z)) { + blockFound = new BlockIndex(x, y, z); + terminate(); + return; + } else if (!robot.worldObj.isAirBlock(x, y, z)) { + return; } } } diff --git a/common/buildcraft/core/robots/AIRobotGotoSleep.java b/common/buildcraft/core/robots/AIRobotGotoSleep.java new file mode 100755 index 00000000..5a786c2d --- /dev/null +++ b/common/buildcraft/core/robots/AIRobotGotoSleep.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * http://www.mod-buildcraft.com/MMPL-1.0.txt + */ +package buildcraft.core.robots; + +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; + +public class AIRobotGotoSleep extends AIRobot { + + public AIRobotGotoSleep(EntityRobotBase iRobot) { + super(iRobot, 0, 1); + } + + @Override + public void start() { + startDelegateAI(new AIRobotGotoDock(robot, (DockingStation) robot.getLinkedStation())); + } + + @Override + public void delegateAIEnded(AIRobot ai) { + if (ai instanceof AIRobotGotoDock) { + startDelegateAI(new AIRobotSleep(robot)); + } else if (ai instanceof AIRobotSleep) { + terminate(); + } + } +} diff --git a/common/buildcraft/core/robots/AIRobotSleep.java b/common/buildcraft/core/robots/AIRobotSleep.java new file mode 100755 index 00000000..624aa866 --- /dev/null +++ b/common/buildcraft/core/robots/AIRobotSleep.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * http://www.mod-buildcraft.com/MMPL-1.0.txt + */ +package buildcraft.core.robots; + +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; +import buildcraft.silicon.statements.ActionRobotWakeUp; +import buildcraft.transport.gates.ActionIterator; +import buildcraft.transport.gates.ActionSlot; + +public class AIRobotSleep extends AIRobot { + + private static final int SLEEPING_TIME = 60 * 20; + private int sleptTime = 0; + + public AIRobotSleep(EntityRobotBase iRobot) { + super(iRobot, 0, 1); + } + + @Override + public void preempt(AIRobot ai) { + for (ActionSlot s : new ActionIterator(((DockingStation) robot.getLinkedStation()).pipe.pipe)) { + if (s.action instanceof ActionRobotWakeUp) { + terminate(); + } + } + } + + @Override + public void update() { + sleptTime++; + + if (sleptTime > SLEEPING_TIME) { + terminate(); + } + } +} diff --git a/common/buildcraft/core/robots/EntityRobot.java b/common/buildcraft/core/robots/EntityRobot.java index a4edbfbb..2472d510 100755 --- a/common/buildcraft/core/robots/EntityRobot.java +++ b/common/buildcraft/core/robots/EntityRobot.java @@ -45,6 +45,9 @@ import buildcraft.core.network.RPC; import buildcraft.core.network.RPCHandler; import buildcraft.core.network.RPCMessageInfo; import buildcraft.core.network.RPCSide; +import buildcraft.silicon.statements.ActionRobotWorkInArea; +import buildcraft.transport.gates.ActionIterator; +import buildcraft.transport.gates.ActionSlot; public class EntityRobot extends EntityRobotBase implements IEntityAdditionalSpawnData, IInventory { @@ -85,9 +88,6 @@ public class EntityRobot extends EntityRobotBase implements private double mjStored; - private IBox areaToWork; - private long areaResetDate; - public EntityRobot(World world, NBTTagCompound boardNBT) { this(world); @@ -656,14 +656,18 @@ public class EntityRobot extends EntityRobotBase implements } } - @Override - public void workInArea(IBox box) { - areaToWork = box; - areaResetDate = worldObj.getTotalWorldTime() + 5; - } - @Override public IBox getAreaToWork() { - return areaToWork; + for (ActionSlot s : new ActionIterator(linkedDockingStation.pipe.pipe)) { + if (s.action instanceof ActionRobotWorkInArea) { + IBox box = ActionRobotWorkInArea.getArea(s); + + if (box != null) { + return box; + } + } + } + + return null; } } diff --git a/common/buildcraft/core/robots/boards/BoardRobotPlanter.java b/common/buildcraft/core/robots/boards/BoardRobotPlanter.java index d8e8997d..32266f00 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotPlanter.java +++ b/common/buildcraft/core/robots/boards/BoardRobotPlanter.java @@ -20,6 +20,7 @@ import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.inventory.filters.OreStackFilter; import buildcraft.core.robots.AIRobotFetchAndEquipItemStack; import buildcraft.core.robots.AIRobotGotoRandomGroundBlock; +import buildcraft.core.robots.AIRobotGotoSleep; import buildcraft.core.robots.AIRobotPlantSaple; import buildcraft.core.robots.IBlockFilter; @@ -53,7 +54,17 @@ public class BoardRobotPlanter extends RedstoneBoardRobot { @Override public void delegateAIEnded(AIRobot ai) { if (ai instanceof AIRobotGotoRandomGroundBlock) { - startDelegateAI(new AIRobotPlantSaple(robot, ((AIRobotGotoRandomGroundBlock) ai).blockFound)); + AIRobotGotoRandomGroundBlock gotoBlock = (AIRobotGotoRandomGroundBlock) ai; + + if (((AIRobotGotoRandomGroundBlock) ai).blockFound == null) { + startDelegateAI(new AIRobotGotoSleep(robot)); + } else { + startDelegateAI(new AIRobotPlantSaple(robot, ((AIRobotGotoRandomGroundBlock) ai).blockFound)); + } + } else if (ai instanceof AIRobotFetchAndEquipItemStack) { + if (robot.getItemInUse() == null) { + startDelegateAI(new AIRobotGotoSleep(robot)); + } } } diff --git a/common/buildcraft/core/triggers/ActionMachineControl.java b/common/buildcraft/core/triggers/ActionMachineControl.java index 165c879b..5ce114ba 100644 --- a/common/buildcraft/core/triggers/ActionMachineControl.java +++ b/common/buildcraft/core/triggers/ActionMachineControl.java @@ -12,7 +12,7 @@ import java.util.Locale; import buildcraft.core.utils.StringUtils; -public class ActionMachineControl extends BCAction { +public class ActionMachineControl extends BCActionPassive { public enum Mode { diff --git a/common/buildcraft/core/triggers/ActionPipeClose.java b/common/buildcraft/core/triggers/ActionPipeClose.java index 59cb372e..34ffcbce 100755 --- a/common/buildcraft/core/triggers/ActionPipeClose.java +++ b/common/buildcraft/core/triggers/ActionPipeClose.java @@ -15,7 +15,7 @@ import buildcraft.api.gates.IGate; import buildcraft.core.utils.StringUtils; import buildcraft.transport.Pipe; -public class ActionPipeClose extends BCAction { +public class ActionPipeClose extends BCActionActive { public ActionPipeClose() { super("buildcraft:pipe.close"); diff --git a/common/buildcraft/core/triggers/ActionRedstoneOutput.java b/common/buildcraft/core/triggers/ActionRedstoneOutput.java index 223b8ea5..d0bab0af 100644 --- a/common/buildcraft/core/triggers/ActionRedstoneOutput.java +++ b/common/buildcraft/core/triggers/ActionRedstoneOutput.java @@ -9,7 +9,7 @@ package buildcraft.core.triggers; -public class ActionRedstoneOutput extends BCAction { +public class ActionRedstoneOutput extends BCActionPassive { public ActionRedstoneOutput() { super("buildcraft:redstone.output", "buildcraft.redstone.output"); diff --git a/common/buildcraft/core/triggers/BCActionActive.java b/common/buildcraft/core/triggers/BCActionActive.java new file mode 100644 index 00000000..31c427b6 --- /dev/null +++ b/common/buildcraft/core/triggers/BCActionActive.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * http://www.mod-buildcraft.com/MMPL-1.0.txt + */ +package buildcraft.core.triggers; + +import buildcraft.api.gates.IAction; +import buildcraft.api.gates.IActionParameter; + +public abstract class BCActionActive extends BCStatement implements IAction { + + public BCActionActive(String... uniqueTag) { + super(uniqueTag); + } + + @Override + public IActionParameter createParameter(int index) { + return null; + } +} diff --git a/common/buildcraft/core/triggers/BCAction.java b/common/buildcraft/core/triggers/BCActionPassive.java old mode 100644 new mode 100755 similarity index 73% rename from common/buildcraft/core/triggers/BCAction.java rename to common/buildcraft/core/triggers/BCActionPassive.java index 3007050b..39862799 --- a/common/buildcraft/core/triggers/BCAction.java +++ b/common/buildcraft/core/triggers/BCActionPassive.java @@ -12,9 +12,9 @@ import buildcraft.api.gates.IAction; import buildcraft.api.gates.IActionParameter; import buildcraft.api.gates.IGate; -public abstract class BCAction extends BCStatement implements IAction { +public abstract class BCActionPassive extends BCStatement implements IAction { - public BCAction(String... uniqueTag) { + public BCActionPassive(String... uniqueTag) { super(uniqueTag); } @@ -24,6 +24,6 @@ public abstract class BCAction extends BCStatement implements IAction { } @Override - public void actionActivate(IGate gate, IActionParameter[] parameters) { + public final void actionActivate(IGate gate, IActionParameter[] parameters) { } } diff --git a/common/buildcraft/silicon/statements/ActionRobotGoToStation.java b/common/buildcraft/silicon/statements/ActionRobotGoToStation.java index b92ac435..74a15f5d 100755 --- a/common/buildcraft/silicon/statements/ActionRobotGoToStation.java +++ b/common/buildcraft/silicon/statements/ActionRobotGoToStation.java @@ -23,14 +23,14 @@ import buildcraft.core.ItemMapLocation; import buildcraft.core.robots.AIRobotGoAndLinkToDock; import buildcraft.core.robots.DockingStation; import buildcraft.core.robots.EntityRobot; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionActive; import buildcraft.core.utils.StringUtils; import buildcraft.transport.Pipe; import buildcraft.transport.TileGenericPipe; -public class ActionRobotGoToStation extends BCAction { +public class ActionRobotGotoStation extends BCActionActive { - public ActionRobotGoToStation() { + public ActionRobotGotoStation() { super("buildcraft:robot.goto_station"); } diff --git a/common/buildcraft/silicon/statements/ActionRobotWakeUp.java b/common/buildcraft/silicon/statements/ActionRobotWakeUp.java new file mode 100755 index 00000000..3db5e2f9 --- /dev/null +++ b/common/buildcraft/silicon/statements/ActionRobotWakeUp.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * http://www.mod-buildcraft.com/MMPL-1.0.txt + */ +package buildcraft.silicon.statements; + +import net.minecraft.client.renderer.texture.IIconRegister; + +import buildcraft.core.triggers.BCActionPassive; +import buildcraft.core.utils.StringUtils; + +public class ActionRobotWakeUp extends BCActionPassive { + + public ActionRobotWakeUp() { + super("buildcraft:robot.wakeup"); + } + + @Override + public String getDescription() { + return StringUtils.localize("gate.action.robot.wakeup"); + } + + @Override + public void registerIcons(IIconRegister iconRegister) { + icon = iconRegister.registerIcon("buildcraft:triggers/action_robot_wakeup"); + } +} diff --git a/common/buildcraft/silicon/statements/ActionRobotWorkInArea.java b/common/buildcraft/silicon/statements/ActionRobotWorkInArea.java index 8a6d4d8f..f4ea005b 100755 --- a/common/buildcraft/silicon/statements/ActionRobotWorkInArea.java +++ b/common/buildcraft/silicon/statements/ActionRobotWorkInArea.java @@ -11,20 +11,15 @@ package buildcraft.silicon.statements; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - import buildcraft.api.core.IBox; import buildcraft.api.gates.ActionParameterItemStack; import buildcraft.api.gates.IActionParameter; -import buildcraft.api.gates.IGate; import buildcraft.core.ItemMapLocation; -import buildcraft.core.robots.DockingStation; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionPassive; import buildcraft.core.utils.StringUtils; -import buildcraft.transport.Pipe; -import buildcraft.transport.TileGenericPipe; +import buildcraft.transport.gates.ActionSlot; -public class ActionRobotWorkInArea extends BCAction { +public class ActionRobotWorkInArea extends BCActionPassive { public ActionRobotWorkInArea() { super("buildcraft:robot.work_in_area"); @@ -40,34 +35,18 @@ public class ActionRobotWorkInArea extends BCAction { icon = iconRegister.registerIcon("buildcraft:triggers/action_robot_in_area"); } - @Override - public void actionActivate(IGate gate, IActionParameter[] parameters) { - if (parameters[0] == null) { - return; + public static IBox getArea(ActionSlot slot) { + if (slot.parameters[0] == null) { + return null; } - ItemStack stack = ((ActionParameterItemStack) parameters[0]).getItemStackToDraw(); + ItemStack stack = ((ActionParameterItemStack) slot.parameters[0]).getItemStackToDraw(); if (!(stack.getItem() instanceof ItemMapLocation)) { - return; + return null; } - IBox box = ItemMapLocation.getBlox(stack); - - if (box == null) { - return; - } - - Pipe pipe = (Pipe) gate.getPipe(); - TileGenericPipe tile = pipe.container; - - for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { - DockingStation station = tile.getStation(d); - - if (station != null && station.linked() != null) { - station.linked().workInArea(box); - } - } + return ItemMapLocation.getBox(stack); } @Override diff --git a/common/buildcraft/silicon/statements/ActionStationProvideItems.java b/common/buildcraft/silicon/statements/ActionStationProvideItems.java index 08a2ec0d..2c87edce 100755 --- a/common/buildcraft/silicon/statements/ActionStationProvideItems.java +++ b/common/buildcraft/silicon/statements/ActionStationProvideItems.java @@ -16,11 +16,11 @@ import net.minecraft.item.ItemStack; import buildcraft.api.gates.ActionParameterItemStack; import buildcraft.api.gates.IActionParameter; import buildcraft.api.gates.IGate; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionActive; import buildcraft.core.utils.StringUtils; import buildcraft.transport.Pipe; -public class ActionStationProvideItems extends BCAction { +public class ActionStationProvideItems extends BCActionActive { public ActionStationProvideItems() { super("buildcraft:station.provide_items"); diff --git a/common/buildcraft/silicon/statements/ActionStationRequestItems.java b/common/buildcraft/silicon/statements/ActionStationRequestItems.java index 34739c6f..787b7d15 100755 --- a/common/buildcraft/silicon/statements/ActionStationRequestItems.java +++ b/common/buildcraft/silicon/statements/ActionStationRequestItems.java @@ -16,11 +16,11 @@ import net.minecraft.item.ItemStack; import buildcraft.api.gates.ActionParameterItemStack; import buildcraft.api.gates.IActionParameter; import buildcraft.api.gates.IGate; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionActive; import buildcraft.core.utils.StringUtils; import buildcraft.transport.Pipe; -public class ActionStationRequestItems extends BCAction { +public class ActionStationRequestItems extends BCActionActive { public ActionStationRequestItems() { super("buildcraft:station.request_items"); diff --git a/common/buildcraft/silicon/statements/RobotsActionProvider.java b/common/buildcraft/silicon/statements/RobotsActionProvider.java index 16b4af6d..8a5be5fc 100755 --- a/common/buildcraft/silicon/statements/RobotsActionProvider.java +++ b/common/buildcraft/silicon/statements/RobotsActionProvider.java @@ -44,6 +44,7 @@ public class RobotsActionProvider implements IActionProvider { result.add(BuildCraftSilicon.actionRobotGotoStation); result.add(BuildCraftSilicon.actionRobotWorkInArea); + result.add(BuildCraftSilicon.actionRobotWakeUp); for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { if (((TileGenericPipe) pipe).getTile(dir) instanceof IInventory) { diff --git a/common/buildcraft/silicon/statements/RobotsTriggerProvider.java b/common/buildcraft/silicon/statements/RobotsTriggerProvider.java new file mode 100755 index 00000000..61cc6513 --- /dev/null +++ b/common/buildcraft/silicon/statements/RobotsTriggerProvider.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * http://www.mod-buildcraft.com/MMPL-1.0.txt + */ +package buildcraft.silicon.statements; + +import java.util.Collection; +import java.util.LinkedList; + +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; + +import net.minecraftforge.common.util.ForgeDirection; + +import buildcraft.BuildCraftSilicon; +import buildcraft.api.gates.ITrigger; +import buildcraft.api.gates.ITriggerProvider; +import buildcraft.api.transport.IPipeTile; +import buildcraft.transport.TileGenericPipe; + +public class RobotsTriggerProvider implements ITriggerProvider { + + @Override + public Collection getPipeTriggers(IPipeTile pipe) { + LinkedList result = new LinkedList(); + + boolean stationFound = false; + + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + if (((TileGenericPipe) pipe).getStation(dir) != null) { + stationFound = true; + break; + } + } + + if (!stationFound) { + return result; + } + + result.add(BuildCraftSilicon.triggerRobotSleep); + + return result; + } + + @Override + public Collection getNeighborTriggers(Block block, TileEntity tile) { + return null; + } + +} diff --git a/common/buildcraft/silicon/statements/TriggerRobotSleep.java b/common/buildcraft/silicon/statements/TriggerRobotSleep.java new file mode 100755 index 00000000..6fedccc3 --- /dev/null +++ b/common/buildcraft/silicon/statements/TriggerRobotSleep.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * http://www.mod-buildcraft.com/MMPL-1.0.txt + */ +package buildcraft.silicon.statements; + +import net.minecraft.client.renderer.texture.IIconRegister; + +import net.minecraftforge.common.util.ForgeDirection; + +import buildcraft.api.gates.IGate; +import buildcraft.api.gates.ITriggerParameter; +import buildcraft.core.robots.AIRobotSleep; +import buildcraft.core.robots.DockingStation; +import buildcraft.core.robots.EntityRobot; +import buildcraft.core.triggers.BCTrigger; +import buildcraft.core.utils.StringUtils; +import buildcraft.transport.Pipe; +import buildcraft.transport.TileGenericPipe; + +public class TriggerRobotSleep extends BCTrigger { + + public TriggerRobotSleep() { + super("buildcraft:robot.sleep"); + } + + @Override + public String getDescription() { + return StringUtils.localize("gate.trigger.robot.sleep"); + } + + @Override + public void registerIcons(IIconRegister iconRegister) { + icon = iconRegister.registerIcon("buildcraft:triggers/trigger_robot_sleep"); + } + + @Override + public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) { + Pipe pipe = (Pipe) gate.getPipe(); + TileGenericPipe tile = pipe.container; + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + DockingStation station = tile.getStation(d); + + if (station != null && station.linked() != null) { + EntityRobot robot = (EntityRobot) station.linked(); + + if (robot.mainAI.getActiveAI() instanceof AIRobotSleep) { + return true; + } + } + } + + return false; + } +} diff --git a/common/buildcraft/transport/gates/ActionIterator.java b/common/buildcraft/transport/gates/ActionIterator.java new file mode 100755 index 00000000..8827390f --- /dev/null +++ b/common/buildcraft/transport/gates/ActionIterator.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * http://www.mod-buildcraft.com/MMPL-1.0.txt + */ +package buildcraft.transport.gates; + +import java.util.Iterator; + +import net.minecraftforge.common.util.ForgeDirection; + +import buildcraft.transport.ActionActiveState; +import buildcraft.transport.Gate; +import buildcraft.transport.Pipe; + +public class ActionIterator implements Iterable { + + private Pipe pipe; + + public ActionIterator(Pipe iPipe) { + pipe = iPipe; + } + + @Override + public Iterator iterator() { + return new It(); + } + + private class It implements Iterator { + + private ForgeDirection curDir = ForgeDirection.values()[0]; + private int index = 0; + private ActionSlot next; + + public It() { + while (!isValid()) { + if (index < Gate.MAX_STATEMENTS - 1) { + index++; + } else if (curDir != ForgeDirection.UNKNOWN) { + index = 0; + curDir = ForgeDirection.values()[curDir.ordinal() + 1]; + } else { + break; + } + } + + if (isValid()) { + next = new ActionSlot(); + next.action = pipe.gates[curDir.ordinal()].actions[index]; + next.parameters = pipe.gates[curDir.ordinal()].actionParameters[index]; + } + } + + @Override + public boolean hasNext() { + return next != null; + } + + @Override + public ActionSlot next() { + ActionSlot result = next; + + while (true) { + if (index < Gate.MAX_STATEMENTS - 1) { + index++; + } else if (curDir != ForgeDirection.UNKNOWN) { + index = 0; + curDir = ForgeDirection.values()[curDir.ordinal() + 1]; + } else { + break; + } + } + + if (isValid()) { + next = new ActionSlot(); + next.action = pipe.gates[curDir.ordinal()].actions[index]; + next.parameters = pipe.gates[curDir.ordinal()].actionParameters[index]; + } else { + next = null; + } + + return result; + } + + @Override + public void remove() { + throw new UnsupportedOperationException("Remove not supported."); + } + + private boolean isValid() { + if (curDir == ForgeDirection.UNKNOWN) { + return false; + } + + Gate gate = pipe.gates[curDir.ordinal()]; + + if (gate == null) { + return false; + } + + if (gate.actions[index] == null || gate.actionsState[index] != ActionActiveState.Activated) { + return false; + } + + return true; + } + }; +} diff --git a/common/buildcraft/transport/gates/ActionSlot.java b/common/buildcraft/transport/gates/ActionSlot.java new file mode 100755 index 00000000..7bf26d66 --- /dev/null +++ b/common/buildcraft/transport/gates/ActionSlot.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * http://www.mod-buildcraft.com/MMPL-1.0.txt + */ +package buildcraft.transport.gates; + +import buildcraft.api.gates.IAction; +import buildcraft.api.gates.IActionParameter; + +public class ActionSlot { + public IAction action; + public IActionParameter[] parameters; +} diff --git a/common/buildcraft/transport/triggers/ActionEnergyPulsar.java b/common/buildcraft/transport/triggers/ActionEnergyPulsar.java index c5306b41..eff75db1 100644 --- a/common/buildcraft/transport/triggers/ActionEnergyPulsar.java +++ b/common/buildcraft/transport/triggers/ActionEnergyPulsar.java @@ -10,10 +10,10 @@ package buildcraft.transport.triggers; import net.minecraft.client.renderer.texture.IIconRegister; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionPassive; import buildcraft.core.utils.StringUtils; -public class ActionEnergyPulsar extends BCAction { +public class ActionEnergyPulsar extends BCActionPassive { public ActionEnergyPulsar() { super("buildcraft:pulsar.constant", "buildcraft.pulser.constant"); diff --git a/common/buildcraft/transport/triggers/ActionExtractionPreset.java b/common/buildcraft/transport/triggers/ActionExtractionPreset.java index fc48e152..b424f192 100644 --- a/common/buildcraft/transport/triggers/ActionExtractionPreset.java +++ b/common/buildcraft/transport/triggers/ActionExtractionPreset.java @@ -12,11 +12,11 @@ import java.util.Locale; import net.minecraft.client.renderer.texture.IIconRegister; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionPassive; import buildcraft.core.utils.EnumColor; import buildcraft.core.utils.StringUtils; -public class ActionExtractionPreset extends BCAction { +public class ActionExtractionPreset extends BCActionPassive { public final EnumColor color; diff --git a/common/buildcraft/transport/triggers/ActionPipeColor.java b/common/buildcraft/transport/triggers/ActionPipeColor.java index 6c9911d3..960bc3f2 100644 --- a/common/buildcraft/transport/triggers/ActionPipeColor.java +++ b/common/buildcraft/transport/triggers/ActionPipeColor.java @@ -12,11 +12,11 @@ import java.util.Locale; import net.minecraft.client.renderer.texture.IIconRegister; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionPassive; import buildcraft.core.utils.EnumColor; import buildcraft.core.utils.StringUtils; -public class ActionPipeColor extends BCAction { +public class ActionPipeColor extends BCActionPassive { public final EnumColor color; diff --git a/common/buildcraft/transport/triggers/ActionPipeDirection.java b/common/buildcraft/transport/triggers/ActionPipeDirection.java index 078801e1..c63bfaf9 100644 --- a/common/buildcraft/transport/triggers/ActionPipeDirection.java +++ b/common/buildcraft/transport/triggers/ActionPipeDirection.java @@ -16,9 +16,9 @@ import net.minecraftforge.common.util.ForgeDirection; import buildcraft.BuildCraftTransport; import buildcraft.api.gates.IAction; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionPassive; -public class ActionPipeDirection extends BCAction { +public class ActionPipeDirection extends BCActionPassive { public final ForgeDirection direction; diff --git a/common/buildcraft/transport/triggers/ActionPowerLimiter.java b/common/buildcraft/transport/triggers/ActionPowerLimiter.java index 3c45116f..e53ee35b 100644 --- a/common/buildcraft/transport/triggers/ActionPowerLimiter.java +++ b/common/buildcraft/transport/triggers/ActionPowerLimiter.java @@ -12,10 +12,10 @@ import java.util.Locale; import net.minecraft.client.renderer.texture.IIconRegister; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionPassive; import buildcraft.transport.pipes.PipePowerIron.PowerMode; -public class ActionPowerLimiter extends BCAction { +public class ActionPowerLimiter extends BCActionPassive { public final PowerMode limit; diff --git a/common/buildcraft/transport/triggers/ActionRedstoneFaderOutput.java b/common/buildcraft/transport/triggers/ActionRedstoneFaderOutput.java index aa358326..e03b9064 100644 --- a/common/buildcraft/transport/triggers/ActionRedstoneFaderOutput.java +++ b/common/buildcraft/transport/triggers/ActionRedstoneFaderOutput.java @@ -14,10 +14,10 @@ import net.minecraft.util.IIcon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionPassive; import buildcraft.core.utils.StringUtils; -public class ActionRedstoneFaderOutput extends BCAction { +public class ActionRedstoneFaderOutput extends BCActionPassive { public final int level; diff --git a/common/buildcraft/transport/triggers/ActionSignalOutput.java b/common/buildcraft/transport/triggers/ActionSignalOutput.java index 2b4093e6..12a2e39b 100644 --- a/common/buildcraft/transport/triggers/ActionSignalOutput.java +++ b/common/buildcraft/transport/triggers/ActionSignalOutput.java @@ -13,12 +13,12 @@ import java.util.Locale; import buildcraft.api.gates.IActionParameter; import buildcraft.api.gates.IGate; import buildcraft.api.transport.PipeWire; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionActive; import buildcraft.core.triggers.StatementIconProvider; import buildcraft.core.utils.StringUtils; import buildcraft.transport.Gate; -public class ActionSignalOutput extends BCAction { +public class ActionSignalOutput extends BCActionActive { public PipeWire color; diff --git a/common/buildcraft/transport/triggers/ActionSingleEnergyPulse.java b/common/buildcraft/transport/triggers/ActionSingleEnergyPulse.java index 76e10857..27b5d354 100644 --- a/common/buildcraft/transport/triggers/ActionSingleEnergyPulse.java +++ b/common/buildcraft/transport/triggers/ActionSingleEnergyPulse.java @@ -10,10 +10,10 @@ package buildcraft.transport.triggers; import net.minecraft.client.renderer.texture.IIconRegister; -import buildcraft.core.triggers.BCAction; +import buildcraft.core.triggers.BCActionPassive; import buildcraft.core.utils.StringUtils; -public class ActionSingleEnergyPulse extends BCAction { +public class ActionSingleEnergyPulse extends BCActionPassive { public ActionSingleEnergyPulse() { super("buildcraft:pulsar.single", "buildcraft.pulser.single");