diff --git a/common/buildcraft/api/power/ILaserTarget.java b/common/buildcraft/api/power/ILaserTarget.java index 3d1eca59..b4808004 100644 --- a/common/buildcraft/api/power/ILaserTarget.java +++ b/common/buildcraft/api/power/ILaserTarget.java @@ -28,7 +28,7 @@ public interface ILaserTarget { * * @param energy */ - void receiveLaserEnergy(float energy); + void receiveLaserEnergy(double energy); /** * Return true if the Tile Entity object is no longer a valid target. For diff --git a/common/buildcraft/api/power/PowerHandler.java b/common/buildcraft/api/power/PowerHandler.java index 5f405546..6aab1e7b 100644 --- a/common/buildcraft/api/power/PowerHandler.java +++ b/common/buildcraft/api/power/PowerHandler.java @@ -65,7 +65,7 @@ public final class PowerHandler { public static final float DEFAULT_POWERLOSS = 1F; public static final float MIN_POWERLOSS = 0.01F; - private final float powerLoss; + private final double powerLoss; public PerditionCalculator() { powerLoss = DEFAULT_POWERLOSS; @@ -76,7 +76,7 @@ public final class PowerHandler { * * @param powerLoss power loss per tick */ - public PerditionCalculator(float powerLoss) { + public PerditionCalculator(double powerLoss) { if (powerLoss < MIN_POWERLOSS) { powerLoss = MIN_POWERLOSS; } @@ -93,7 +93,7 @@ public final class PowerHandler { * @param ticksPassed ticks since the last time this function was called * @return */ - public float applyPerdition(PowerHandler powerHandler, float current, long ticksPassed) { + public double applyPerdition(PowerHandler powerHandler, double current, long ticksPassed) { // float prev = current; current -= powerLoss * ticksPassed; if (current < 0) { @@ -110,16 +110,16 @@ public final class PowerHandler { * * @return percent of input to tax */ - public float getTaxPercent() { + public double getTaxPercent() { return 0; } } public static final PerditionCalculator DEFAULT_PERDITION = new PerditionCalculator(); - private float minEnergyReceived; - private float maxEnergyReceived; - private float maxEnergyStored; - private float activationEnergy; - private float energyStored = 0; + private double minEnergyReceived; + private double maxEnergyReceived; + private double maxEnergyStored; + private double activationEnergy; + private double energyStored = 0; private final SafeTimeTracker doWorkTracker = new SafeTimeTracker(); private final SafeTimeTracker sourcesTracker = new SafeTimeTracker(); private final SafeTimeTracker perditionTracker = new SafeTimeTracker(); @@ -145,23 +145,23 @@ public final class PowerHandler { return receiver; } - public float getMinEnergyReceived() { + public double getMinEnergyReceived() { return minEnergyReceived; } - public float getMaxEnergyReceived() { + public double getMaxEnergyReceived() { return maxEnergyReceived; } - public float getMaxEnergyStored() { + public double getMaxEnergyStored() { return maxEnergyStored; } - public float getActivationEnergy() { + public double getActivationEnergy() { return activationEnergy; } - public float getEnergyStored() { + public double getEnergyStored() { return energyStored; } @@ -183,7 +183,7 @@ public final class PowerHandler { * store. Values tend to range between 100 and 5000. With 1000 and 1500 * being common. */ - public void configure(float minEnergyReceived, float maxEnergyReceived, float activationEnergy, float maxStoredEnergy) { + public void configure(double minEnergyReceived, double maxEnergyReceived, double activationEnergy, double maxStoredEnergy) { if (minEnergyReceived > maxEnergyReceived) { maxEnergyReceived = minEnergyReceived; } @@ -256,7 +256,7 @@ public final class PowerHandler { private void applyPerdition() { if (perditionTracker.markTimeIfDelay(receptor.getWorld(), 1) && energyStored > 0) { - float newEnergy = getPerdition().applyPerdition(this, energyStored, perditionTracker.durationOfLastDelay()); + double newEnergy = getPerdition().applyPerdition(this, energyStored, perditionTracker.durationOfLastDelay()); if (newEnergy == 0 || newEnergy < energyStored) energyStored = newEnergy; else @@ -296,10 +296,10 @@ public final class PowerHandler { * @param doUse * @return amount used */ - public float useEnergy(float min, float max, boolean doUse) { + public double useEnergy(double min, double max, boolean doUse) { applyPerdition(); - float result = 0; + double result = 0; if (energyStored >= min) { if (energyStored <= max) { @@ -329,7 +329,7 @@ public final class PowerHandler { public void readFromNBT(NBTTagCompound data, String tag) { NBTTagCompound nbt = data.getCompoundTag(tag); - energyStored = nbt.getFloat("storedEnergy"); + energyStored = nbt.getDouble("energyStored"); } public void writeToNBT(NBTTagCompound data) { @@ -338,7 +338,7 @@ public final class PowerHandler { public void writeToNBT(NBTTagCompound data, String tag) { NBTTagCompound nbt = new NBTTagCompound(); - nbt.setFloat("storedEnergy", energyStored); + nbt.setDouble("energyStored", energyStored); data.setCompoundTag(tag, nbt); } @@ -347,23 +347,23 @@ public final class PowerHandler { private PowerReceiver() { } - public float getMinEnergyReceived() { + public double getMinEnergyReceived() { return minEnergyReceived; } - public float getMaxEnergyReceived() { + public double getMaxEnergyReceived() { return maxEnergyReceived; } - public float getMaxEnergyStored() { + public double getMaxEnergyStored() { return maxEnergyStored; } - public float getActivationEnergy() { + public double getActivationEnergy() { return activationEnergy; } - public float getEnergyStored() { + public double getEnergyStored() { return energyStored; } @@ -380,7 +380,7 @@ public final class PowerHandler { * * @return */ - public float powerRequest() { + public double powerRequest() { update(); return Math.min(maxEnergyReceived, maxEnergyStored - energyStored); } @@ -394,8 +394,8 @@ public final class PowerHandler { * @param from * @return the amount of power used */ - public float receiveEnergy(Type source, final float quantity, ForgeDirection from) { - float used = quantity; + public double receiveEnergy(Type source, final double quantity, ForgeDirection from) { + double used = quantity; if (source == Type.ENGINE) { if (used < minEnergyReceived) { return 0; @@ -426,7 +426,7 @@ public final class PowerHandler { * * @return the amount the power changed by */ - public float addEnergy(float quantity) { + public double addEnergy(double quantity) { energyStored += quantity; if (energyStored > maxEnergyStored) { @@ -442,7 +442,7 @@ public final class PowerHandler { return quantity; } - public void setEnergy(float quantity) { + public void setEnergy(double quantity) { this.energyStored = quantity; validateEnergy(); } diff --git a/common/buildcraft/core/EntityEnergyLaser.java b/common/buildcraft/core/EntityEnergyLaser.java index 4248ddc2..eb324c93 100644 --- a/common/buildcraft/core/EntityEnergyLaser.java +++ b/common/buildcraft/core/EntityEnergyLaser.java @@ -16,9 +16,9 @@ public class EntityEnergyLaser extends EntityLaser { public static final short POWER_AVERAGING = 100; public int displayStage = 0; - private final float power[] = new float[POWER_AVERAGING]; + private final double power[] = new double[POWER_AVERAGING]; private int powerIndex = 0; - private float powerAverage = 0; + private double powerAverage = 0; public EntityEnergyLaser(World world) { super(world); @@ -28,7 +28,7 @@ public class EntityEnergyLaser extends EntityLaser { super(world, head, tail); } - public void pushPower(float received) { + public void pushPower(double received) { powerAverage -= power[powerIndex]; powerAverage += received; @@ -40,7 +40,7 @@ public class EntityEnergyLaser extends EntityLaser { } } - public float getPowerAverage() { + public double getPowerAverage() { return powerAverage / POWER_AVERAGING; } diff --git a/common/buildcraft/energy/TileEngine.java b/common/buildcraft/energy/TileEngine.java index 8ac75275..bfc8804f 100644 --- a/common/buildcraft/energy/TileEngine.java +++ b/common/buildcraft/energy/TileEngine.java @@ -11,9 +11,7 @@ import java.util.LinkedList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; -import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagFloat; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.ForgeDirection; @@ -52,12 +50,12 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto protected int progressPart = 0; protected boolean lastPower = false; protected PowerHandler powerHandler; - public float currentOutput = 0; + public double currentOutput = 0; public boolean isRedstonePowered = false; private boolean checkOrienation = false; private TileBuffer[] tileCache; public float progress; - public float energy; + public double energy; public float heat = MIN_HEAT; // public @TileNetworkData @@ -86,7 +84,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto return false; } - public float getEnergyLevel() { + public double getEnergyLevel() { return energy / getMaxEnergy(); } @@ -120,7 +118,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto } public void updateHeatLevel() { - heat = ((MAX_HEAT - MIN_HEAT) * getEnergyLevel()) + MIN_HEAT; + heat = (float) ((MAX_HEAT - MIN_HEAT) * getEnergyLevel()) + MIN_HEAT; } public float getHeatLevel() { @@ -216,7 +214,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto burn(); } - private float getPowerToExtract() { + private double getPowerToExtract() { TileEntity tile = getTileBuffer(orientation).getTile(); PowerReceiver receptor = ((IPowerReceptor) tile).getPowerReceiver(orientation.getOpposite()); return extractEnergy(receptor.getMinEnergyReceived(), receptor.getMaxEnergyReceived(), false); // Comment out for constant power @@ -228,9 +226,9 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto if (isPoweredTile(tile, orientation)) { PowerReceiver receptor = ((IPowerReceptor) tile).getPowerReceiver(orientation.getOpposite()); - float extracted = getPowerToExtract(); + double extracted = getPowerToExtract(); if (extracted > 0) { - float needed = receptor.receiveEnergy(PowerHandler.Type.ENGINE, extracted, orientation.getOpposite()); + double needed = receptor.receiveEnergy(PowerHandler.Type.ENGINE, extracted, orientation.getOpposite()); extractEnergy(receptor.getMinEnergyReceived(), needed, true); // Comment out for constant power // currentOutput = extractEnergy(0, needed, true); // Uncomment for constant power } @@ -318,10 +316,8 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto super.readFromNBT(data); orientation = ForgeDirection.getOrientation(data.getInteger("orientation")); progress = data.getFloat("progress"); - energy = data.getFloat("energyF"); - NBTBase tag = data.getTag("heat"); - if (tag instanceof NBTTagFloat) - heat = data.getFloat("heat"); + energy = data.getDouble("energy"); + heat = data.getFloat("heat"); } @Override @@ -329,19 +325,19 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto super.writeToNBT(data); data.setInteger("orientation", orientation.ordinal()); data.setFloat("progress", progress); - data.setFloat("energyF", energy); + data.setDouble("energy", energy); data.setFloat("heat", heat); } public void getGUINetworkData(int id, int value) { switch (id) { case 0: - int iEnergy = Math.round(energy * 10); + int iEnergy = (int) Math.round(energy * 10); iEnergy = (iEnergy & 0xffff0000) | (value & 0xffff); energy = iEnergy / 10; break; case 1: - iEnergy = Math.round(energy * 10); + iEnergy = (int) Math.round(energy * 10); iEnergy = (iEnergy & 0xffff) | ((value & 0xffff) << 16); energy = iEnergy / 10; break; @@ -355,9 +351,9 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto } public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) { - iCrafting.sendProgressBarUpdate(containerEngine, 0, Math.round(energy * 10) & 0xffff); - iCrafting.sendProgressBarUpdate(containerEngine, 1, (Math.round(energy * 10) & 0xffff0000) >> 16); - iCrafting.sendProgressBarUpdate(containerEngine, 2, Math.round(currentOutput * 10)); + iCrafting.sendProgressBarUpdate(containerEngine, 0, (int) Math.round(energy * 10) & 0xffff); + iCrafting.sendProgressBarUpdate(containerEngine, 1, (int) (Math.round(energy * 10) & 0xffff0000) >> 16); + iCrafting.sendProgressBarUpdate(containerEngine, 2, (int) Math.round(currentOutput * 10)); iCrafting.sendProgressBarUpdate(containerEngine, 3, Math.round(heat * 100)); } @@ -379,7 +375,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto addEnergy(powerHandler.useEnergy(1, maxEnergyReceived(), true) * 0.95F); } - public void addEnergy(float addition) { + public void addEnergy(double addition) { energy += addition; if (getEnergyStage() == EnergyStage.OVERHEAT) { @@ -391,11 +387,11 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto energy = getMaxEnergy(); } - public float extractEnergy(float min, float max, boolean doExtract) { + public double extractEnergy(double min, double max, boolean doExtract) { if (energy < min) return 0; - float actualMax; + double actualMax; if (max > maxEnergyExtracted()) actualMax = maxEnergyExtracted(); @@ -405,7 +401,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto if (actualMax < min) return 0; - float extracted; + double extracted; if (energy >= actualMax) { extracted = actualMax; @@ -427,23 +423,23 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto return false; } - public abstract float getMaxEnergy(); + public abstract double getMaxEnergy(); - public float minEnergyReceived() { + public double minEnergyReceived() { return 2; } - public abstract float maxEnergyReceived(); + public abstract double maxEnergyReceived(); - public abstract float maxEnergyExtracted(); + public abstract double maxEnergyExtracted(); public abstract float explosionRange(); - public float getEnergyStored() { + public double getEnergyStored() { return energy; } - public abstract float getCurrentOutput(); + public abstract double getCurrentOutput(); @Override public LinkedList getTriggers() { diff --git a/common/buildcraft/energy/TileEngineIron.java b/common/buildcraft/energy/TileEngineIron.java index 276792d4..67656185 100644 --- a/common/buildcraft/energy/TileEngineIron.java +++ b/common/buildcraft/energy/TileEngineIron.java @@ -396,22 +396,22 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan } @Override - public float maxEnergyReceived() { + public double maxEnergyReceived() { return 2000; } @Override - public float maxEnergyExtracted() { + public double maxEnergyExtracted() { return 500; } @Override - public float getMaxEnergy() { + public double getMaxEnergy() { return 10000; } @Override - public float getCurrentOutput() { + public double getCurrentOutput() { if (currentFuel == null) { return 0; } diff --git a/common/buildcraft/energy/TileEngineLegacy.java b/common/buildcraft/energy/TileEngineLegacy.java index 10364828..0313800b 100644 --- a/common/buildcraft/energy/TileEngineLegacy.java +++ b/common/buildcraft/energy/TileEngineLegacy.java @@ -47,12 +47,12 @@ public class TileEngineLegacy extends TileEngine { } @Override - public float getMaxEnergy() { + public double getMaxEnergy() { return 1; } @Override - public float maxEnergyReceived() { + public double maxEnergyReceived() { return 0; } @@ -72,12 +72,12 @@ public class TileEngineLegacy extends TileEngine { } @Override - public float getCurrentOutput() { + public double getCurrentOutput() { return 1; } @Override - public float maxEnergyExtracted() { + public double maxEnergyExtracted() { return 1; } } diff --git a/common/buildcraft/energy/TileEngineStone.java b/common/buildcraft/energy/TileEngineStone.java index 38ef563e..21988f4f 100644 --- a/common/buildcraft/energy/TileEngineStone.java +++ b/common/buildcraft/energy/TileEngineStone.java @@ -22,7 +22,7 @@ import buildcraft.api.gates.ITrigger; import buildcraft.core.GuiIds; import buildcraft.core.inventory.InvUtils; import buildcraft.core.proxy.CoreProxy; -import buildcraft.core.utils.Utils; +import buildcraft.core.utils.MathUtils; import buildcraft.energy.gui.ContainerEngine; public class TileEngineStone extends TileEngineWithInventory { @@ -32,10 +32,10 @@ public class TileEngineStone extends TileEngineWithInventory { final float TARGET_OUTPUT = 0.375f; final float kp = 1f; final float ki = 0.05f; - final float eLimit = (MAX_OUTPUT - MIN_OUTPUT) / ki; + final double eLimit = (MAX_OUTPUT - MIN_OUTPUT) / ki; int burnTime = 0; int totalBurnTime = 0; - float esum = 0; + double esum = 0; public TileEngineStone() { super(1); @@ -69,7 +69,7 @@ public class TileEngineStone extends TileEngineWithInventory { if (burnTime > 0) { burnTime--; - float output = getCurrentOutput(); + double output = getCurrentOutput(); currentOutput = output; // Comment out for constant power addEnergy(output); } @@ -131,25 +131,25 @@ public class TileEngineStone extends TileEngineWithInventory { } @Override - public float maxEnergyReceived() { + public double maxEnergyReceived() { return 200; } @Override - public float maxEnergyExtracted() { + public double maxEnergyExtracted() { return 100; } @Override - public float getMaxEnergy() { + public double getMaxEnergy() { return 1000; } @Override - public float getCurrentOutput() { - float e = TARGET_OUTPUT * getMaxEnergy() - energy; - esum = Math.min(Math.max(esum + e, -eLimit), eLimit); - return Math.min(Math.max(e * kp + esum * ki, MIN_OUTPUT), MAX_OUTPUT); + public double getCurrentOutput() { + double e = TARGET_OUTPUT * getMaxEnergy() - energy; + esum = MathUtils.clamp(esum + e, -eLimit, eLimit); + return MathUtils.clamp(e * kp + esum * ki, MIN_OUTPUT, MAX_OUTPUT); } @Override diff --git a/common/buildcraft/energy/TileEngineWood.java b/common/buildcraft/energy/TileEngineWood.java index 5791cd62..a610a660 100644 --- a/common/buildcraft/energy/TileEngineWood.java +++ b/common/buildcraft/energy/TileEngineWood.java @@ -28,18 +28,18 @@ public class TileEngineWood extends TileEngine { } @Override - public float minEnergyReceived() { + public double minEnergyReceived() { return 0; } @Override - public float maxEnergyReceived() { + public double maxEnergyReceived() { return 50; } @Override protected EnergyStage computeEnergyStage() { - float energyLevel = getEnergyLevel(); + double energyLevel = getEnergyLevel(); if (energyLevel < 0.25f) return EnergyStage.BLUE; else if (energyLevel < 0.5f) @@ -91,17 +91,17 @@ public class TileEngineWood extends TileEngine { } @Override - public float getMaxEnergy() { + public double getMaxEnergy() { return 100; } @Override - public float getCurrentOutput() { + public double getCurrentOutput() { return OUTPUT; } @Override - public float maxEnergyExtracted() { + public double maxEnergyExtracted() { return 1 + PowerHandler.PerditionCalculator.MIN_POWERLOSS; } } diff --git a/common/buildcraft/factory/TileQuarry.java b/common/buildcraft/factory/TileQuarry.java index a995dc71..b8d0fe31 100644 --- a/common/buildcraft/factory/TileQuarry.java +++ b/common/buildcraft/factory/TileQuarry.java @@ -150,9 +150,9 @@ public class TileQuarry extends TileBuildCraft implements IMachine, IPowerRecept } super.updateEntity(); if (inProcess) { - float energyToUse = 2 + powerHandler.getEnergyStored() / 500; + double energyToUse = 2 + powerHandler.getEnergyStored() / 500; - float energy = powerHandler.useEnergy(energyToUse, energyToUse, true); + double energy = powerHandler.useEnergy(energyToUse, energyToUse, true); if (energy > 0) { moveHead(0.1 + energy / 200F); diff --git a/common/buildcraft/factory/TileRefinery.java b/common/buildcraft/factory/TileRefinery.java index 58eb6f8f..37a9e0b1 100644 --- a/common/buildcraft/factory/TileRefinery.java +++ b/common/buildcraft/factory/TileRefinery.java @@ -158,7 +158,7 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IPowe if (!time.markTimeIfDelay(worldObj, currentRecipe.timeRequired)) return; - float energyUsed = powerHandler.useEnergy(currentRecipe.energyCost, currentRecipe.energyCost, true); + double energyUsed = powerHandler.useEnergy(currentRecipe.energyCost, currentRecipe.energyCost, true); if (energyUsed != 0) { if (consumeInput(currentRecipe.ingredient1) && consumeInput(currentRecipe.ingredient2)) { diff --git a/common/buildcraft/silicon/TileLaser.java b/common/buildcraft/silicon/TileLaser.java index 5d9b3ead..f38fb1e6 100644 --- a/common/buildcraft/silicon/TileLaser.java +++ b/common/buildcraft/silicon/TileLaser.java @@ -97,7 +97,7 @@ public class TileLaser extends TileBuildCraft implements IPowerReceptor, IAction } // Consume power and transfer it to the table. - float power = powerHandler.useEnergy(0, getMaxPowerSent(), true); + double power = powerHandler.useEnergy(0, getMaxPowerSent(), true); laserTarget.receiveLaserEnergy(power); if (laser != null) { @@ -113,7 +113,7 @@ public class TileLaser extends TileBuildCraft implements IPowerReceptor, IAction return 4; } - protected void onPowerSent(float power) { + protected void onPowerSent(double power) { } protected boolean canFindTable() { diff --git a/common/buildcraft/silicon/TileLaserTableBase.java b/common/buildcraft/silicon/TileLaserTableBase.java index 39020212..8266cca3 100644 --- a/common/buildcraft/silicon/TileLaserTableBase.java +++ b/common/buildcraft/silicon/TileLaserTableBase.java @@ -76,7 +76,7 @@ public abstract class TileLaserTableBase extends TileBuildCraft implements ILase } @Override - public void receiveLaserEnergy(float energy) { + public void receiveLaserEnergy(double energy) { this.energy += energy; recentEnergy[tick] += energy; } diff --git a/common/buildcraft/transport/PipeTransportPower.java b/common/buildcraft/transport/PipeTransportPower.java index e048132e..e02fe0f0 100644 --- a/common/buildcraft/transport/PipeTransportPower.java +++ b/common/buildcraft/transport/PipeTransportPower.java @@ -162,7 +162,7 @@ public class PipeTransportPower extends PipeTransport { PowerReceiver prov = getReceiverOnSide(ForgeDirection.VALID_DIRECTIONS[j]); if (prov != null && prov.powerRequest() > 0) { watts = (internalPower[i] / totalPowerQuery) * powerQuery[j]; - watts = prov.receiveEnergy(Type.PIPE, watts, ForgeDirection.VALID_DIRECTIONS[j].getOpposite()); + watts = (float) prov.receiveEnergy(Type.PIPE, watts, ForgeDirection.VALID_DIRECTIONS[j].getOpposite()); internalPower[i] -= watts; } else if (tiles[j] instanceof TileGenericPipe) { watts = (internalPower[i] / totalPowerQuery) * powerQuery[j]; @@ -202,7 +202,7 @@ public class PipeTransportPower extends PipeTransport { for (int i = 0; i < 6; ++i) { PowerReceiver prov = getReceiverOnSide(ForgeDirection.VALID_DIRECTIONS[i]); if (prov != null) { - float request = prov.powerRequest(); + float request = (float) prov.powerRequest(); if (request > 0) { requestEnergy(ForgeDirection.VALID_DIRECTIONS[i], request); diff --git a/common/buildcraft/transport/pipes/PipeItemsObsidian.java b/common/buildcraft/transport/pipes/PipeItemsObsidian.java index 5b87698f..a48de240 100644 --- a/common/buildcraft/transport/pipes/PipeItemsObsidian.java +++ b/common/buildcraft/transport/pipes/PipeItemsObsidian.java @@ -207,7 +207,7 @@ public class PipeItemsObsidian extends Pipe implements IPowe CoreProxy.proxy.obsidianPipePickup(container.worldObj, item, this.container); - float energyUsed = powerHandler.useEnergy(distance, contained.stackSize * distance, true); + double energyUsed = powerHandler.useEnergy(distance, contained.stackSize * distance, true); if (distance == 0 || energyUsed / distance == contained.stackSize) { stack = contained; diff --git a/common/buildcraft/transport/pipes/PipePowerWood.java b/common/buildcraft/transport/pipes/PipePowerWood.java index 433224d3..f6e804a0 100644 --- a/common/buildcraft/transport/pipes/PipePowerWood.java +++ b/common/buildcraft/transport/pipes/PipePowerWood.java @@ -92,7 +92,7 @@ public class PipePowerWood extends Pipe implements IPowerRec return; } - float energyToRemove; + double energyToRemove; if (powerHandler.getEnergyStored() > 40) { energyToRemove = powerHandler.getEnergyStored() / 40 + 4; @@ -107,7 +107,7 @@ public class PipePowerWood extends Pipe implements IPowerRec if (!powerSources[o.ordinal()]) continue; - float energyUsable = powerHandler.useEnergy(0, energyToRemove, false); + float energyUsable = (float) powerHandler.useEnergy(0, energyToRemove, false); float energySent = transport.receiveEnergy(o, energyUsable); if (energySent > 0) {