diff --git a/api/buildcraft/api/boards/RedstoneBoardRobot.java b/api/buildcraft/api/boards/RedstoneBoardRobot.java index 1567d1a8..7c2ea309 100755 --- a/api/buildcraft/api/boards/RedstoneBoardRobot.java +++ b/api/buildcraft/api/boards/RedstoneBoardRobot.java @@ -10,9 +10,9 @@ package buildcraft.api.boards; import java.util.HashSet; -import buildcraft.core.BlockIndex; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; +import buildcraft.api.core.BlockIndex; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; public abstract class RedstoneBoardRobot extends AIRobot implements IRedstoneBoard { diff --git a/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java b/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java index 980fc39e..af9a8ec5 100755 --- a/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java +++ b/api/buildcraft/api/boards/RedstoneBoardRobotNBT.java @@ -11,7 +11,7 @@ package buildcraft.api.boards; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; -import buildcraft.robots.EntityRobotBase; +import buildcraft.api.robots.EntityRobotBase; public abstract class RedstoneBoardRobotNBT extends RedstoneBoardNBT { diff --git a/common/buildcraft/core/BlockIndex.java b/api/buildcraft/api/core/BlockIndex.java similarity index 98% rename from common/buildcraft/core/BlockIndex.java rename to api/buildcraft/api/core/BlockIndex.java index 909017eb..f34ba4db 100644 --- a/common/buildcraft/core/BlockIndex.java +++ b/api/buildcraft/api/core/BlockIndex.java @@ -6,7 +6,7 @@ * 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; +package buildcraft.api.core; import net.minecraft.block.Block; import net.minecraft.entity.Entity; diff --git a/api/buildcraft/api/core/BuildCraftAPI.java b/api/buildcraft/api/core/BuildCraftAPI.java index 324fe0fa..1c9f7396 100644 --- a/api/buildcraft/api/core/BuildCraftAPI.java +++ b/api/buildcraft/api/core/BuildCraftAPI.java @@ -14,17 +14,15 @@ import java.util.Set; import net.minecraft.block.Block; import net.minecraft.world.World; -import buildcraft.core.utils.WorldProperty; - public final class BuildCraftAPI { public static ICoreProxy proxy; public static final Set softBlocks = new HashSet(); - public static WorldProperty isSoftProperty; - public static WorldProperty isWoodProperty; - public static WorldProperty isLeavesProperty; + public static IWorldProperty isSoftProperty; + public static IWorldProperty isWoodProperty; + public static IWorldProperty isLeavesProperty; /** * Deactivate constructor diff --git a/api/buildcraft/api/core/IWorldProperty.java b/api/buildcraft/api/core/IWorldProperty.java new file mode 100755 index 00000000..4a900c62 --- /dev/null +++ b/api/buildcraft/api/core/IWorldProperty.java @@ -0,0 +1,18 @@ +/** + * 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.api.core; + +import net.minecraft.world.World; + +public interface IWorldProperty { + + boolean get(World world, int x, int y, int z); + + void clear(); +} diff --git a/api/buildcraft/robots/AIRobot.java b/api/buildcraft/api/robots/AIRobot.java similarity index 97% rename from api/buildcraft/robots/AIRobot.java rename to api/buildcraft/api/robots/AIRobot.java index a6002d6a..6b53d263 100755 --- a/api/buildcraft/robots/AIRobot.java +++ b/api/buildcraft/api/robots/AIRobot.java @@ -1,5 +1,5 @@ -package buildcraft.robots; +package buildcraft.api.robots; public class AIRobot { public EntityRobotBase robot; diff --git a/api/buildcraft/robots/DockingStationRegistry.java b/api/buildcraft/api/robots/DockingStationRegistry.java similarity index 76% rename from api/buildcraft/robots/DockingStationRegistry.java rename to api/buildcraft/api/robots/DockingStationRegistry.java index e4195e56..75d53885 100755 --- a/api/buildcraft/robots/DockingStationRegistry.java +++ b/api/buildcraft/api/robots/DockingStationRegistry.java @@ -6,7 +6,7 @@ * 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.robots; +package buildcraft.api.robots; import java.security.InvalidParameterException; import java.util.Collection; @@ -16,7 +16,7 @@ import net.minecraftforge.common.util.ForgeDirection; public final class DockingStationRegistry { - private static HashMap stations = new HashMap(); + private static HashMap stations = new HashMap(); private DockingStationRegistry() { @@ -56,7 +56,7 @@ public final class DockingStationRegistry { } } - public static DockingStation getStation(int x, int y, int z, ForgeDirection side) { + public static IDockingStation getStation(int x, int y, int z, ForgeDirection side) { StationIndex index = new StationIndex(x, y, z, side); if (stations.containsKey(index)) { @@ -66,11 +66,11 @@ public final class DockingStationRegistry { } } - public static Collection getStations() { + public static Collection getStations() { return stations.values(); } - public static void registerStation(DockingStation station) { + public static void registerStation(IDockingStation station) { StationIndex index = toIndex(station); if (stations.containsKey(index)) { @@ -80,7 +80,7 @@ public final class DockingStationRegistry { } } - public static void removeStation(DockingStation station) { + public static void removeStation(IDockingStation station) { StationIndex index = toIndex(station); if (stations.containsKey(index)) { @@ -88,8 +88,8 @@ public final class DockingStationRegistry { } } - private static StationIndex toIndex(DockingStation station) { - return new StationIndex(station.pipe.xCoord, station.pipe.yCoord, station.pipe.zCoord, station.side); + private static StationIndex toIndex(IDockingStation station) { + return new StationIndex(station.x(), station.y(), station.z(), station.side()); } public static void clear() { diff --git a/api/buildcraft/robots/EntityRobotBase.java b/api/buildcraft/api/robots/EntityRobotBase.java similarity index 82% rename from api/buildcraft/robots/EntityRobotBase.java rename to api/buildcraft/api/robots/EntityRobotBase.java index 6f5856df..4a2c6d44 100755 --- a/api/buildcraft/robots/EntityRobotBase.java +++ b/api/buildcraft/api/robots/EntityRobotBase.java @@ -6,7 +6,7 @@ * 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.robots; +package buildcraft.api.robots; import net.minecraft.entity.EntityLiving; import net.minecraft.inventory.IInventory; @@ -31,11 +31,11 @@ public abstract class EntityRobotBase extends EntityLiving implements IInventory public abstract boolean isMoving(); - public abstract void setCurrentDockingStation(DockingStation station); + public abstract void setCurrentDockingStation(IDockingStation station); - public abstract DockingStation getCurrentDockingStation(); + public abstract IDockingStation getCurrentDockingStation(); - public abstract DockingStation getMainDockingStation(); + public abstract IDockingStation getMainDockingStation(); public abstract RedstoneBoardRobot getBoard(); diff --git a/api/buildcraft/api/robots/IDockingStation.java b/api/buildcraft/api/robots/IDockingStation.java new file mode 100755 index 00000000..0ccb74a6 --- /dev/null +++ b/api/buildcraft/api/robots/IDockingStation.java @@ -0,0 +1,23 @@ +/** + * 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.api.robots; + +import net.minecraftforge.common.util.ForgeDirection; + +public interface IDockingStation { + + int x(); + + int y(); + + int z(); + + ForgeDirection side(); + +} diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java index 967cf1b4..cf49984a 100644 --- a/common/buildcraft/BuildCraftCore.java +++ b/common/buildcraft/BuildCraftCore.java @@ -59,13 +59,14 @@ import net.minecraftforge.oredict.OreDictionary; import buildcraft.api.blueprints.SchematicRegistry; import buildcraft.api.boards.RedstoneBoardRobot; import buildcraft.api.core.BCLog; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.BuildCraftAPI; import buildcraft.api.core.IIconProvider; import buildcraft.api.core.JavaTools; import buildcraft.api.gates.StatementManager; import buildcraft.api.recipes.BuildcraftRecipeRegistry; +import buildcraft.api.robots.DockingStationRegistry; import buildcraft.builders.urbanism.EntityRobotUrbanism; -import buildcraft.core.BlockIndex; import buildcraft.core.BlockSpring; import buildcraft.core.BuildCraftConfiguration; import buildcraft.core.CommandBuildCraft; @@ -106,7 +107,6 @@ import buildcraft.core.utils.CraftingHandler; import buildcraft.core.utils.WorldPropertyIsLeave; import buildcraft.core.utils.WorldPropertyIsSoft; import buildcraft.core.utils.WorldPropertyIsWood; -import buildcraft.robots.DockingStationRegistry; @Mod(name = "BuildCraft", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", acceptedMinecraftVersions = "[1.7.2,1.8)", dependencies = "required-after:Forge@[10.12.2.1121,)") public class BuildCraftCore extends BuildCraftMod { diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java index 63d4b24c..2648ee5d 100644 --- a/common/buildcraft/BuildCraftEnergy.java +++ b/common/buildcraft/BuildCraftEnergy.java @@ -43,11 +43,11 @@ import net.minecraftforge.fluids.FluidStack; import buildcraft.api.blueprints.SchematicRegistry; import buildcraft.api.core.BCLog; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.JavaTools; import buildcraft.api.fuels.IronEngineCoolant; import buildcraft.api.fuels.IronEngineFuel; import buildcraft.api.recipes.BuildcraftRecipeRegistry; -import buildcraft.core.BlockIndex; import buildcraft.core.BlockSpring; import buildcraft.core.DefaultProps; import buildcraft.core.InterModComms; diff --git a/common/buildcraft/builders/TileArchitect.java b/common/buildcraft/builders/TileArchitect.java index b6d072de..d70a1397 100644 --- a/common/buildcraft/builders/TileArchitect.java +++ b/common/buildcraft/builders/TileArchitect.java @@ -18,9 +18,9 @@ import net.minecraftforge.common.util.ForgeDirection; import buildcraft.BuildCraftBuilders; import buildcraft.api.blueprints.Translation; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.IAreaProvider; import buildcraft.api.core.NetworkData; -import buildcraft.core.BlockIndex; import buildcraft.core.BlockScanner; import buildcraft.core.Box; import buildcraft.core.Box.Kind; diff --git a/common/buildcraft/builders/TileBuilder.java b/common/buildcraft/builders/TileBuilder.java index bf274001..91ad62e6 100644 --- a/common/buildcraft/builders/TileBuilder.java +++ b/common/buildcraft/builders/TileBuilder.java @@ -31,10 +31,10 @@ import net.minecraftforge.fluids.IFluidHandler; import buildcraft.BuildCraftBuilders; import buildcraft.api.blueprints.BuildingPermission; import buildcraft.api.blueprints.Translation; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.NetworkData; import buildcraft.api.core.Position; import buildcraft.api.gates.IAction; -import buildcraft.core.BlockIndex; import buildcraft.core.Box; import buildcraft.core.Box.Kind; import buildcraft.core.IMachine; diff --git a/common/buildcraft/builders/TilePathMarker.java b/common/buildcraft/builders/TilePathMarker.java index 38d78c30..5f2235b3 100644 --- a/common/buildcraft/builders/TilePathMarker.java +++ b/common/buildcraft/builders/TilePathMarker.java @@ -17,9 +17,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.NetworkData; import buildcraft.api.core.Position; -import buildcraft.core.BlockIndex; import buildcraft.core.LaserData; import buildcraft.core.network.PacketUpdate; diff --git a/common/buildcraft/core/BlockScanner.java b/common/buildcraft/core/BlockScanner.java index 1986b83d..ec1047cd 100755 --- a/common/buildcraft/core/BlockScanner.java +++ b/common/buildcraft/core/BlockScanner.java @@ -13,6 +13,8 @@ import java.util.Iterator; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import buildcraft.api.core.BlockIndex; + public class BlockScanner implements Iterable { Box box = new Box (); diff --git a/common/buildcraft/core/BlockWrapper.java b/common/buildcraft/core/BlockWrapper.java index 87d6eac8..7f9e5c4e 100755 --- a/common/buildcraft/core/BlockWrapper.java +++ b/common/buildcraft/core/BlockWrapper.java @@ -11,6 +11,8 @@ package buildcraft.core; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; +import buildcraft.api.core.BlockIndex; + public class BlockWrapper { public BlockIndex index; public TileEntity tile; diff --git a/common/buildcraft/core/Box.java b/common/buildcraft/core/Box.java index 04d82cf8..ae7b5074 100644 --- a/common/buildcraft/core/Box.java +++ b/common/buildcraft/core/Box.java @@ -17,6 +17,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.IAreaProvider; import buildcraft.api.core.IBox; import buildcraft.api.core.NetworkData; diff --git a/common/buildcraft/core/blueprints/BptBuilderBase.java b/common/buildcraft/core/blueprints/BptBuilderBase.java index 22454f4b..08cb4556 100644 --- a/common/buildcraft/core/blueprints/BptBuilderBase.java +++ b/common/buildcraft/core/blueprints/BptBuilderBase.java @@ -26,11 +26,11 @@ import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.blueprints.MappingNotFoundException; import buildcraft.api.blueprints.SchematicRegistry; import buildcraft.api.core.BCLog; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.IAreaProvider; import buildcraft.api.core.Position; import buildcraft.builders.BuildingItem; import buildcraft.builders.TileAbstractBuilder; -import buildcraft.core.BlockIndex; import buildcraft.core.Box; public abstract class BptBuilderBase implements IAreaProvider { diff --git a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java index 87d3ce62..6094b0cc 100644 --- a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java +++ b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java @@ -36,12 +36,12 @@ import buildcraft.api.blueprints.SchematicBlock; import buildcraft.api.blueprints.SchematicEntity; import buildcraft.api.blueprints.SchematicRegistry; import buildcraft.api.core.BCLog; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.BuildCraftAPI; import buildcraft.api.core.IInvSlot; import buildcraft.api.core.StackKey; import buildcraft.builders.TileAbstractBuilder; import buildcraft.builders.TileBuilder; -import buildcraft.core.BlockIndex; import buildcraft.core.blueprints.BuildingSlotBlock.Mode; import buildcraft.core.inventory.InventoryCopy; import buildcraft.core.inventory.InventoryIterator; diff --git a/common/buildcraft/core/blueprints/BptBuilderTemplate.java b/common/buildcraft/core/blueprints/BptBuilderTemplate.java index b9e047dc..33a04f4d 100644 --- a/common/buildcraft/core/blueprints/BptBuilderTemplate.java +++ b/common/buildcraft/core/blueprints/BptBuilderTemplate.java @@ -17,10 +17,10 @@ import net.minecraftforge.common.util.ForgeDirection; import buildcraft.api.blueprints.SchematicBlockBase; import buildcraft.api.blueprints.SchematicRegistry; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.BuildCraftAPI; import buildcraft.api.core.IInvSlot; import buildcraft.builders.TileAbstractBuilder; -import buildcraft.core.BlockIndex; import buildcraft.core.blueprints.BuildingSlotBlock.Mode; import buildcraft.core.inventory.InventoryIterator; import buildcraft.core.utils.BlockUtil; diff --git a/common/buildcraft/core/robots/AIRobotGoToDock.java b/common/buildcraft/core/robots/AIRobotGoToDock.java index 900e7f86..aeac4710 100755 --- a/common/buildcraft/core/robots/AIRobotGoToDock.java +++ b/common/buildcraft/core/robots/AIRobotGoToDock.java @@ -8,9 +8,8 @@ */ package buildcraft.core.robots; -import buildcraft.robots.AIRobot; -import buildcraft.robots.DockingStation; -import buildcraft.robots.EntityRobotBase; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; public class AIRobotGoToDock extends AIRobot { diff --git a/common/buildcraft/core/robots/AIRobotMain.java b/common/buildcraft/core/robots/AIRobotMain.java index 8705e872..976bd48a 100755 --- a/common/buildcraft/core/robots/AIRobotMain.java +++ b/common/buildcraft/core/robots/AIRobotMain.java @@ -9,8 +9,8 @@ package buildcraft.core.robots; import buildcraft.api.boards.RedstoneBoardRobot; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; public class AIRobotMain extends AIRobot { diff --git a/common/buildcraft/core/robots/AIRobotMove.java b/common/buildcraft/core/robots/AIRobotMove.java index 57f82e80..23b10c8d 100755 --- a/common/buildcraft/core/robots/AIRobotMove.java +++ b/common/buildcraft/core/robots/AIRobotMove.java @@ -8,8 +8,8 @@ */ package buildcraft.core.robots; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; public abstract class AIRobotMove extends AIRobot { diff --git a/common/buildcraft/core/robots/AIRobotMoveToBlock.java b/common/buildcraft/core/robots/AIRobotMoveToBlock.java index 38c658eb..a4d6c924 100755 --- a/common/buildcraft/core/robots/AIRobotMoveToBlock.java +++ b/common/buildcraft/core/robots/AIRobotMoveToBlock.java @@ -10,10 +10,10 @@ package buildcraft.core.robots; import java.util.LinkedList; -import buildcraft.core.BlockIndex; +import buildcraft.api.core.BlockIndex; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.utils.PathFinding; import buildcraft.core.utils.PathFindingJob; -import buildcraft.robots.EntityRobotBase; public class AIRobotMoveToBlock extends AIRobotMove { diff --git a/common/buildcraft/core/robots/AIRobotRecharge.java b/common/buildcraft/core/robots/AIRobotRecharge.java index b11e04de..67936083 100755 --- a/common/buildcraft/core/robots/AIRobotRecharge.java +++ b/common/buildcraft/core/robots/AIRobotRecharge.java @@ -8,11 +8,11 @@ */ package buildcraft.core.robots; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.DockingStationRegistry; +import buildcraft.api.robots.EntityRobotBase; +import buildcraft.api.robots.IDockingStation; import buildcraft.api.transport.IPipeTile.PipeType; -import buildcraft.robots.AIRobot; -import buildcraft.robots.DockingStation; -import buildcraft.robots.DockingStationRegistry; -import buildcraft.robots.EntityRobotBase; import buildcraft.transport.PipeTransportPower; public class AIRobotRecharge extends AIRobot { @@ -26,23 +26,26 @@ public class AIRobotRecharge extends AIRobot { @Override public void update() { if (robot.getCurrentDockingStation() == null - || robot.getCurrentDockingStation().pipe.getPipeType() != PipeType.POWER) { + || ((DockingStation) robot.getCurrentDockingStation()).pipe.getPipeType() != PipeType.POWER) { - for (DockingStation d : DockingStationRegistry.getStations()) { - if (d.reserved != null) { + for (IDockingStation d : DockingStationRegistry.getStations()) { + DockingStation station = (DockingStation) d; + + if (station.reserved != null) { continue; } - if (d.pipe.getPipeType() == PipeType.POWER) { - startDelegateAI(new AIRobotGoToDock(robot, d)); + if (station.pipe.getPipeType() == PipeType.POWER) { + startDelegateAI(new AIRobotGoToDock(robot, station)); break; } } } else { - PipeTransportPower powerProvider = (PipeTransportPower) robot.getCurrentDockingStation().pipe.pipe.transport; + PipeTransportPower powerProvider = (PipeTransportPower) ((DockingStation) robot.getCurrentDockingStation()).pipe.pipe.transport; - powerProvider.requestEnergy(robot.getCurrentDockingStation().side, 100); - robot.setEnergy(robot.getEnergy() + powerProvider.consumePower(robot.getCurrentDockingStation().side, 100)); + powerProvider.requestEnergy(robot.getCurrentDockingStation().side(), 100); + robot.setEnergy(robot.getEnergy() + + powerProvider.consumePower(robot.getCurrentDockingStation().side(), 100)); if (robot.getEnergy() >= EntityRobotBase.MAX_ENERGY) { terminate(); diff --git a/common/buildcraft/core/robots/AIRobotStraightMoveTo.java b/common/buildcraft/core/robots/AIRobotStraightMoveTo.java index 7c771a53..b446f3dc 100755 --- a/common/buildcraft/core/robots/AIRobotStraightMoveTo.java +++ b/common/buildcraft/core/robots/AIRobotStraightMoveTo.java @@ -8,7 +8,7 @@ */ package buildcraft.core.robots; -import buildcraft.robots.EntityRobotBase; +import buildcraft.api.robots.EntityRobotBase; public class AIRobotStraightMoveTo extends AIRobotMove { diff --git a/api/buildcraft/robots/DockingStation.java b/common/buildcraft/core/robots/DockingStation.java similarity index 59% rename from api/buildcraft/robots/DockingStation.java rename to common/buildcraft/core/robots/DockingStation.java index d940db70..2da6f8d7 100755 --- a/api/buildcraft/robots/DockingStation.java +++ b/common/buildcraft/core/robots/DockingStation.java @@ -6,13 +6,15 @@ * 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.robots; +package buildcraft.core.robots; import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.api.robots.EntityRobotBase; +import buildcraft.api.robots.IDockingStation; import buildcraft.transport.TileGenericPipe; -public class DockingStation { +public class DockingStation implements IDockingStation { public TileGenericPipe pipe; public ForgeDirection side; public EntityRobotBase reserved; @@ -21,5 +23,25 @@ public class DockingStation { pipe = iPipe; side = iSide; } + + @Override + public int x() { + return pipe.xCoord; + } + + @Override + public int y() { + return pipe.yCoord; + } + + @Override + public int z() { + return pipe.zCoord; + } + + @Override + public ForgeDirection side() { + return side; + } } diff --git a/common/buildcraft/core/robots/EntityRobot.java b/common/buildcraft/core/robots/EntityRobot.java index 2d0d7c28..546f0c98 100755 --- a/common/buildcraft/core/robots/EntityRobot.java +++ b/common/buildcraft/core/robots/EntityRobot.java @@ -30,15 +30,15 @@ import buildcraft.api.boards.RedstoneBoardRegistry; import buildcraft.api.boards.RedstoneBoardRobot; import buildcraft.api.boards.RedstoneBoardRobotNBT; import buildcraft.api.core.SafeTimeTracker; +import buildcraft.api.robots.DockingStationRegistry; +import buildcraft.api.robots.EntityRobotBase; +import buildcraft.api.robots.IDockingStation; import buildcraft.core.DefaultProps; import buildcraft.core.LaserData; import buildcraft.core.network.RPC; import buildcraft.core.network.RPCHandler; import buildcraft.core.network.RPCMessageInfo; import buildcraft.core.network.RPCSide; -import buildcraft.robots.DockingStation; -import buildcraft.robots.DockingStationRegistry; -import buildcraft.robots.EntityRobotBase; public class EntityRobot extends EntityRobotBase implements IEntityAdditionalSpawnData, IInventory { @@ -333,8 +333,11 @@ public class EntityRobot extends EntityRobotBase implements super.readEntityFromNBT(nbt); if (nbt.hasKey("dockX")) { - mainDockingStation = DockingStationRegistry.getStation(nbt.getInteger("dockX"), nbt.getInteger("dockY"), - nbt.getInteger("dockZ"), ForgeDirection.values()[nbt.getInteger("dockSide")]); + mainDockingStation = (DockingStation) DockingStationRegistry.getStation( + nbt.getInteger("dockX"), + nbt.getInteger("dockY"), + nbt.getInteger("dockZ"), + ForgeDirection.values()[nbt.getInteger("dockSide")]); } /* @@ -510,12 +513,12 @@ public class EntityRobot extends EntityRobotBase implements } @Override - public void setCurrentDockingStation(DockingStation station) { + public void setCurrentDockingStation(IDockingStation station) { if (currentDockingStation != null) { currentDockingStation.reserved = null; } - currentDockingStation = station; + currentDockingStation = (DockingStation) station; if (currentDockingStation != null) { currentDockingStation.reserved = this; diff --git a/common/buildcraft/core/robots/boards/AIRobotBreakWithTool.java b/common/buildcraft/core/robots/boards/AIRobotBreakWithTool.java index 8d72669e..802f05b3 100755 --- a/common/buildcraft/core/robots/boards/AIRobotBreakWithTool.java +++ b/common/buildcraft/core/robots/boards/AIRobotBreakWithTool.java @@ -15,11 +15,11 @@ import net.minecraft.world.WorldServer; import net.minecraftforge.common.ForgeHooks; -import buildcraft.core.BlockIndex; +import buildcraft.api.core.BlockIndex; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.proxy.CoreProxy; import buildcraft.core.utils.BlockUtil; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; public class AIRobotBreakWithTool extends AIRobot { diff --git a/common/buildcraft/core/robots/boards/AIRobotFetchItem.java b/common/buildcraft/core/robots/boards/AIRobotFetchItem.java index bce4cfa6..55c16dd7 100755 --- a/common/buildcraft/core/robots/boards/AIRobotFetchItem.java +++ b/common/buildcraft/core/robots/boards/AIRobotFetchItem.java @@ -13,11 +13,11 @@ import net.minecraft.entity.item.EntityItem; import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.inventory.TransactorSimple; import buildcraft.core.inventory.filters.IStackFilter; import buildcraft.core.robots.AIRobotMoveToBlock; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; public class AIRobotFetchItem extends AIRobot { diff --git a/common/buildcraft/core/robots/boards/AIRobotFetchItemStack.java b/common/buildcraft/core/robots/boards/AIRobotFetchItemStack.java index 63d24ae1..b8a7e392 100755 --- a/common/buildcraft/core/robots/boards/AIRobotFetchItemStack.java +++ b/common/buildcraft/core/robots/boards/AIRobotFetchItemStack.java @@ -14,18 +14,19 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.DockingStationRegistry; +import buildcraft.api.robots.EntityRobotBase; +import buildcraft.api.robots.IDockingStation; import buildcraft.core.inventory.ITransactor; import buildcraft.core.inventory.Transactor; import buildcraft.core.inventory.filters.IStackFilter; import buildcraft.core.robots.AIRobotGoToDock; -import buildcraft.robots.AIRobot; -import buildcraft.robots.DockingStation; -import buildcraft.robots.DockingStationRegistry; -import buildcraft.robots.EntityRobotBase; +import buildcraft.core.robots.DockingStation; public class AIRobotFetchItemStack extends AIRobot { - private DockingStation station = null; + private DockingStation stationToDock = null; private IStackFilter filter; public AIRobotFetchItemStack(EntityRobotBase iRobot, IStackFilter iFilter) { @@ -36,22 +37,24 @@ public class AIRobotFetchItemStack extends AIRobot { @Override public void update() { - for (DockingStation d : DockingStationRegistry.getStations()) { - if (d.reserved != null) { + for (IDockingStation d : DockingStationRegistry.getStations()) { + DockingStation station = (DockingStation) d; + + if (station.reserved != null) { continue; } for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - TileEntity nearbyTile = robot.worldObj.getTileEntity(d.pipe.xCoord + dir.offsetX, d.pipe.yCoord - + dir.offsetY, d.pipe.zCoord + TileEntity nearbyTile = robot.worldObj.getTileEntity(d.x() + dir.offsetX, d.y() + + dir.offsetY, d.z() + dir.offsetZ); if (nearbyTile != null && nearbyTile instanceof IInventory) { ITransactor trans = Transactor.getTransactorFor(nearbyTile); if (trans.remove(filter, dir.getOpposite(), false) != null) { - station = d; - startDelegateAI(new AIRobotGoToDock(robot, station)); + stationToDock = station; + startDelegateAI(new AIRobotGoToDock(robot, stationToDock)); return; } } @@ -64,9 +67,9 @@ public class AIRobotFetchItemStack extends AIRobot { ItemStack itemFound = null; for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - TileEntity nearbyTile = robot.worldObj.getTileEntity(station.pipe.xCoord + dir.offsetX, - station.pipe.yCoord - + dir.offsetY, station.pipe.zCoord + dir.offsetZ); + TileEntity nearbyTile = robot.worldObj.getTileEntity(stationToDock.pipe.xCoord + dir.offsetX, + stationToDock.pipe.yCoord + + dir.offsetY, stationToDock.pipe.zCoord + dir.offsetZ); if (nearbyTile != null && nearbyTile instanceof IInventory) { ITransactor trans = Transactor.getTransactorFor(nearbyTile); diff --git a/common/buildcraft/core/robots/boards/AIRobotGoToRandomDirt.java b/common/buildcraft/core/robots/boards/AIRobotGoToRandomDirt.java index b16d1d10..07370aaf 100755 --- a/common/buildcraft/core/robots/boards/AIRobotGoToRandomDirt.java +++ b/common/buildcraft/core/robots/boards/AIRobotGoToRandomDirt.java @@ -15,12 +15,12 @@ import net.minecraft.block.BlockAir; import net.minecraft.block.BlockDirt; import net.minecraft.block.BlockGrass; -import buildcraft.core.BlockIndex; +import buildcraft.api.core.BlockIndex; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.robots.AIRobotMoveToBlock; import buildcraft.core.utils.PathFinding; import buildcraft.core.utils.PathFindingJob; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; public class AIRobotGoToRandomDirt extends AIRobot { diff --git a/common/buildcraft/core/robots/boards/AIRobotPlantSaple.java b/common/buildcraft/core/robots/boards/AIRobotPlantSaple.java index 1c639ebc..96ab3187 100755 --- a/common/buildcraft/core/robots/boards/AIRobotPlantSaple.java +++ b/common/buildcraft/core/robots/boards/AIRobotPlantSaple.java @@ -11,10 +11,10 @@ package buildcraft.core.robots.boards; import net.minecraft.item.ItemStack; import net.minecraft.world.WorldServer; -import buildcraft.core.BlockIndex; +import buildcraft.api.core.BlockIndex; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.proxy.CoreProxy; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; public class AIRobotPlantSaple extends AIRobot { diff --git a/common/buildcraft/core/robots/boards/AIRobotSearchBlock.java b/common/buildcraft/core/robots/boards/AIRobotSearchBlock.java index cb1d3274..bc4dee80 100755 --- a/common/buildcraft/core/robots/boards/AIRobotSearchBlock.java +++ b/common/buildcraft/core/robots/boards/AIRobotSearchBlock.java @@ -10,13 +10,13 @@ package buildcraft.core.robots.boards; import java.util.LinkedList; -import buildcraft.core.BlockIndex; +import buildcraft.api.core.BlockIndex; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.robots.AIRobotMoveToBlock; import buildcraft.core.utils.IPathFound; import buildcraft.core.utils.PathFinding; import buildcraft.core.utils.PathFindingJob; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; public class AIRobotSearchBlock extends AIRobot { diff --git a/common/buildcraft/core/robots/boards/BoardRobotGenericBreakBlock.java b/common/buildcraft/core/robots/boards/BoardRobotGenericBreakBlock.java index b53b5b40..509a1042 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotGenericBreakBlock.java +++ b/common/buildcraft/core/robots/boards/BoardRobotGenericBreakBlock.java @@ -12,11 +12,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import buildcraft.api.boards.RedstoneBoardRobot; -import buildcraft.core.BlockIndex; +import buildcraft.api.core.BlockIndex; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.inventory.filters.IStackFilter; import buildcraft.core.utils.IPathFound; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; public abstract class BoardRobotGenericBreakBlock extends RedstoneBoardRobot { diff --git a/common/buildcraft/core/robots/boards/BoardRobotLeaveCutter.java b/common/buildcraft/core/robots/boards/BoardRobotLeaveCutter.java index 0535994c..2b9ab3a5 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotLeaveCutter.java +++ b/common/buildcraft/core/robots/boards/BoardRobotLeaveCutter.java @@ -14,7 +14,7 @@ import net.minecraft.world.World; import buildcraft.api.boards.RedstoneBoardRobotNBT; import buildcraft.api.core.BuildCraftAPI; -import buildcraft.robots.EntityRobotBase; +import buildcraft.api.robots.EntityRobotBase; public class BoardRobotLeaveCutter extends BoardRobotGenericBreakBlock { diff --git a/common/buildcraft/core/robots/boards/BoardRobotLeaveCutterNBT.java b/common/buildcraft/core/robots/boards/BoardRobotLeaveCutterNBT.java index 0901248c..d1617d51 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotLeaveCutterNBT.java +++ b/common/buildcraft/core/robots/boards/BoardRobotLeaveCutterNBT.java @@ -19,9 +19,9 @@ import net.minecraft.util.ResourceLocation; import buildcraft.api.boards.RedstoneBoardRobot; import buildcraft.api.boards.RedstoneBoardRobotNBT; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.DefaultProps; import buildcraft.core.utils.StringUtils; -import buildcraft.robots.EntityRobotBase; public final class BoardRobotLeaveCutterNBT extends RedstoneBoardRobotNBT { diff --git a/common/buildcraft/core/robots/boards/BoardRobotLumberjack.java b/common/buildcraft/core/robots/boards/BoardRobotLumberjack.java index 303efafc..89f44274 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotLumberjack.java +++ b/common/buildcraft/core/robots/boards/BoardRobotLumberjack.java @@ -15,7 +15,7 @@ import net.minecraft.world.World; import buildcraft.api.boards.RedstoneBoardRobotNBT; import buildcraft.api.core.BuildCraftAPI; -import buildcraft.robots.EntityRobotBase; +import buildcraft.api.robots.EntityRobotBase; public class BoardRobotLumberjack extends BoardRobotGenericBreakBlock { diff --git a/common/buildcraft/core/robots/boards/BoardRobotLumberjackNBT.java b/common/buildcraft/core/robots/boards/BoardRobotLumberjackNBT.java index 31832b47..a1a76532 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotLumberjackNBT.java +++ b/common/buildcraft/core/robots/boards/BoardRobotLumberjackNBT.java @@ -19,10 +19,10 @@ import net.minecraft.util.ResourceLocation; import buildcraft.api.boards.RedstoneBoardRobot; import buildcraft.api.boards.RedstoneBoardRobotNBT; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.DefaultProps; import buildcraft.core.utils.NBTUtils; import buildcraft.core.utils.StringUtils; -import buildcraft.robots.EntityRobotBase; public final class BoardRobotLumberjackNBT extends RedstoneBoardRobotNBT { diff --git a/common/buildcraft/core/robots/boards/BoardRobotPicker.java b/common/buildcraft/core/robots/boards/BoardRobotPicker.java index 0f914da1..37290a61 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotPicker.java +++ b/common/buildcraft/core/robots/boards/BoardRobotPicker.java @@ -21,12 +21,12 @@ import buildcraft.api.boards.RedstoneBoardRegistry; import buildcraft.api.boards.RedstoneBoardRobot; import buildcraft.api.boards.RedstoneBoardRobotNBT; import buildcraft.api.core.SafeTimeTracker; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.inventory.filters.ArrayStackFilter; import buildcraft.core.inventory.filters.IStackFilter; import buildcraft.core.robots.AIRobotGoToDock; -import buildcraft.robots.AIRobot; -import buildcraft.robots.DockingStation; -import buildcraft.robots.EntityRobotBase; +import buildcraft.core.robots.DockingStation; import buildcraft.transport.PipeTransportItems; import buildcraft.transport.TileGenericPipe; import buildcraft.transport.TravelingItem; @@ -81,7 +81,7 @@ public class BoardRobotPicker extends RedstoneBoardRobot { startDelegateAI(new AIRobotFetchItem(robot, range, stackFilter)); } else { // otherwise, let's return to base - startDelegateAI(new AIRobotGoToDock(robot, robot.getMainDockingStation())); + startDelegateAI(new AIRobotGoToDock(robot, (DockingStation) robot.getMainDockingStation())); } } else if (ai instanceof AIRobotGoToDock) { emptyContainerInStation(); @@ -89,7 +89,7 @@ public class BoardRobotPicker extends RedstoneBoardRobot { } private void emptyContainerInStation() { - DockingStation station = robot.getCurrentDockingStation(); + DockingStation station = (DockingStation) robot.getCurrentDockingStation(); TileGenericPipe pipe = (TileGenericPipe) robot.worldObj .getTileEntity(station.pipe.xCoord, station.pipe.yCoord, station.pipe.zCoord); diff --git a/common/buildcraft/core/robots/boards/BoardRobotPickerNBT.java b/common/buildcraft/core/robots/boards/BoardRobotPickerNBT.java index b8b2c9d6..fdc2ee22 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotPickerNBT.java +++ b/common/buildcraft/core/robots/boards/BoardRobotPickerNBT.java @@ -21,10 +21,10 @@ import buildcraft.api.boards.IBoardParameter; import buildcraft.api.boards.RedstoneBoardRegistry; import buildcraft.api.boards.RedstoneBoardRobot; import buildcraft.api.boards.RedstoneBoardRobotNBT; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.robots.EntityRobot; import buildcraft.core.utils.NBTUtils; import buildcraft.core.utils.StringUtils; -import buildcraft.robots.EntityRobotBase; public final class BoardRobotPickerNBT extends RedstoneBoardRobotNBT { diff --git a/common/buildcraft/core/robots/boards/BoardRobotPlanter.java b/common/buildcraft/core/robots/boards/BoardRobotPlanter.java index 842fd763..544dd324 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotPlanter.java +++ b/common/buildcraft/core/robots/boards/BoardRobotPlanter.java @@ -10,9 +10,9 @@ package buildcraft.core.robots.boards; import buildcraft.api.boards.RedstoneBoardRobot; import buildcraft.api.boards.RedstoneBoardRobotNBT; +import buildcraft.api.robots.AIRobot; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.inventory.filters.OreStackFilter; -import buildcraft.robots.AIRobot; -import buildcraft.robots.EntityRobotBase; public class BoardRobotPlanter extends RedstoneBoardRobot { diff --git a/common/buildcraft/core/robots/boards/BoardRobotPlanterNBT.java b/common/buildcraft/core/robots/boards/BoardRobotPlanterNBT.java index f226a077..ab8bd6ea 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotPlanterNBT.java +++ b/common/buildcraft/core/robots/boards/BoardRobotPlanterNBT.java @@ -19,9 +19,9 @@ import net.minecraft.util.ResourceLocation; import buildcraft.api.boards.RedstoneBoardRobot; import buildcraft.api.boards.RedstoneBoardRobotNBT; +import buildcraft.api.robots.EntityRobotBase; import buildcraft.core.DefaultProps; import buildcraft.core.utils.StringUtils; -import buildcraft.robots.EntityRobotBase; public final class BoardRobotPlanterNBT extends RedstoneBoardRobotNBT { diff --git a/common/buildcraft/core/utils/PathFinding.java b/common/buildcraft/core/utils/PathFinding.java index 3227dddc..9b7d457b 100755 --- a/common/buildcraft/core/utils/PathFinding.java +++ b/common/buildcraft/core/utils/PathFinding.java @@ -15,8 +15,8 @@ import java.util.LinkedList; import net.minecraft.world.World; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.BuildCraftAPI; -import buildcraft.core.BlockIndex; /** * This class implements a 3D path finding based on the A* algorithm, following diff --git a/common/buildcraft/core/utils/Utils.java b/common/buildcraft/core/utils/Utils.java index 4fd65c4a..58d5978b 100644 --- a/common/buildcraft/core/utils/Utils.java +++ b/common/buildcraft/core/utils/Utils.java @@ -35,11 +35,11 @@ import cpw.mods.fml.common.network.internal.FMLProxyPacket; import net.minecraftforge.common.util.ForgeDirection; import buildcraft.BuildCraftCore; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.IAreaProvider; import buildcraft.api.core.Position; import buildcraft.api.transport.IPipeTile; import buildcraft.api.transport.IPipeTile.PipeType; -import buildcraft.core.BlockIndex; import buildcraft.core.DefaultProps; import buildcraft.core.EntityBlock; import buildcraft.core.IDropControlInventory; diff --git a/common/buildcraft/core/utils/WorldProperty.java b/common/buildcraft/core/utils/WorldProperty.java index 6ef4a6ef..34523b33 100755 --- a/common/buildcraft/core/utils/WorldProperty.java +++ b/common/buildcraft/core/utils/WorldProperty.java @@ -14,11 +14,13 @@ import net.minecraft.block.Block; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import buildcraft.api.core.IWorldProperty; -public abstract class WorldProperty { +public abstract class WorldProperty implements IWorldProperty { public ArrayList properties = new ArrayList(); + @Override public synchronized boolean get(World world, int x, int y, int z) { return getDimension(world).get(x, y, z); } @@ -44,6 +46,7 @@ public abstract class WorldProperty { return result; } + @Override public void clear() { for (DimensionProperty p : properties) { p.clear(); diff --git a/common/buildcraft/energy/TileEnergyEmitter.java b/common/buildcraft/energy/TileEnergyEmitter.java index 4dfc5645..ae16d2ce 100755 --- a/common/buildcraft/energy/TileEnergyEmitter.java +++ b/common/buildcraft/energy/TileEnergyEmitter.java @@ -14,9 +14,9 @@ import java.util.TreeMap; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.SafeTimeTracker; import buildcraft.api.mj.MjBattery; -import buildcraft.core.BlockIndex; import buildcraft.core.LaserData; import buildcraft.core.TileBuildCraft; import buildcraft.core.network.RPC; diff --git a/common/buildcraft/factory/TileFloodGate.java b/common/buildcraft/factory/TileFloodGate.java index 28b2eb95..59b64832 100644 --- a/common/buildcraft/factory/TileFloodGate.java +++ b/common/buildcraft/factory/TileFloodGate.java @@ -26,8 +26,8 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.BuildCraftAPI; -import buildcraft.core.BlockIndex; import buildcraft.core.TileBuildCraft; import buildcraft.core.fluids.FluidUtils; import buildcraft.core.fluids.Tank; diff --git a/common/buildcraft/factory/TilePump.java b/common/buildcraft/factory/TilePump.java index f0139d86..bf65a78c 100644 --- a/common/buildcraft/factory/TilePump.java +++ b/common/buildcraft/factory/TilePump.java @@ -32,10 +32,10 @@ import net.minecraftforge.fluids.IFluidHandler; import buildcraft.BuildCraftCore; import buildcraft.BuildCraftFactory; +import buildcraft.api.core.BlockIndex; import buildcraft.api.core.SafeTimeTracker; import buildcraft.api.gates.IAction; import buildcraft.api.mj.MjBattery; -import buildcraft.core.BlockIndex; import buildcraft.core.CoreConstants; import buildcraft.core.EntityBlock; import buildcraft.core.IMachine; diff --git a/common/buildcraft/transport/BlockGenericPipe.java b/common/buildcraft/transport/BlockGenericPipe.java index 7ed14b45..cb4f13ba 100644 --- a/common/buildcraft/transport/BlockGenericPipe.java +++ b/common/buildcraft/transport/BlockGenericPipe.java @@ -45,20 +45,21 @@ import net.minecraftforge.common.util.ForgeDirection; import buildcraft.BuildCraftTransport; import buildcraft.api.core.BCLog; +import buildcraft.api.core.BlockIndex; import buildcraft.api.gates.GateExpansions; import buildcraft.api.gates.IGateExpansion; +import buildcraft.api.robots.DockingStationRegistry; import buildcraft.api.tools.IToolWrench; import buildcraft.api.transport.PipeWire; import buildcraft.core.BlockBuildCraft; -import buildcraft.core.BlockIndex; import buildcraft.core.CoreConstants; import buildcraft.core.CreativeTabBuildCraft; import buildcraft.core.ItemRobot; import buildcraft.core.TileBuffer; +import buildcraft.core.robots.DockingStation; import buildcraft.core.robots.EntityRobot; import buildcraft.core.utils.MatrixTranformations; import buildcraft.core.utils.Utils; -import buildcraft.robots.DockingStationRegistry; import buildcraft.transport.gates.GateDefinition; import buildcraft.transport.gates.GateFactory; import buildcraft.transport.gates.ItemGate; @@ -796,7 +797,8 @@ public class BlockGenericPipe extends BlockBuildCraft { float pz = z + 0.5F + rayTraceResult.sideHit.offsetZ * 0.5F; robot.setPosition(px, py, pz); - robot.setMainDockingStation(DockingStationRegistry.getStation(x, y, z, rayTraceResult.sideHit)); + robot.setMainDockingStation((DockingStation) DockingStationRegistry.getStation(x, y, z, + rayTraceResult.sideHit)); robot.setCurrentDockingStation(robot.getMainDockingStation()); world.spawnEntityInWorld(robot); diff --git a/common/buildcraft/transport/TileGenericPipe.java b/common/buildcraft/transport/TileGenericPipe.java index 61b676d6..846ed374 100644 --- a/common/buildcraft/transport/TileGenericPipe.java +++ b/common/buildcraft/transport/TileGenericPipe.java @@ -51,6 +51,7 @@ import buildcraft.api.mj.MjBattery; import buildcraft.api.power.IPowerReceptor; import buildcraft.api.power.PowerHandler; import buildcraft.api.power.PowerHandler.PowerReceiver; +import buildcraft.api.robots.DockingStationRegistry; import buildcraft.api.transport.IPipeConnection; import buildcraft.api.transport.IPipeTile; import buildcraft.api.transport.PipeWire; @@ -64,9 +65,8 @@ import buildcraft.core.network.IClientState; import buildcraft.core.network.IGuiReturnHandler; import buildcraft.core.network.ISyncedTile; import buildcraft.core.network.PacketTileState; +import buildcraft.core.robots.DockingStation; import buildcraft.core.utils.Utils; -import buildcraft.robots.DockingStation; -import buildcraft.robots.DockingStationRegistry; import buildcraft.transport.gates.GateDefinition; import buildcraft.transport.gates.GateFactory; diff --git a/tests/buildcraft/tests/TileTestPathfinding.java b/tests/buildcraft/tests/TileTestPathfinding.java index a7ccca14..79c1218d 100755 --- a/tests/buildcraft/tests/TileTestPathfinding.java +++ b/tests/buildcraft/tests/TileTestPathfinding.java @@ -5,7 +5,7 @@ import java.util.LinkedList; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; -import buildcraft.core.BlockIndex; +import buildcraft.api.core.BlockIndex; import buildcraft.core.utils.PathFinding; public class TileTestPathfinding extends TileEntity {