diff --git a/src/main/java/com/recursive_pineapple/nuclear_horizons/Config.java b/src/main/java/com/recursive_pineapple/nuclear_horizons/Config.java index c4310ad..99703de 100644 --- a/src/main/java/com/recursive_pineapple/nuclear_horizons/Config.java +++ b/src/main/java/com/recursive_pineapple/nuclear_horizons/Config.java @@ -11,6 +11,11 @@ public class Config { public static double MOX_EU_COEFFICIENT = 4; public static int REACTOR_EU_MULTIPLIER = 100; public static int FLUID_NUKE_HU_MULTIPLIER = 2; + // 1 HU converts this/160 mb of distilled water to this mb of steam + // ex: 600 HU/s converts 1200mb/s of distilled water to 192000mb/s of steam + // BWRs are limited by the size of the reactor output buffer and this value + // which currently puts maximum power at just over 600 HU/s + public static int BWR_STEAM_PER_HU_MULTIPLIER = 320; public static int COOLANT_SPECIFIC_HEAT = 1; public static int NAQ_COOLANT_SPECIFIC_HEAT = 8; diff --git a/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/fluids/FluidList.java b/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/fluids/FluidList.java index dd23c28..405ba03 100644 --- a/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/fluids/FluidList.java +++ b/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/fluids/FluidList.java @@ -15,17 +15,20 @@ public class FluidList { + public static final String DISTILLED_WATER_NAME = "distilled_water"; public static final String COOLANT_NAME = "nh_coolant"; public static final String HOT_COOLANT_NAME = "nh_hot_coolant"; public static final String PSEUDO_LIQUID_NAQUADAH_NAME = "pseudo_liquid_naquadah"; public static final String HOT_PSEUDO_LIQUID_NAQUADAH_NAME = "hot_pseudo_liquid_naquadah"; - + public static final Fluid DISTILLED_WATER = new Fluid(DISTILLED_WATER_NAME); public static final Fluid COOLANT = new Fluid(COOLANT_NAME); public static final Fluid HOT_COOLANT = new Fluid(HOT_COOLANT_NAME); public static final Fluid PSEUDO_LIQUID_NAQUADAH = new Fluid(PSEUDO_LIQUID_NAQUADAH_NAME); public static final Fluid HOT_PSEUDO_LIQUID_NAQUADAH = new Fluid(HOT_PSEUDO_LIQUID_NAQUADAH_NAME); public static void registerFluids() { + FluidRegistry.registerFluid(DISTILLED_WATER); + FluidRegistry.registerFluid(COOLANT); HOT_COOLANT.setTemperature(273 + 200); @@ -43,6 +46,7 @@ public static void registerContainers() { registerCell(HOT_COOLANT, 1); registerCell(PSEUDO_LIQUID_NAQUADAH, 2); registerCell(HOT_PSEUDO_LIQUID_NAQUADAH, 3); + registerCell(DISTILLED_WATER, 4); } private static void registerCell(Fluid fluid, int metadata) { @@ -59,6 +63,8 @@ public static void registerCoolants() { FluidRegistry.getFluid("ic2hotcoolant"), Config.COOLANT_SPECIFIC_HEAT); + CoolantRegistry.registerCoolant(DISTILLED_WATER, FluidRegistry.getFluid("steam"), 1); + CoolantRegistry .registerCoolant(PSEUDO_LIQUID_NAQUADAH, HOT_PSEUDO_LIQUID_NAQUADAH, Config.NAQ_COOLANT_SPECIFIC_HEAT); diff --git a/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/fluids/IconLoader.java b/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/fluids/IconLoader.java index c792a4f..b7744cd 100644 --- a/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/fluids/IconLoader.java +++ b/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/fluids/IconLoader.java @@ -18,6 +18,10 @@ public void register() { @SubscribeEvent public void registerIcons(TextureStitchEvent.Pre event) { if (event.map.getTextureType() == 0) { + FluidList.DISTILLED_WATER.setIcons( + event.map.registerIcon(NuclearHorizons.MODID + ":distilled_water_still"), + event.map.registerIcon(NuclearHorizons.MODID + ":distilled_water_flow")); + FluidList.COOLANT.setIcons( event.map.registerIcon(NuclearHorizons.MODID + ":coolant_still"), event.map.registerIcon(NuclearHorizons.MODID + ":coolant_flow")); diff --git a/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/items/MetaCellItem.java b/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/items/MetaCellItem.java index 9d50dc7..cfa7961 100644 --- a/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/items/MetaCellItem.java +++ b/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/items/MetaCellItem.java @@ -18,7 +18,7 @@ public class MetaCellItem extends Item { - private IIcon[] icons = new IIcon[4]; + private IIcon[] icons = new IIcon[5]; public MetaCellItem() { setUnlocalizedName("metacell"); @@ -35,6 +35,7 @@ public void registerIcons(IIconRegister register) { icons[1] = register.registerIcon(NuclearHorizons.MODID + ":cellHotCoolant"); icons[2] = register.registerIcon(NuclearHorizons.MODID + ":cellPseudoLiquidNaquadah"); icons[3] = register.registerIcon(NuclearHorizons.MODID + ":cellHotPseudoLiquidNaquadah"); + icons[4] = register.registerIcon(NuclearHorizons.MODID + ":cellDistilledWater"); } @Override @@ -53,6 +54,7 @@ public String getUnlocalizedName(ItemStack stack) { case 1 -> "item.cell_hot_coolant"; case 2 -> "item.cell_pseudo_liquid_naquadah"; case 3 -> "item.cell_hot_pseudo_liquid_naquadah"; + case 4 -> "item.cell_distilled_water"; default -> "item.invalid_cell"; }; } @@ -66,6 +68,7 @@ public void addInformation(ItemStack stack, EntityPlayer player, List li case 1 -> I18n.format("item.cell_hot_coolant.tooltip"); case 2 -> I18n.format("item.cell_pseudo_liquid_naquadah.tooltip", Config.NAQ_COOLANT_SPECIFIC_HEAT); case 3 -> I18n.format("item.cell_hot_pseudo_liquid_naquadah.tooltip"); + case 4 -> I18n.format("item.cell_distilled_water"); default -> ""; }); } @@ -76,5 +79,6 @@ public void getSubItems(Item item, CreativeTabs tab, List subItems) { subItems.add(new ItemStack(this, 1, 1)); subItems.add(new ItemStack(this, 1, 2)); subItems.add(new ItemStack(this, 1, 3)); + subItems.add(new ItemStack(this, 1, 4)); } } diff --git a/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/tile/TileReactorCore.java b/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/tile/TileReactorCore.java index 26714ee..6a4f0ec 100644 --- a/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/tile/TileReactorCore.java +++ b/src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/tile/TileReactorCore.java @@ -96,7 +96,10 @@ public class TileReactorCore extends TileEntity Coolant coolantCache; FluidTank coolantTank = new FluidTank(10_000); - FluidTank hotCoolantTank = new FluidTank(10_000); + // change for testing distilled water->steam conversion + // since so much steam is produced per HU, you need a large output buffer to capture useful + // steam/s production + FluidTank hotCoolantTank = new FluidTank(200_000); private ArrayList reactorBlocks = new ArrayList<>(); @@ -1040,12 +1043,35 @@ public int addAirHeat(int airHeat) { this.coolantTank.getFluidAmount(), this.hotCoolantTank.getCapacity() - this.hotCoolantTank.getFluidAmount()); - int consumedCoolant = Math.min(roundedHeat / coolantCache.specificHeatCapacity, heatableCoolant); + int consumedCoolant; + // BWR + if (this.coolantCache.cold.getName() + .equals("distilled_water")) { + consumedCoolant = Math.min( + roundedHeat / (coolantCache.specificHeatCapacity), + Math.min( + this.coolantTank.getFluidAmount(), + (this.hotCoolantTank.getCapacity() - this.hotCoolantTank.getFluidAmount()) + / Config.BWR_STEAM_PER_HU_MULTIPLIER)); + } + // conventional coolants + else { + consumedCoolant = Math.min(roundedHeat / coolantCache.specificHeatCapacity, heatableCoolant); + } this.roundedHeat -= consumedCoolant * coolantCache.specificHeatCapacity; this.addedHeat += consumedCoolant * coolantCache.specificHeatCapacity; - this.coolantTank.drain(consumedCoolant, true); - this.hotCoolantTank.fill(new FluidStack(coolantCache.hot, consumedCoolant), true); + // for BWRs, convert distilled water to a configured amount of steam instead of the same quantity of hot + // coolant + if (this.coolantCache.cold.getName() + .equals("distilled_water")) { + this.coolantTank.drain(consumedCoolant, true); + this.hotCoolantTank + .fill(new FluidStack(coolantCache.hot, consumedCoolant * Config.BWR_STEAM_PER_HU_MULTIPLIER), true); + } else { + this.coolantTank.drain(consumedCoolant, true); + this.hotCoolantTank.fill(new FluidStack(coolantCache.hot, consumedCoolant), true); + } return 0; } else { diff --git a/src/main/resources/assets/nuclear_horizons/lang/en_US.lang b/src/main/resources/assets/nuclear_horizons/lang/en_US.lang index 1f00384..5aaa9bf 100644 --- a/src/main/resources/assets/nuclear_horizons/lang/en_US.lang +++ b/src/main/resources/assets/nuclear_horizons/lang/en_US.lang @@ -7,6 +7,8 @@ tile.reactor_redstone_port.name=Reactor Redstone Port tile.reactor_thermal_sensor.name=Reactor Thermal Sensor tile.reactor_simulator.name=Reactor Simulator +tile.distilled_water.name=Distilled Water + tile.nh_coolant.name=Coolant tile.nh_hot_coolant.name=Hot Coolant @@ -48,6 +50,7 @@ item.reactorPlatingExplosive.name=Containment Reactor Plating item.debugHeatAbsorber.name=Creative Heat Absorber item.reactorPlatingHeatDebug.name=Creative Reactor Plating +item.cell_distilled_water.name=Distilled Water Cell item.cell_coolant.name=Coolant Cell item.cell_hot_coolant.name=Hot Coolant Cell item.cell_pseudo_liquid_naquadah.name=Pseudo-Crystalline Naquadah Cell diff --git a/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_flow.png b/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_flow.png new file mode 100644 index 0000000..39d3c70 Binary files /dev/null and b/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_flow.png differ diff --git a/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_flow.png.mcmeta b/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_flow.png.mcmeta new file mode 100644 index 0000000..a1b7fad --- /dev/null +++ b/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_still.png b/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_still.png new file mode 100644 index 0000000..df24378 Binary files /dev/null and b/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_still.png differ diff --git a/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_still.png.mcmeta b/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_still.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/nuclear_horizons/textures/blocks/distilled_water_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/nuclear_horizons/textures/items/cellDistilledWater.png b/src/main/resources/assets/nuclear_horizons/textures/items/cellDistilledWater.png new file mode 100644 index 0000000..b486f03 Binary files /dev/null and b/src/main/resources/assets/nuclear_horizons/textures/items/cellDistilledWater.png differ