From 3c409ca0b9ca48f9c96242009f64c677bd292d28 Mon Sep 17 00:00:00 2001 From: SpaceToad Date: Thu, 26 Jun 2014 08:51:28 +0200 Subject: [PATCH] started work on bomber, for #1913 --- .../api/robots/EntityRobotBase.java | 5 + .../assets/buildcraft/lang/en_US.lang | 3 + .../textures/entities/robot_bomber.png | Bin 0 -> 1792 bytes common/buildcraft/BuildCraftSilicon.java | 4 + common/buildcraft/core/ItemMapLocation.java | 18 ++++ .../buildcraft/core/robots/AIRobotLoad.java | 9 +- .../buildcraft/core/robots/EntityRobot.java | 14 +++ .../core/robots/boards/BoardRobotBomber.java | 57 +++++++++++ .../robots/boards/BoardRobotBomberNBT.java | 72 ++++++++++++++ .../core/robots/boards/BoardRobotCarrier.java | 2 +- common/buildcraft/core/triggers/BCAction.java | 5 + .../buildcraft/core/triggers/BCTrigger.java | 5 + .../statements/ActionRobotGoToStation.java | 3 +- .../statements/ActionRobotWorkInArea.java | 90 ++++++++++++++++++ .../statements/RobotsActionProvider.java | 1 + 15 files changed, 284 insertions(+), 4 deletions(-) create mode 100755 buildcraft_resources/assets/buildcraft/textures/entities/robot_bomber.png create mode 100755 common/buildcraft/core/robots/boards/BoardRobotBomber.java create mode 100755 common/buildcraft/core/robots/boards/BoardRobotBomberNBT.java create mode 100755 common/buildcraft/silicon/statements/ActionRobotWorkInArea.java diff --git a/api/buildcraft/api/robots/EntityRobotBase.java b/api/buildcraft/api/robots/EntityRobotBase.java index 32741540..b6a04272 100755 --- a/api/buildcraft/api/robots/EntityRobotBase.java +++ b/api/buildcraft/api/robots/EntityRobotBase.java @@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import buildcraft.api.boards.RedstoneBoardRobot; +import buildcraft.api.core.IBox; public abstract class EntityRobotBase extends EntityLiving implements IInventory { @@ -51,4 +52,8 @@ 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 69c3b7be..e9ea3ee4 100755 --- a/buildcraft_resources/assets/buildcraft/lang/en_US.lang +++ b/buildcraft_resources/assets/buildcraft/lang/en_US.lang @@ -5,6 +5,8 @@ buildcraft.boardRobotLumberjack=Lumberjack buildcraft.boardRobotPlanter=Planter buildcraft.boardRobotLeaveCutter=Leave Cutter buildcraft.boardRobotCarrier=Carrier +buildcraft.boardRobotBomber=Bomber +buildcraft.boardRobotKnight=Knight buildcraft.boardDetail.parameters=Parameters buildcraft.boardDetail.range=Range @@ -55,6 +57,7 @@ gate.action.robot.goto_station=Goto Station 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.expansion.fader=Redstone Fader gate.expansion.pulsar=Autarchic Pulsar diff --git a/buildcraft_resources/assets/buildcraft/textures/entities/robot_bomber.png b/buildcraft_resources/assets/buildcraft/textures/entities/robot_bomber.png new file mode 100755 index 0000000000000000000000000000000000000000..9e8ab945a59df1c57c4087b528700b8bc6c9b55b GIT binary patch literal 1792 zcmV+b2mknqP)576eOtnAiXS28~HX zK~!ko)tO6d8`l*;&wMz;pC$ez>K`$ZYdb1zsIq{%a1BSWH)*`;ra-ev5u^oLpqp;8 zD6;6L%eIRG&LZiut8SDwK-2UCH>%Ufj%&%bY{B|avM7=kNzDw0pWzI<5F~p+Z{B2s7yC5pu& zq9k$l+ew#w@{P8>IV32SmLMoMFaAd}1pZ@1dR4ofp6wow{?x8#T^727Dzjp1KOCKK}=S50!dy zH-}j&p{fe!E-kz4mGl)dnGBIg1WnUO4BtO6FE=~5?R$Q^-mKi4=qC{HV;Ba3fS;jn zEx7Ct|9z55wTjQ@V_jQk;2SfC;tw?e&#$~|JA8#_K)gLpGMS`i+YDcR;)XWIc zXavW05JYiLUU=nA>WZRJtyW1S5FSD5uh+3{8`Ct=^%|X>p^dv%6v<{QL?SYhBq0a_@pv3bl2}?=;y>3d;V^N) z>cjJ7GZ|hU7(iQJr}NBhmwoZ>*J*8OrCcskDwP@z#O=H=_gj+-co!h|If2m~1IOXBnS z_~Ly7kH^E=??&-@y(E9TfZwk&HI`s`d6}0V8Qg!L15ZF^c9e3tj7Rpcyu8fl)r{-a z+kfq3XlRH^wSpwc1iJp_vhT!;gM)qed_Hoy9J+2WFff4QI24O@^7%XfmStg@HnJ?E z>pEVqcjIm?77+x2Y*wRGDq$D~rfJgK+so6Z8_sK*g~#JT*L74?MpadExg4=rY^$Av z20^Q-ReW9_UZ1bQc{4ReG#16OEEX4&4bJbz3+I3AujkfG;_(m@zb*jKeZ7yCmKHkh zWO(o(!*>Qda2$sZezgI`eiNs&vlIJ|cPN!0wgw&#OnkJ_S;sYqMg>lt{u=3Ynu1i| z#0j|h?uPyMpPit!wUxKtS!U%A`+ot`pY{`tMsaMLOeVwdt1GTo=D&Ca)vF?k65&t? zHU1ZOgt!MU+qO+O>?fTrJnK^sFin$(4>NRjDy*!m5)Asc?24jb7zW*uFp?zEs^l3O z8iJ2Dwnj86pePEut}{PhpywRe&(1|G%c54R(cK+jg`#V)f4a~{rs9yT+N@O_E`3vF z@+UgkYGFfkpieY{A0`z>I2!}%`ih^ZXJJtjC z3_EhAs`E;}S_ 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); + } + } + } + + @Override + public int maxParameters() { + return 1; + } + + @Override + public IActionParameter createParameter(int index) { + return new ActionParameterItemStack(); + } +} diff --git a/common/buildcraft/silicon/statements/RobotsActionProvider.java b/common/buildcraft/silicon/statements/RobotsActionProvider.java index 79966352..16b4af6d 100755 --- a/common/buildcraft/silicon/statements/RobotsActionProvider.java +++ b/common/buildcraft/silicon/statements/RobotsActionProvider.java @@ -43,6 +43,7 @@ public class RobotsActionProvider implements IActionProvider { } result.add(BuildCraftSilicon.actionRobotGotoStation); + result.add(BuildCraftSilicon.actionRobotWorkInArea); for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { if (((TileGenericPipe) pipe).getTile(dir) instanceof IInventory) {