diff --git a/api/buildcraft/api/robots/AIRobot.java b/api/buildcraft/api/robots/AIRobot.java index ce0fc099..c53b16ca 100755 --- a/api/buildcraft/api/robots/AIRobot.java +++ b/api/buildcraft/api/robots/AIRobot.java @@ -113,7 +113,7 @@ public class AIRobot { if (delegateAI != null) { delegateAI.cycle(); } else { - robot.getBattery().useEnergy(0, getEnergyCost(), false); + robot.getBattery().extractEnergy(getEnergyCost(), false); update(); } } catch (Throwable e) { diff --git a/api/buildcraft/api/robots/EntityRobotBase.java b/api/buildcraft/api/robots/EntityRobotBase.java index c3e9f902..706383cd 100755 --- a/api/buildcraft/api/robots/EntityRobotBase.java +++ b/api/buildcraft/api/robots/EntityRobotBase.java @@ -8,6 +8,7 @@ */ package buildcraft.api.robots; +import cofh.api.energy.IEnergyStorage; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.inventory.IInventory; @@ -16,7 +17,6 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.IFluidHandler; import buildcraft.api.boards.RedstoneBoardRobot; import buildcraft.api.core.IZone; -import buildcraft.core.RFBattery; public abstract class EntityRobotBase extends EntityLiving implements IInventory, IFluidHandler { @@ -42,7 +42,7 @@ public abstract class EntityRobotBase extends EntityLiving implements IInventory public abstract int getEnergy(); - public abstract RFBattery getBattery(); + public abstract IEnergyStorage getBattery(); public abstract IDockingStation getDockingStation(); diff --git a/common/buildcraft/core/robots/AIRobotRecharge.java b/common/buildcraft/core/robots/AIRobotRecharge.java index 2cbeb398..85daa8aa 100755 --- a/common/buildcraft/core/robots/AIRobotRecharge.java +++ b/common/buildcraft/core/robots/AIRobotRecharge.java @@ -37,11 +37,11 @@ public class AIRobotRecharge extends AIRobot { public void update() { PipeTransportPower powerProvider = (PipeTransportPower) ((DockingStation) robot.getDockingStation()).getPipe().pipe.transport; - int amount = robot.getBattery().addEnergy(0, 1000, true); + int amount = robot.getBattery().receiveEnergy(1000, false); powerProvider.requestEnergy(robot.getDockingStation().side(), amount); - robot.getBattery().addEnergy(0, powerProvider.consumePower(robot.getDockingStation().side(), amount), false); + robot.getBattery().receiveEnergy(powerProvider.consumePower(robot.getDockingStation().side(), amount), false); if (robot.getEnergy() >= EntityRobotBase.MAX_ENERGY) { terminate(); diff --git a/common/buildcraft/core/robots/boards/BoardRobotBuilder.java b/common/buildcraft/core/robots/boards/BoardRobotBuilder.java index 5d920ca7..de663264 100755 --- a/common/buildcraft/core/robots/boards/BoardRobotBuilder.java +++ b/common/buildcraft/core/robots/boards/BoardRobotBuilder.java @@ -143,7 +143,7 @@ public class BoardRobotBuilder extends RedstoneBoardRobot { return; } - robot.getBattery().useEnergy(0, currentBuildingSlot.getEnergyRequirement(), false); + robot.getBattery().extractEnergy(currentBuildingSlot.getEnergyRequirement(), false); launchingDelay = currentBuildingSlot.getStacksToDisplay().size() * BuildingItem.ITEMS_SPACE; markerToBuild.bluePrintBuilder.buildSlot (robot.worldObj, markerToBuild, currentBuildingSlot,