attempt at moving MJ => RF units, for #2015

This commit is contained in:
SpaceToad 2014-09-14 12:30:04 +02:00
parent ff527353c5
commit b906f7b7a8
6 changed files with 38 additions and 38 deletions

View file

@ -267,9 +267,9 @@ public class BuildCraftEnergy extends BuildCraftMod {
BuildcraftRecipeRegistry.refinery.addRecipe("buildcraft:fuel", new FluidStack(fluidOil, 1), new FluidStack( BuildcraftRecipeRegistry.refinery.addRecipe("buildcraft:fuel", new FluidStack(fluidOil, 1), new FluidStack(
fluidFuel, 1), 120, 1); fluidFuel, 1), 120, 1);
BuildcraftFuelRegistry.fuel.addFuel(FluidRegistry.LAVA, 2, (int) (6000 * fuelLavaMultiplier)); BuildcraftFuelRegistry.fuel.addFuel(FluidRegistry.LAVA, 20, (int) (6000 * fuelLavaMultiplier));
BuildcraftFuelRegistry.fuel.addFuel(fluidOil, 3, (int) (5000 * fuelOilMultiplier)); BuildcraftFuelRegistry.fuel.addFuel(fluidOil, 30, (int) (5000 * fuelOilMultiplier));
BuildcraftFuelRegistry.fuel.addFuel(fluidFuel, 6, (int) (25000 * fuelFuelMultiplier)); BuildcraftFuelRegistry.fuel.addFuel(fluidFuel, 60, (int) (25000 * fuelFuelMultiplier));
BuildcraftFuelRegistry.coolant.addCoolant(FluidRegistry.WATER, 0.0023f); BuildcraftFuelRegistry.coolant.addCoolant(FluidRegistry.WATER, 0.0023f);
BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.ice), StackKey.fluid(FluidRegistry.WATER), 2f); BuildcraftFuelRegistry.coolant.addSolidCoolant(StackKey.stack(Blocks.ice), StackKey.fluid(FluidRegistry.WATER), 2f);

View file

