fixed API builds

This commit is contained in:
SpaceToad 2014-06-13 13:36:02 +02:00
parent 98f7196d0f
commit b1076d8556
52 changed files with 198 additions and 119 deletions

View file

@ -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<EntityRobotBase> {

View file

@ -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<EntityRobotBase> {

View file

@ -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;

View file

@ -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<Block> softBlocks = new HashSet<Block>();
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

View file

@ -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();
}

View file

@ -1,5 +1,5 @@
package buildcraft.robots;
package buildcraft.api.robots;
public class AIRobot {
public EntityRobotBase robot;

View file

@ -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<StationIndex, DockingStation> stations = new HashMap<StationIndex, DockingStation>();
private static HashMap<StationIndex, IDockingStation> stations = new HashMap<StationIndex, IDockingStation>();
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<DockingStation> getStations() {
public static Collection<IDockingStation> 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() {

View file

@ -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();

View file

@ -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();
}

View file

@ -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 {

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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<BlockIndex> {
Box box = new Box ();

View file

@ -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;

View file

@ -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;

View file

@ -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 {

View file

@ -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;

View file

@ -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;

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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();

View file

@ -8,7 +8,7 @@
*/
package buildcraft.core.robots;
import buildcraft.robots.EntityRobotBase;
import buildcraft.api.robots.EntityRobotBase;
public class AIRobotStraightMoveTo extends AIRobotMove {

View file

@ -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;
}
}

View file

@ -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;

View file

@ -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 {

View file

@ -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 {

View file

@ -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);

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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);

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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

View file

@ -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;

View file

@ -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<DimensionProperty> properties = new ArrayList<DimensionProperty>();
@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();

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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 {