diff --git a/archaic/src/main/java/resonantinduction/archaic/firebox/TileFirebox.java b/archaic/src/main/java/resonantinduction/archaic/firebox/TileFirebox.java index 65d67d16..af921d3f 100644 --- a/archaic/src/main/java/resonantinduction/archaic/firebox/TileFirebox.java +++ b/archaic/src/main/java/resonantinduction/archaic/firebox/TileFirebox.java @@ -51,6 +51,8 @@ public class TileFirebox extends TileElectricalInventory implements IPacketRecei private long heatEnergy = 0; + private int boiledVolume; + public TileFirebox() { energy = new EnergyStorageHandler(POWER, (POWER * 2) / 20); @@ -142,13 +144,22 @@ public class TileFirebox extends TileElectricalInventory implements IPacketRecei else if (blockID == Block.waterStill.blockID) { usedHeat = true; + int volume = 100; - if (heatEnergy >= getRequiredBoilWaterEnergy()) + if (heatEnergy >= getRequiredBoilWaterEnergy(volume)) { if (FluidRegistry.getFluid("steam") != null) - MinecraftForge.EVENT_BUS.post(new BoilEvent(worldObj, new Vector3(this).translate(0, 1, 0), new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), new FluidStack(FluidRegistry.getFluid("steam"), FluidContainerRegistry.BUCKET_VOLUME), 2)); + { + MinecraftForge.EVENT_BUS.post(new BoilEvent(worldObj, new Vector3(this).translate(0, 1, 0), new FluidStack(FluidRegistry.WATER, volume), new FluidStack(FluidRegistry.getFluid("steam"), volume), 2)); + boiledVolume += volume; + } + + if (boiledVolume >= FluidContainerRegistry.BUCKET_VOLUME) + { + boiledVolume = 0; + worldObj.setBlock(xCoord, yCoord + 1, zCoord, 0); + } - worldObj.setBlock(xCoord, yCoord + 1, zCoord, 0); heatEnergy = 0; } } @@ -174,11 +185,15 @@ public class TileFirebox extends TileElectricalInventory implements IPacketRecei /** * Approximately 327600 + 2257000 = 2584600. * + * @param volume + * * @return */ - public long getRequiredBoilWaterEnergy() + public long getRequiredBoilWaterEnergy(int volume) { - return ThermalPhysics.getRequiredBoilWaterEnergy(worldObj, xCoord, zCoord); + int temperatureChange = 373 - ThermalPhysics.getTemperatureForCoordinate(worldObj, xCoord, zCoord); + int mass = ThermalPhysics.getMass(volume, 1); + return ThermalPhysics.getEnergyForTemperatureChange(mass, 4200, temperatureChange) + ThermalPhysics.getEnergyForStateChange(mass, 2257000); } public long getMeltIronEnergy(float volume) diff --git a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java index e1b51ec1..77578479 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java @@ -33,8 +33,15 @@ public class BlockWaterTurbine extends BlockTurbine TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity instanceof TileTurbine) + { if (!world.isRemote && !((TileTurbine) tileEntity).getMultiBlock().isConstructed()) - world.setBlockMetadataWithNotify(x, y, z, side, 3); + { + if (side == ((TileTurbine) tileEntity).getDirection().ordinal()) + world.setBlockMetadataWithNotify(x, y, z, side ^ 1, 3); + else + world.setBlockMetadataWithNotify(x, y, z, side, 3); + } + } return true; } diff --git a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWindTurbine.java b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWindTurbine.java index 658cce2b..8f9a67fc 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWindTurbine.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWindTurbine.java @@ -67,9 +67,16 @@ public class BlockWindTurbine extends BlockTurbine TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity instanceof TileTurbine) + { if (!world.isRemote && !((TileTurbine) tileEntity).getMultiBlock().isConstructed()) - world.setBlockMetadataWithNotify(x, y, z, side, 3); - + { + if (side == ((TileTurbine) tileEntity).getDirection().ordinal()) + world.setBlockMetadataWithNotify(x, y, z, side ^ 1, 3); + else + world.setBlockMetadataWithNotify(x, y, z, side, 3); + } + } + return true; }