@ -105,7 +105,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
@Override @Override
public void initialize() { public void initialize() {
if (!worldObj.isRemote) { if (!worldObj.isRemote) {
powerHandler.configure(minEnergyReceived(), maxEnergyReceived(), 1, getMaxEnergy()); powerHandler.configure(minEnergyReceived() / 10, maxEnergyReceived() / 10, 1, getMaxEnergy() / 10);
checkRedstonePower(); checkRedstonePower();
} }
} }
@ -287,14 +287,14 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
int minEnergy = 0; int minEnergy = 0;
int maxEnergy = handler.receiveEnergy( int maxEnergy = handler.receiveEnergy(
orientation.getOpposite(), orientation.getOpposite(),
(int) Math.round(this.energy * 10), true); (int) Math.round(this.energy), true);
return extractEnergy(minEnergy / 10.0, maxEnergy / 10.0, false); return extractEnergy(minEnergy, maxEnergy, false);
} else if (tile instanceof IPowerReceptor) { } else if (tile instanceof IPowerReceptor) {
PowerReceiver receptor = ((IPowerReceptor) tile) PowerReceiver receptor = ((IPowerReceptor) tile)
.getPowerReceiver(orientation.getOpposite()); .getPowerReceiver(orientation.getOpposite());
return extractEnergy(receptor.getMinEnergyReceived(), return extractEnergy(receptor.getMinEnergyReceived() * 10,
receptor.getMaxEnergyReceived(), false); receptor.getMaxEnergyReceived() * 10, false);
} else { } else {
return 0; return 0;
} }
@ -312,23 +312,23 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
if (tile instanceof IEnergyHandler) { if (tile instanceof IEnergyHandler) {
IEnergyHandler handler = (IEnergyHandler) tile; IEnergyHandler handler = (IEnergyHandler) tile;
if (Math.round(extracted * 10) > 0) { if (Math.round(extracted) > 0) {
int neededRF = handler.receiveEnergy( int neededRF = handler.receiveEnergy(
orientation.getOpposite(), 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) { } else if (tile instanceof IPowerReceptor) {
PowerReceiver receptor = ((IPowerReceptor) tile) PowerReceiver receptor = ((IPowerReceptor) tile)
.getPowerReceiver(orientation.getOpposite()); .getPowerReceiver(orientation.getOpposite());
if (extracted > 0) { if (extracted > 0) {
double needed = receptor.receiveEnergy( double neededMJ = receptor.receiveEnergy(
PowerHandler.Type.ENGINE, extracted, PowerHandler.Type.ENGINE, extracted,
orientation.getOpposite()); 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) { public void getGUINetworkData(int id, int value) {
switch (id) { switch (id) {
case 0: case 0:
int iEnergy = (int) Math.round(energy * 10); int iEnergy = (int) Math.round(energy);
iEnergy = (iEnergy & 0xffff0000) | (value & 0xffff); iEnergy = (iEnergy & 0xffff0000) | (value & 0xffff);
energy = iEnergy / 10; energy = iEnergy;
break; break;
case 1: case 1:
iEnergy = (int) Math.round(energy * 10); iEnergy = (int) Math.round(energy );
iEnergy = (iEnergy & 0xffff) | ((value & 0xffff) << 16); iEnergy = (iEnergy & 0xffff) | ((value & 0xffff) << 16);
energy = iEnergy / 10; energy = iEnergy;
break; break;
case 2: case 2:
currentOutput = value / 10F; currentOutput = value;
break; break;
case 3: case 3:
heat = value / 100F; heat = value / 100F;
@ -473,9 +473,9 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
} }
public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) { public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) {
iCrafting.sendProgressBarUpdate(containerEngine, 0, (int) Math.round(energy * 10) & 0xffff); iCrafting.sendProgressBarUpdate(containerEngine, 0, (int) Math.round(energy) & 0xffff);
iCrafting.sendProgressBarUpdate(containerEngine, 1, (int) (Math.round(energy * 10) & 0xffff0000) >> 16); iCrafting.sendProgressBarUpdate(containerEngine, 1, (int) (Math.round(energy) & 0xffff0000) >> 16);
iCrafting.sendProgressBarUpdate(containerEngine, 2, (int) Math.round(currentOutput * 10)); iCrafting.sendProgressBarUpdate(containerEngine, 2, (int) Math.round(currentOutput));
iCrafting.sendProgressBarUpdate(containerEngine, 3, Math.round(heat * 100)); 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 abstract double getMaxEnergy();
public double minEnergyReceived() { public double minEnergyReceived() {
return 2; return 20;
} }
public abstract double maxEnergyReceived(); public abstract double maxEnergyReceived();
@ -637,7 +637,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
return 0; return 0;
} }
return (int) Math.round(10 * energy); return (int) Math.round(energy);
} }
@Override @Override

View file

@ -117,7 +117,7 @@ public class TileEngineCreative extends TileEngine {
@Override @Override
public double getCurrentOutput() { public double getCurrentOutput() {
return powerMode.maxPower / 10.0; return powerMode.maxPower;
} }
@Override @Override

View file

@ -42,7 +42,7 @@ import buildcraft.energy.gui.ContainerEngine;
public class TileEngineIron extends TileEngineWithInventory implements IFluidHandler { public class TileEngineIron extends TileEngineWithInventory implements IFluidHandler {
public static int MAX_LIQUID = FluidContainerRegistry.BUCKET_VOLUME * 10; 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 float COOLDOWN_RATE = 0.05F;
public static int MAX_COOLANT_PER_TICK = 40; public static int MAX_COOLANT_PER_TICK = 40;
@ -178,7 +178,7 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
} }
addEnergy(currentFuel.getPowerPerCycle()); addEnergy(currentFuel.getPowerPerCycle());
heat += currentFuel.getPowerPerCycle() * HEAT_PER_MJ * getBiomeTempScalar(); heat += currentFuel.getPowerPerCycle() * HEAT_PER_RF * getBiomeTempScalar();
} }
} else if (penaltyCooling <= 0) { } else if (penaltyCooling <= 0) {
if (lastPowered) { if (lastPowered) {
@ -404,17 +404,17 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
@Override @Override
public double maxEnergyReceived() { public double maxEnergyReceived() {
return 2000; return 20000;
} }
@Override @Override
public double maxEnergyExtracted() { public double maxEnergyExtracted() {
return 500; return 5000;
} }
@Override @Override
public double getMaxEnergy() { public double getMaxEnergy() {
return 10000; return 100000;
} }
@Override @Override

View file

@ -29,9 +29,9 @@ import buildcraft.energy.gui.ContainerEngine;
public class TileEngineStone extends TileEngineWithInventory { 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 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 kp = 1f;
final float ki = 0.05f; final float ki = 0.05f;
final double eLimit = (MAX_OUTPUT - MIN_OUTPUT) / ki; final double eLimit = (MAX_OUTPUT - MIN_OUTPUT) / ki;
@ -143,17 +143,17 @@ public class TileEngineStone extends TileEngineWithInventory {
@Override @Override
public double maxEnergyReceived() { public double maxEnergyReceived() {
return 200; return 2000;
} }
@Override @Override
public double maxEnergyExtracted() { public double maxEnergyExtracted() {
return 100; return 1000;
} }
@Override @Override
public double getMaxEnergy() { public double getMaxEnergy() {
return 1000; return 10000;
} }
@Override @Override

View file

@ -19,7 +19,7 @@ import buildcraft.transport.TileGenericPipe;
public class TileEngineWood extends TileEngine { public class TileEngineWood extends TileEngine {
public static final float OUTPUT = 0.1F; public static final float OUTPUT = 1;
@Override @Override
public ResourceLocation getBaseTexture() { public ResourceLocation getBaseTexture() {
@ -43,7 +43,7 @@ public class TileEngineWood extends TileEngine {
@Override @Override
public double maxEnergyReceived() { public double maxEnergyReceived() {
return 50; return 500;
} }
@Override @Override
@ -101,7 +101,7 @@ public class TileEngineWood extends TileEngine {
@Override @Override
public double getMaxEnergy() { public double getMaxEnergy() {
return 100; return 1000;
} }
@Override @Override