From b906f7b7a8661c1089004314817698cde49ab6a6 Mon Sep 17 00:00:00 2001 From: SpaceToad Date: Sun, 14 Sep 2014 12:30:04 +0200 Subject: [PATCH] attempt at moving MJ => RF units, for #2015 --- common/buildcraft/BuildCraftEnergy.java | 6 +-- common/buildcraft/energy/TileEngine.java | 40 +++++++++---------- .../buildcraft/energy/TileEngineCreative.java | 4 +- common/buildcraft/energy/TileEngineIron.java | 10 ++--- common/buildcraft/energy/TileEngineStone.java | 10 ++--- common/buildcraft/energy/TileEngineWood.java | 6 +-- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java index 921d0e04..1de2819a 100644 --- a/common/buildcraft/BuildCraftEnergy.java +++ b/common/buildcraft/BuildCraftEnergy.java @@ -267,9 +267,9 @@ public class BuildCraftEnergy extends BuildCraftMod { BuildcraftRecipeRegistry.refinery.addRecipe("buildcraft:fuel", new FluidStack(fluidOil, 1), new FluidStack( fluidFuel, 1), 120, 1); - BuildcraftFuelRegistry.fuel.addFuel(FluidRegistry.LAVA, 2, (int) (6000 * fuelLavaMultiplier)); - BuildcraftFuelRegistry.fuel.addFuel(fluidOil, 3, (int) (5000 * fuelOilMultiplier)); - BuildcraftFuelRegistry.fuel.addFuel(fluidFuel, 6, (int) (25000 * fuelFuelMultiplier)); + BuildcraftFuelRegistry.fuel.addFuel(FluidRegistry.LAVA, 20, (int) (6000 * fuelLavaMultiplier)); + BuildcraftFuelRegistry.fuel.addFuel(fluidOil, 30, (int) (5000 * fuelOilMultiplier)); + BuildcraftFuelRegistry.fuel.addFuel(fluidFuel, 60, (int) (25000 * fuelFuelMultiplier)); BuildcraftFuelRegistry.coolant.addCoolant(FluidRegistry.WATER, 0.0023f); BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.ice), StackKey.fluid(FluidRegistry.WATER), 2f); diff --git a/common/buildcraft/energy/TileEngine.java b/common/buildcraft/energy/TileEngine.java index 8d6b3373..578e6a0c 100644 --- a/common/buildcraft/energy/TileEngine.java +++ b/common/buildcraft/energy/TileEngine.java @@ -105,7 +105,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto @Override public void initialize() { if (!worldObj.isRemote) { - powerHandler.configure(minEnergyReceived(), maxEnergyReceived(), 1, getMaxEnergy()); + powerHandler.configure(minEnergyReceived() / 10, maxEnergyReceived() / 10, 1, getMaxEnergy() / 10); checkRedstonePower(); } } @@ -287,14 +287,14 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto int minEnergy = 0; int maxEnergy = handler.receiveEnergy( orientation.getOpposite(), - (int) Math.round(this.energy * 10), true); - return extractEnergy(minEnergy / 10.0, maxEnergy / 10.0, false); + (int) Math.round(this.energy), true); + return extractEnergy(minEnergy, maxEnergy, false); } else if (tile instanceof IPowerReceptor) { PowerReceiver receptor = ((IPowerReceptor) tile) .getPowerReceiver(orientation.getOpposite()); - return extractEnergy(receptor.getMinEnergyReceived(), - receptor.getMaxEnergyReceived(), false); + return extractEnergy(receptor.getMinEnergyReceived() * 10, + receptor.getMaxEnergyReceived() * 10, false); } else { return 0; } @@ -312,23 +312,23 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto if (tile instanceof IEnergyHandler) { IEnergyHandler handler = (IEnergyHandler) tile; - if (Math.round(extracted * 10) > 0) { + if (Math.round(extracted) > 0) { int neededRF = handler.receiveEnergy( orientation.getOpposite(), - (int) Math.round(extracted * 10), false); + (int) Math.round(extracted), false); - extractEnergy(0.0, neededRF / 10.0, true); + extractEnergy(0.0, neededRF, true); } } else if (tile instanceof IPowerReceptor) { PowerReceiver receptor = ((IPowerReceptor) tile) .getPowerReceiver(orientation.getOpposite()); if (extracted > 0) { - double needed = receptor.receiveEnergy( + double neededMJ = receptor.receiveEnergy( PowerHandler.Type.ENGINE, extracted, orientation.getOpposite()); - extractEnergy(receptor.getMinEnergyReceived(), needed, true); + extractEnergy(receptor.getMinEnergyReceived(), neededMJ * 10, true); } } } @@ -454,17 +454,17 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto public void getGUINetworkData(int id, int value) { switch (id) { case 0: - int iEnergy = (int) Math.round(energy * 10); + int iEnergy = (int) Math.round(energy); iEnergy = (iEnergy & 0xffff0000) | (value & 0xffff); - energy = iEnergy / 10; + energy = iEnergy; break; case 1: - iEnergy = (int) Math.round(energy * 10); + iEnergy = (int) Math.round(energy ); iEnergy = (iEnergy & 0xffff) | ((value & 0xffff) << 16); - energy = iEnergy / 10; + energy = iEnergy; break; case 2: - currentOutput = value / 10F; + currentOutput = value; break; case 3: heat = value / 100F; @@ -473,9 +473,9 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto } public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) { - 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, 0, (int) Math.round(energy) & 0xffff); + iCrafting.sendProgressBarUpdate(containerEngine, 1, (int) (Math.round(energy) & 0xffff0000) >> 16); + iCrafting.sendProgressBarUpdate(containerEngine, 2, (int) Math.round(currentOutput)); iCrafting.sendProgressBarUpdate(containerEngine, 3, Math.round(heat * 100)); } @@ -560,7 +560,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto public abstract double getMaxEnergy(); public double minEnergyReceived() { - return 2; + return 20; } public abstract double maxEnergyReceived(); @@ -637,7 +637,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto return 0; } - return (int) Math.round(10 * energy); + return (int) Math.round(energy); } @Override diff --git a/common/buildcraft/energy/TileEngineCreative.java b/common/buildcraft/energy/TileEngineCreative.java index 1115b3a6..abbc5c7e 100644 --- a/common/buildcraft/energy/TileEngineCreative.java +++ b/common/buildcraft/energy/TileEngineCreative.java @@ -99,7 +99,7 @@ public class TileEngineCreative extends TileEngine { public boolean isBurning() { return isRedstonePowered; } - + @Override public double maxEnergyReceived() { return getCurrentOutput(); @@ -117,7 +117,7 @@ public class TileEngineCreative extends TileEngine { @Override public double getCurrentOutput() { - return powerMode.maxPower / 10.0; + return powerMode.maxPower; } @Override diff --git a/common/buildcraft/energy/TileEngineIron.java b/common/buildcraft/energy/TileEngineIron.java index d6f4bc06..c3876995 100644 --- a/common/buildcraft/energy/TileEngineIron.java +++ b/common/buildcraft/energy/TileEngineIron.java @@ -42,7 +42,7 @@ import buildcraft.energy.gui.ContainerEngine; public class TileEngineIron extends TileEngineWithInventory implements IFluidHandler { public static int MAX_LIQUID = FluidContainerRegistry.BUCKET_VOLUME * 10; - public static float HEAT_PER_MJ = 0.0023F; + public static float HEAT_PER_RF = 0.00023F; public static float COOLDOWN_RATE = 0.05F; public static int MAX_COOLANT_PER_TICK = 40; @@ -178,7 +178,7 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan } addEnergy(currentFuel.getPowerPerCycle()); - heat += currentFuel.getPowerPerCycle() * HEAT_PER_MJ * getBiomeTempScalar(); + heat += currentFuel.getPowerPerCycle() * HEAT_PER_RF * getBiomeTempScalar(); } } else if (penaltyCooling <= 0) { if (lastPowered) { @@ -404,17 +404,17 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan @Override public double maxEnergyReceived() { - return 2000; + return 20000; } @Override public double maxEnergyExtracted() { - return 500; + return 5000; } @Override public double getMaxEnergy() { - return 10000; + return 100000; } @Override diff --git a/common/buildcraft/energy/TileEngineStone.java b/common/buildcraft/energy/TileEngineStone.java index 0c36f106..0b89bd01 100644 --- a/common/buildcraft/energy/TileEngineStone.java +++ b/common/buildcraft/energy/TileEngineStone.java @@ -29,9 +29,9 @@ import buildcraft.energy.gui.ContainerEngine; public class TileEngineStone extends TileEngineWithInventory { - static final float MAX_OUTPUT = 1f; + static final float MAX_OUTPUT = 10; static final float MIN_OUTPUT = MAX_OUTPUT / 3; - static final float TARGET_OUTPUT = 0.375f; + static final float TARGET_OUTPUT = 3.75f; final float kp = 1f; final float ki = 0.05f; final double eLimit = (MAX_OUTPUT - MIN_OUTPUT) / ki; @@ -143,17 +143,17 @@ public class TileEngineStone extends TileEngineWithInventory { @Override public double maxEnergyReceived() { - return 200; + return 2000; } @Override public double maxEnergyExtracted() { - return 100; + return 1000; } @Override public double getMaxEnergy() { - return 1000; + return 10000; } @Override diff --git a/common/buildcraft/energy/TileEngineWood.java b/common/buildcraft/energy/TileEngineWood.java index 51c3e9df..c33d0597 100644 --- a/common/buildcraft/energy/TileEngineWood.java +++ b/common/buildcraft/energy/TileEngineWood.java @@ -19,7 +19,7 @@ import buildcraft.transport.TileGenericPipe; public class TileEngineWood extends TileEngine { - public static final float OUTPUT = 0.1F; + public static final float OUTPUT = 1; @Override public ResourceLocation getBaseTexture() { @@ -43,7 +43,7 @@ public class TileEngineWood extends TileEngine { @Override public double maxEnergyReceived() { - return 50; + return 500; } @Override @@ -101,7 +101,7 @@ public class TileEngineWood extends TileEngine { @Override public double getMaxEnergy() { - return 100; + return 1000; } @Override