From 9abbc5c90326423c787fa63330d3eed505a02164 Mon Sep 17 00:00:00 2001 From: bruberu <80226372+bruberu@users.noreply.github.com> Date: Sat, 20 Jul 2024 23:20:40 -0500 Subject: [PATCH] feat: the great refactor --- .../api/capability/ICoolantHandler.java | 5 +- .../api/capability/IFuelRodHandler.java | 9 +- .../api/fluids/GTFluidRegistration.java | 2 + .../api/nuclear/fission/CoolantRegistry.java | 26 ++++ .../nuclear/fission/FissionFuelRegistry.java | 38 +++++ .../api/nuclear/fission/FissionReactor.java | 36 ++--- .../api/nuclear/fission/ICoolantStats.java | 14 +- .../nuclear/fission/IFissionFuelStats.java | 37 ++++- .../fission/components/CoolantChannel.java | 9 +- .../nuclear/fission/components/FuelRod.java | 10 +- .../api/unification/material/Material.java | 21 --- .../materials/MaterialFlagAddition.java | 2 +- .../material/properties/CoolantProperty.java | 20 ++- .../properties/FissionFuelProperty.java | 18 ++- .../gregtech/api/util/FluidTooltipUtil.java | 32 ++--- .../java/gregtech/common/CommonProxy.java | 17 +++ .../multi/MetaTileEntityFissionReactor.java | 133 ++++++++---------- .../MetaTileEntityCoolantExportHatch.java | 7 +- .../MetaTileEntityCoolantImportHatch.java | 7 +- .../MetaTileEntityFuelRodImportBus.java | 18 +-- 20 files changed, 292 insertions(+), 169 deletions(-) diff --git a/src/main/java/gregtech/api/capability/ICoolantHandler.java b/src/main/java/gregtech/api/capability/ICoolantHandler.java index c65cceb9245..3b455c5bfb1 100644 --- a/src/main/java/gregtech/api/capability/ICoolantHandler.java +++ b/src/main/java/gregtech/api/capability/ICoolantHandler.java @@ -1,6 +1,7 @@ package gregtech.api.capability; import gregtech.api.capability.impl.LockableFluidTank; +import gregtech.api.nuclear.fission.ICoolantStats; import gregtech.api.unification.material.properties.CoolantProperty; import net.minecraft.util.EnumFacing; @@ -12,9 +13,9 @@ public interface ICoolantHandler extends ILockableHandler { @Nullable - CoolantProperty getCoolant(); + ICoolantStats getCoolant(); - void setCoolant(@Nullable CoolantProperty prop); + void setCoolant(@Nullable ICoolantStats prop); @NotNull LockableFluidTank getFluidTank(); diff --git a/src/main/java/gregtech/api/capability/IFuelRodHandler.java b/src/main/java/gregtech/api/capability/IFuelRodHandler.java index c5630377c3d..60c0f316aad 100644 --- a/src/main/java/gregtech/api/capability/IFuelRodHandler.java +++ b/src/main/java/gregtech/api/capability/IFuelRodHandler.java @@ -1,6 +1,7 @@ package gregtech.api.capability; import gregtech.api.items.itemhandlers.LockableItemStackHandler; +import gregtech.api.nuclear.fission.IFissionFuelStats; import gregtech.api.nuclear.fission.components.FuelRod; import gregtech.api.unification.material.properties.FissionFuelProperty; @@ -8,11 +9,11 @@ public interface IFuelRodHandler extends ILockableHandler { - FissionFuelProperty getFuel(); + IFissionFuelStats getFuel(); - void setFuel(FissionFuelProperty prop); + void setFuel(IFissionFuelStats prop); - FissionFuelProperty getPartialFuel(); + IFissionFuelStats getPartialFuel(); /** * Set the fuel type that's currently being processed by this specific handler. @@ -20,7 +21,7 @@ public interface IFuelRodHandler extends ILockableHandler { * @param prop The new fuel type. * @return true if the partial fuel changed. */ - boolean setPartialFuel(FissionFuelProperty prop); + boolean setPartialFuel(IFissionFuelStats prop); void setInternalFuelRod(FuelRod rod); diff --git a/src/main/java/gregtech/api/fluids/GTFluidRegistration.java b/src/main/java/gregtech/api/fluids/GTFluidRegistration.java index 8f690c15c4c..3c5130fd3cd 100644 --- a/src/main/java/gregtech/api/fluids/GTFluidRegistration.java +++ b/src/main/java/gregtech/api/fluids/GTFluidRegistration.java @@ -2,7 +2,9 @@ import gregtech.api.GTValues; import gregtech.api.GregTechAPI; +import gregtech.api.nuclear.fission.CoolantRegistry; import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.properties.CoolantProperty; import gregtech.api.unification.material.properties.FluidProperty; import gregtech.api.unification.material.properties.PropertyKey; import gregtech.common.blocks.MetaBlocks; diff --git a/src/main/java/gregtech/api/nuclear/fission/CoolantRegistry.java b/src/main/java/gregtech/api/nuclear/fission/CoolantRegistry.java index 19a32206804..9fcc0ad604c 100644 --- a/src/main/java/gregtech/api/nuclear/fission/CoolantRegistry.java +++ b/src/main/java/gregtech/api/nuclear/fission/CoolantRegistry.java @@ -1,5 +1,31 @@ package gregtech.api.nuclear.fission; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; + +import net.minecraftforge.fluids.Fluid; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; + public class CoolantRegistry { + private static final Map COOLANTS = new Object2ObjectOpenHashMap<>(); + private static final Map COOLANTS_INVERSE = new Object2ObjectOpenHashMap<>(); + + + public static void registerCoolant(@NotNull Fluid fluid, @NotNull ICoolantStats coolant) { + COOLANTS.put(fluid, coolant); + COOLANTS_INVERSE.put(coolant, fluid); + } + + @Nullable + public static ICoolantStats getCoolant(Fluid fluid) { + return COOLANTS.get(fluid); + } + @Nullable + public static Fluid originalFluid(ICoolantStats stats) { + return COOLANTS_INVERSE.get(stats); + } } diff --git a/src/main/java/gregtech/api/nuclear/fission/FissionFuelRegistry.java b/src/main/java/gregtech/api/nuclear/fission/FissionFuelRegistry.java index a4ab58b847f..58dd807ef64 100644 --- a/src/main/java/gregtech/api/nuclear/fission/FissionFuelRegistry.java +++ b/src/main/java/gregtech/api/nuclear/fission/FissionFuelRegistry.java @@ -1,5 +1,43 @@ package gregtech.api.nuclear.fission; +import gregtech.api.util.ItemStackHashStrategy; + +import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; + +import net.minecraft.item.ItemStack; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; + public class FissionFuelRegistry { + private static final Map HASHED_FUELS = new Int2ObjectArrayMap<>(); + private static final Map FUELS = new Object2ObjectOpenCustomHashMap<>( + ItemStackHashStrategy.comparingAllButCount()); + private static final Map DEPLETED_FUELS = new Object2ObjectOpenHashMap<>(); + + + public static void registerFuel(@NotNull ItemStack item, @NotNull IFissionFuelStats fuel, @NotNull ItemStack depletedFuel) { + HASHED_FUELS.put(fuel.hashCode(), fuel); + FUELS.put(item, fuel); + DEPLETED_FUELS.put(fuel, depletedFuel); + } + + @Nullable + public static IFissionFuelStats getFissionFuel(ItemStack stack) { + return FUELS.get(stack); + } + + @Nullable + public static IFissionFuelStats getFissionFuel(int hash) { + return HASHED_FUELS.get(hash); + } + @Nullable + public static ItemStack getDepletedFuel(IFissionFuelStats stats) { + return DEPLETED_FUELS.get(stats); + } } diff --git a/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java b/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java index 14599062f81..ab20b135455 100644 --- a/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java +++ b/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java @@ -4,12 +4,10 @@ import gregtech.api.nuclear.fission.components.CoolantChannel; import gregtech.api.nuclear.fission.components.FuelRod; import gregtech.api.nuclear.fission.components.ReactorComponent; -import gregtech.api.unification.material.Material; -import gregtech.api.unification.material.properties.CoolantProperty; -import gregtech.api.unification.material.properties.PropertyKey; import gregtech.common.ConfigHolder; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; @@ -427,11 +425,14 @@ public void prepareInitialConditions() { weightedGenerationTime /= fuelRods.size(); for (CoolantChannel channel : coolantChannels) { - CoolantProperty prop = channel.getCoolant().getProperty(PropertyKey.COOLANT); + ICoolantStats prop = channel.getCoolant(); + Fluid fluid = CoolantRegistry.originalFluid(prop); - coolantBaseTemperature += channel.getCoolant().getFluid().getTemperature(); + if (fluid != null) { + coolantBaseTemperature += fluid.getTemperature(); + } coolantBoilingPointStandardPressure += prop.getBoilingPoint(); - coolantExitTemperature += prop.getHotHPCoolant().getFluid().getTemperature(); + coolantExitTemperature += prop.getHotCoolant().getTemperature(); coolantHeatOfVaporization += prop.getHeatOfVaporization(); } @@ -465,18 +466,17 @@ public double makeCoolantFlow(int flowRate) { if (tryFluidDrain != null) { int drained = tryFluidDrain.amount; - Material coolant = channel.getCoolant(); - - CoolantProperty prop = coolant.getProperty(PropertyKey.COOLANT); + ICoolantStats prop = channel.getCoolant(); + int coolantTemp = CoolantRegistry.originalFluid(prop).getTemperature(); - double cooledTemperature = prop.getHotHPCoolant().getFluid().getTemperature(); + double cooledTemperature = prop.getHotCoolant().getTemperature(); if (cooledTemperature > this.temperature) { continue; } double heatRemovedPerLiter = prop.getSpecificHeatCapacity() / ConfigHolder.machines.nuclear.fissionCoolantDivisor * - (cooledTemperature - coolant.getFluid().getTemperature()); + (cooledTemperature - coolantTemp); // Explained by: // https://physics.stackexchange.com/questions/153434/heat-transfer-between-the-bulk-of-the-fluid-inside-the-pipe-and-the-pipe-externa double heatFluxPerAreaAndTemp = 1 / @@ -500,13 +500,13 @@ public double makeCoolantFlow(int flowRate) { channel.partialCoolant += cappedFluidUsed - actualFlowRate; FluidStack HPCoolant = new FluidStack( - prop.getHotHPCoolant().getFluid(), actualFlowRate); + prop.getHotCoolant(), actualFlowRate); channel.getInputHandler().getFluidTank().drain(actualFlowRate, true); channel.getOutputHandler().getFluidTank().fill(HPCoolant, true); if (prop.accumulatesHydrogen() && this.temperature > zircaloyHydrogenReactionTemperature) { - double boilingPoint = coolantBoilingPoint(coolant); + double boilingPoint = coolantBoilingPoint(prop); if (this.temperature > boilingPoint) { this.accumulatedHydrogen += (this.temperature - boilingPoint) / boilingPoint; } else if (actualFlowRate < Math.min(remainingSpace, idealFluidUsed)) { @@ -515,7 +515,7 @@ public double makeCoolantFlow(int flowRate) { } } - this.coolantMass += cappedFluidUsed * coolant.getMass(); + this.coolantMass += cappedFluidUsed * prop.getMass(); heatRemoved += cappedFluidUsed * heatRemovedPerLiter; } } @@ -533,13 +533,13 @@ protected double coolantBoilingPoint() { R * Math.log(this.pressure / standardPressure) / this.coolantHeatOfVaporization); } - protected double coolantBoilingPoint(Material coolant) { - if (coolant.getProperty(PropertyKey.COOLANT).getBoilingPoint() == 0) { + protected double coolantBoilingPoint(ICoolantStats coolant) { + if (coolant.getBoilingPoint() == 0) { return coolantBoilingPoint(); } - return 1. / (1. / coolant.getProperty(PropertyKey.COOLANT).getBoilingPoint() - + return 1. / (1. / coolant.getBoilingPoint() - R * Math.log(this.pressure / standardPressure) / - coolant.getProperty(PropertyKey.COOLANT).getHeatOfVaporization()); + coolant.getHeatOfVaporization()); } public void updateTemperature(int flowRate) { diff --git a/src/main/java/gregtech/api/nuclear/fission/ICoolantStats.java b/src/main/java/gregtech/api/nuclear/fission/ICoolantStats.java index 71d0dc25d67..fc050593b81 100644 --- a/src/main/java/gregtech/api/nuclear/fission/ICoolantStats.java +++ b/src/main/java/gregtech/api/nuclear/fission/ICoolantStats.java @@ -5,9 +5,9 @@ public interface ICoolantStats { /** - * @return The fluid with these cooling properties. + * @return The heated coolant fluid. */ - Fluid getFluid(); + Fluid getHotCoolant(); /** * @return The specific heat capacity of the fluid in J/(kg*K). @@ -30,9 +30,19 @@ public interface ICoolantStats { */ double getBoilingPoint(); + /** + * @return The heat of vaporization of the fluid in J/(kg*K). + */ + double getHeatOfVaporization(); + /** * @return If the coolant reacts with zirconium cladding at high temperatures. This is true for mostly water-based * coolants. */ boolean accumulatesHydrogen(); + + /** + * @return The mass of the coolant per liter in kg + */ + double getMass(); } diff --git a/src/main/java/gregtech/api/nuclear/fission/IFissionFuelStats.java b/src/main/java/gregtech/api/nuclear/fission/IFissionFuelStats.java index d84dfa540d6..3ea170c9d99 100644 --- a/src/main/java/gregtech/api/nuclear/fission/IFissionFuelStats.java +++ b/src/main/java/gregtech/api/nuclear/fission/IFissionFuelStats.java @@ -7,10 +7,37 @@ public interface IFissionFuelStats { /** - * Used internally to get the depleted fuel the first time; do not call this yourself! - * - * @return The depleted fuel to be put into the fuel registry. + * @return The maximum temperature the fuel can handle before the reactor melts down. */ - @NotNull - ItemStack getDepletedFuel(); + int getMaxTemperature(); + + /** + * @return How long the fuel lasts in the reactor, in terms of the megajoules it makes. + */ + int getDuration(); + + /** + * @return The cross section of slow neutrons that can be captured by this fuel to breed it. + */ + double getSlowNeutronCaptureCrossSection(); + + /** + * @return The cross section of fast neutrons that can be captured by this fuel to breed it. + */ + double getFastNeutronCaptureCrossSection(); + + /** + * @return The cross section of slow neutrons that can cause fission in this fuel. + */ + double getSlowNeutronFissionCrossSection(); + + /** + * @return The cross section of fast neutrons that can cause fission in this fuel. + */ + double getFastNeutronFissionCrossSection(); + + /** + * @return The average time for a neutron to be emitted during a fission event. Do not make this accurate. + */ + double getNeutronGenerationTime(); } diff --git a/src/main/java/gregtech/api/nuclear/fission/components/CoolantChannel.java b/src/main/java/gregtech/api/nuclear/fission/components/CoolantChannel.java index c10c2ef4aaa..d004fdc7ada 100644 --- a/src/main/java/gregtech/api/nuclear/fission/components/CoolantChannel.java +++ b/src/main/java/gregtech/api/nuclear/fission/components/CoolantChannel.java @@ -1,6 +1,7 @@ package gregtech.api.nuclear.fission.components; import gregtech.api.capability.ICoolantHandler; +import gregtech.api.nuclear.fission.ICoolantStats; import gregtech.api.unification.material.Material; import gregtech.api.unification.material.properties.PropertyKey; @@ -8,7 +9,7 @@ public class CoolantChannel extends ReactorComponent { - private final Material coolant; + private final ICoolantStats coolant; private double weight; private int relatedFuelRodPairs; @@ -18,9 +19,9 @@ public class CoolantChannel extends ReactorComponent { // Allows fission reactors to heat up less than a full liter of coolant. public double partialCoolant; - public CoolantChannel(double maxTemperature, double thermalConductivity, Material coolant, double mass, + public CoolantChannel(double maxTemperature, double thermalConductivity, ICoolantStats coolant, double mass, ICoolantHandler inputHandler, ICoolantHandler outputHandler) { - super(coolant.getProperty(PropertyKey.COOLANT).getModeratorFactor(), maxTemperature, thermalConductivity, mass, + super(coolant.getModeratorFactor(), maxTemperature, thermalConductivity, mass, true); this.coolant = coolant; this.weight = 0; @@ -50,7 +51,7 @@ public void setWeight(double weight) { this.weight = weight; } - public Material getCoolant() { + public ICoolantStats getCoolant() { return coolant; } diff --git a/src/main/java/gregtech/api/nuclear/fission/components/FuelRod.java b/src/main/java/gregtech/api/nuclear/fission/components/FuelRod.java index f5e64fcd266..e90320a1275 100644 --- a/src/main/java/gregtech/api/nuclear/fission/components/FuelRod.java +++ b/src/main/java/gregtech/api/nuclear/fission/components/FuelRod.java @@ -1,12 +1,12 @@ package gregtech.api.nuclear.fission.components; -import gregtech.api.unification.material.properties.FissionFuelProperty; +import gregtech.api.nuclear.fission.IFissionFuelStats; public class FuelRod extends ReactorComponent { - private FissionFuelProperty fuel; + private IFissionFuelStats fuel; - public FuelRod(double maxTemperature, double thermalConductivity, FissionFuelProperty fuel, double mass) { + public FuelRod(double maxTemperature, double thermalConductivity, IFissionFuelStats fuel, double mass) { super(0, maxTemperature, thermalConductivity, mass, true); this.fuel = fuel; } @@ -35,11 +35,11 @@ public double getNeutronGenerationTime() { return fuel.getNeutronGenerationTime(); } - public FissionFuelProperty getFuel() { + public IFissionFuelStats getFuel() { return fuel; } - public void setFuel(FissionFuelProperty property) { + public void setFuel(IFissionFuelStats property) { this.fuel = property; this.maxTemperature = property.getMaxTemperature(); } diff --git a/src/main/java/gregtech/api/unification/material/Material.java b/src/main/java/gregtech/api/unification/material/Material.java index e3c8be1f2a3..2fabc56ddf3 100644 --- a/src/main/java/gregtech/api/unification/material/Material.java +++ b/src/main/java/gregtech/api/unification/material/Material.java @@ -1098,27 +1098,6 @@ public Builder fissionFuel(int maxTemperature, int duration, double slowNeutronC return this; } - public Builder coolant(Material hotHPCoolant, double moderatorFactor, double coolingFactor, - double boilingPoint, - double heatOfVaporization, double specificHeatCapacity) { - properties.ensureSet(PropertyKey.FLUID); - properties.setProperty(PropertyKey.COOLANT, - new CoolantProperty(hotHPCoolant, properties.getProperty(PropertyKey.FLUID).getPrimaryKey(), - moderatorFactor, coolingFactor, boilingPoint, heatOfVaporization, - specificHeatCapacity)); - return this; - } - - public Builder coolant(Material hotHPCoolant, FluidStorageKey key, double moderatorFactor, - double coolingFactor, double boilingPoint, - double heatOfVaporization, double specificHeatCapacity) { - properties.ensureSet(PropertyKey.FLUID); - properties.setProperty(PropertyKey.COOLANT, - new CoolantProperty(hotHPCoolant, key, moderatorFactor, coolingFactor, boilingPoint, - heatOfVaporization, specificHeatCapacity)); - return this; - } - // TODO Clean this up post 2.5 release @Deprecated public Builder addDefaultEnchant(Enchantment enchant, int level) { diff --git a/src/main/java/gregtech/api/unification/material/materials/MaterialFlagAddition.java b/src/main/java/gregtech/api/unification/material/materials/MaterialFlagAddition.java index 2e2f11b3610..4fef275bfba 100644 --- a/src/main/java/gregtech/api/unification/material/materials/MaterialFlagAddition.java +++ b/src/main/java/gregtech/api/unification/material/materials/MaterialFlagAddition.java @@ -412,7 +412,7 @@ public static void register() { * This sometimes cross-references materials */ DistilledWater.setProperty(PropertyKey.COOLANT, - new CoolantProperty(HighPressureSteam, FluidStorageKeys.LIQUID, 1., 1000, + new CoolantProperty(DistilledWater, HighPressureSteam, FluidStorageKeys.LIQUID, 1., 1000, 373, 2260000, 4168.) .setAccumulatesHydrogen(true)); } diff --git a/src/main/java/gregtech/api/unification/material/properties/CoolantProperty.java b/src/main/java/gregtech/api/unification/material/properties/CoolantProperty.java index 81eb97916f8..93827bfab65 100644 --- a/src/main/java/gregtech/api/unification/material/properties/CoolantProperty.java +++ b/src/main/java/gregtech/api/unification/material/properties/CoolantProperty.java @@ -6,9 +6,8 @@ import net.minecraftforge.fluids.Fluid; -public class CoolantProperty implements IMaterialProperty { +public class CoolantProperty implements IMaterialProperty, ICoolantStats { - private ICoolantStats stats; private Material hotHPCoolant; private double moderatorFactor; /** @@ -26,7 +25,9 @@ public class CoolantProperty implements IMaterialProperty { // To store the specific key private FluidStorageKey key; - public CoolantProperty(Material hotHPCoolant, FluidStorageKey key, double moderatorFactor, double coolingFactor, + private double mass; + + public CoolantProperty(Material mat, Material hotHPCoolant, FluidStorageKey key, double moderatorFactor, double coolingFactor, double boilingPoint, double heatOfVaporization, double specificHeatCapacity) { this.hotHPCoolant = hotHPCoolant; @@ -36,6 +37,7 @@ public CoolantProperty(Material hotHPCoolant, FluidStorageKey key, double modera this.heatOfVaporization = heatOfVaporization; this.specificHeatCapacity = specificHeatCapacity; this.key = key; + this.mass = mat.getMass(); } @Override @@ -100,7 +102,15 @@ public CoolantProperty setAccumulatesHydrogen(boolean accumulatesHydrogen) { return this; } - public boolean isCorrectFluid(Material material, Fluid fluid) { - return material.getFluid(key) == fluid; + public Fluid getHotCoolant() { + return hotHPCoolant.getFluid(); + } + + public FluidStorageKey getCoolantKey() { + return key; + } + + public double getMass() { + return mass; } } diff --git a/src/main/java/gregtech/api/unification/material/properties/FissionFuelProperty.java b/src/main/java/gregtech/api/unification/material/properties/FissionFuelProperty.java index 549d4255330..8a48f76ccc5 100644 --- a/src/main/java/gregtech/api/unification/material/properties/FissionFuelProperty.java +++ b/src/main/java/gregtech/api/unification/material/properties/FissionFuelProperty.java @@ -1,6 +1,15 @@ package gregtech.api.unification.material.properties; -public class FissionFuelProperty implements IMaterialProperty { +import gregtech.api.nuclear.fission.IFissionFuelStats; +import gregtech.api.unification.OreDictUnifier; + +import gregtech.api.unification.ore.OrePrefix; + +import net.minecraft.item.ItemStack; + +import org.jetbrains.annotations.NotNull; + +public class FissionFuelProperty implements IMaterialProperty, IFissionFuelStats { // The max temperature the fuel can handle before it liquefies. private int maxTemperature; @@ -34,6 +43,7 @@ public FissionFuelProperty(int maxTemperature, int duration, double slowNeutronC this.neutronGenerationTime = neutronGenerationTime; } + @Override public int getMaxTemperature() { return maxTemperature; } @@ -43,6 +53,7 @@ public void setMaxTemperature(int maxTemperature) { this.maxTemperature = maxTemperature; } + @Override public int getDuration() { return duration; } @@ -52,6 +63,7 @@ public void setDuration(int duration) { this.duration = duration; } + @Override public double getSlowNeutronCaptureCrossSection() { return slowNeutronCaptureCrossSection; } @@ -60,6 +72,7 @@ public void setSlowNeutronCaptureCrossSection(double slowNeutronCaptureCrossSect this.slowNeutronCaptureCrossSection = slowNeutronCaptureCrossSection; } + @Override public double getFastNeutronCaptureCrossSection() { return fastNeutronCaptureCrossSection; } @@ -68,6 +81,7 @@ public void setFastNeutronCaptureCrossSection(double fastNeutronCaptureCrossSect this.fastNeutronCaptureCrossSection = fastNeutronCaptureCrossSection; } + @Override public double getSlowNeutronFissionCrossSection() { return slowNeutronFissionCrossSection; } @@ -76,6 +90,7 @@ public void setSlowNeutronFissionCrossSection(double slowNeutronFissionCrossSect this.slowNeutronFissionCrossSection = slowNeutronFissionCrossSection; } + @Override public double getFastNeutronFissionCrossSection() { return fastNeutronFissionCrossSection; } @@ -84,6 +99,7 @@ public void setFastNeutronFissionCrossSection(double fastNeutronFissionCrossSect this.fastNeutronFissionCrossSection = fastNeutronFissionCrossSection; } + @Override public double getNeutronGenerationTime() { return neutronGenerationTime; } diff --git a/src/main/java/gregtech/api/util/FluidTooltipUtil.java b/src/main/java/gregtech/api/util/FluidTooltipUtil.java index 96684bb6bfd..b8a6167a256 100644 --- a/src/main/java/gregtech/api/util/FluidTooltipUtil.java +++ b/src/main/java/gregtech/api/util/FluidTooltipUtil.java @@ -2,6 +2,8 @@ import gregtech.api.fluids.FluidState; import gregtech.api.fluids.GTFluid; +import gregtech.api.nuclear.fission.CoolantRegistry; +import gregtech.api.nuclear.fission.ICoolantStats; import gregtech.api.unification.material.Material; import gregtech.api.unification.material.properties.CoolantProperty; import gregtech.api.unification.material.properties.PropertyKey; @@ -109,22 +111,20 @@ public static Supplier> createFluidTooltip(@Nullable Material mater tooltip.add(I18n.format("gregtech.fluid.temperature.cryogenic")); } - if (material.hasProperty(PropertyKey.COOLANT)) { - CoolantProperty coolant = material.getProperty(PropertyKey.COOLANT); - if (coolant.isCorrectFluid(material, fluid)) { - tooltip.add(I18n.format("gregtech.coolant.general")); - tooltip.add(I18n.format("gregtech.coolant.boiling_point", - coolant.getBoilingPoint(), - coolant.getHotHPCoolant().getFluid().getTemperature())); - tooltip.add(I18n.format("gregtech.coolant.heat_capacity", - coolant.getSpecificHeatCapacity())); - tooltip.add(I18n.format("gregtech.coolant.cooling_factor", - coolant.getCoolingFactor())); - tooltip.add(I18n.format("gregtech.coolant.moderation_factor", - coolant.getModeratorFactor())); - if (coolant.accumulatesHydrogen()) { - tooltip.add(I18n.format("gregtech.coolant.accumulates_hydrogen")); - } + ICoolantStats coolant = CoolantRegistry.getCoolant(fluid); + if (coolant != null) { + tooltip.add(I18n.format("gregtech.coolant.general")); + tooltip.add(I18n.format("gregtech.coolant.boiling_point", + coolant.getBoilingPoint(), + coolant.getHotCoolant().getTemperature())); + tooltip.add(I18n.format("gregtech.coolant.heat_capacity", + coolant.getSpecificHeatCapacity())); + tooltip.add(I18n.format("gregtech.coolant.cooling_factor", + coolant.getCoolingFactor())); + tooltip.add(I18n.format("gregtech.coolant.moderation_factor", + coolant.getModeratorFactor())); + if (coolant.accumulatesHydrogen()) { + tooltip.add(I18n.format("gregtech.coolant.accumulates_hydrogen")); } } return tooltip; diff --git a/src/main/java/gregtech/common/CommonProxy.java b/src/main/java/gregtech/common/CommonProxy.java index b9b14c916da..4c4b68fb771 100644 --- a/src/main/java/gregtech/common/CommonProxy.java +++ b/src/main/java/gregtech/common/CommonProxy.java @@ -7,14 +7,19 @@ import gregtech.api.items.metaitem.MetaItem; import gregtech.api.items.toolitem.IGTTool; import gregtech.api.metatileentity.registry.MTERegistry; +import gregtech.api.nuclear.fission.CoolantRegistry; +import gregtech.api.nuclear.fission.FissionFuelRegistry; import gregtech.api.recipes.GTRecipeInputCache; import gregtech.api.recipes.ModHandler; import gregtech.api.recipes.ingredients.GTRecipeOreInput; import gregtech.api.recipes.recipeproperties.FusionEUToStartProperty; import gregtech.api.terminal.TerminalRegistry; +import gregtech.api.unification.OreDictUnifier; import gregtech.api.unification.material.Material; import gregtech.api.unification.material.info.MaterialFlags; +import gregtech.api.unification.material.properties.CoolantProperty; import gregtech.api.unification.material.properties.DustProperty; +import gregtech.api.unification.material.properties.FissionFuelProperty; import gregtech.api.unification.material.properties.PropertyKey; import gregtech.api.unification.material.registry.MaterialRegistry; import gregtech.api.unification.ore.OrePrefix; @@ -423,6 +428,18 @@ public void onPostLoad() { if (ConfigHolder.compat.removeSmeltingForEBFMetals) { ModHandler.removeSmeltingEBFMetals(); } + + for (Material material : GregTechAPI.materialManager.getRegisteredMaterials()) { + if (material.hasProperty(PropertyKey.FISSION_FUEL)) { + FissionFuelProperty prop = material.getProperty(PropertyKey.FISSION_FUEL); + FissionFuelRegistry.registerFuel(OreDictUnifier.get(OrePrefix.fuelRod, material), prop, + OreDictUnifier.get(OrePrefix.fuelRodHotDepleted, material)); + } + if (material.hasProperty(PropertyKey.COOLANT)) { + CoolantProperty prop = material.getProperty(PropertyKey.COOLANT); + CoolantRegistry.registerCoolant(material.getFluid(prop.getCoolantKey()), prop); + } + } } public void onLoadComplete() { diff --git a/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java b/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java index 7db3563d319..8bba38bf31f 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java +++ b/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java @@ -24,7 +24,11 @@ import gregtech.api.metatileentity.multiblock.IProgressBarMultiblock; import gregtech.api.metatileentity.multiblock.MultiblockAbility; import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; +import gregtech.api.nuclear.fission.CoolantRegistry; +import gregtech.api.nuclear.fission.FissionFuelRegistry; import gregtech.api.nuclear.fission.FissionReactor; +import gregtech.api.nuclear.fission.ICoolantStats; +import gregtech.api.nuclear.fission.IFissionFuelStats; import gregtech.api.nuclear.fission.components.ControlRod; import gregtech.api.nuclear.fission.components.CoolantChannel; import gregtech.api.nuclear.fission.components.FuelRod; @@ -34,15 +38,7 @@ import gregtech.api.pattern.PatternMatchContext; import gregtech.api.pattern.PatternStringError; import gregtech.api.pattern.TraceabilityPredicate; -import gregtech.api.unification.FluidUnifier; -import gregtech.api.unification.OreDictUnifier; -import gregtech.api.unification.material.Material; import gregtech.api.unification.material.Materials; -import gregtech.api.unification.material.properties.CoolantProperty; -import gregtech.api.unification.material.properties.FissionFuelProperty; -import gregtech.api.unification.material.properties.PropertyKey; -import gregtech.api.unification.ore.OrePrefix; -import gregtech.api.unification.stack.MaterialStack; import gregtech.api.util.BlockInfo; import gregtech.api.util.GTStringUtils; import gregtech.api.util.GTUtility; @@ -58,6 +54,8 @@ import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityControlRodPort; import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityCoolantExportHatch; +import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityFuelRodImportBus; + import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; @@ -87,7 +85,7 @@ import java.util.Objects; public class MetaTileEntityFissionReactor extends MultiblockWithDisplayBase - implements IDataInfoProvider, IProgressBarMultiblock, ICustomEnergyCover { + implements IDataInfoProvider, IProgressBarMultiblock, ICustomEnergyCover { private FissionReactor fissionReactor; private int diameter; @@ -131,21 +129,21 @@ protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) { () -> this.getFillPercentage(0), 4, 115, 76, 7, GuiTextures.PROGRESS_BAR_FISSION_HEAT, ProgressWidget.MoveType.HORIZONTAL) - .setHoverTextConsumer(list -> this.addBarHoverText(list, 0)); + .setHoverTextConsumer(list -> this.addBarHoverText(list, 0)); builder.widget(progressBar); progressBar = new ProgressWidget( () -> this.getFillPercentage(1), 82, 115, 76, 7, GuiTextures.PROGRESS_BAR_FISSION_PRESSURE, ProgressWidget.MoveType.HORIZONTAL) - .setHoverTextConsumer(list -> this.addBarHoverText(list, 1)); + .setHoverTextConsumer(list -> this.addBarHoverText(list, 1)); builder.widget(progressBar); progressBar = new ProgressWidget( () -> this.getFillPercentage(2), 160, 115, 76, 7, GuiTextures.PROGRESS_BAR_FISSION_ENERGY, ProgressWidget.MoveType.HORIZONTAL) - .setHoverTextConsumer(list -> this.addBarHoverText(list, 2)); + .setHoverTextConsumer(list -> this.addBarHoverText(list, 2)); builder.widget(progressBar); builder.label(9, 9, getMetaFullName(), 0xFFFFFF); @@ -163,7 +161,7 @@ protected String getDisplayString() { }.setBackground(GuiTextures.DARK_SLIDER_BACKGROUND).setSliderIcon(GuiTextures.DARK_SLIDER_ICON)); builder.widget(new SliderWidget("gregtech.gui.fission.coolant_flow", 10, 80, 220, 18, 0.0f, 16000.f, flowRate, this::setFlowRate).setBackground(GuiTextures.DARK_SLIDER_BACKGROUND) - .setSliderIcon(GuiTextures.DARK_SLIDER_ICON)); + .setSliderIcon(GuiTextures.DARK_SLIDER_ICON)); builder.widget(new AdvancedTextWidget(9, 20, this::addDisplayText, 0xFFFFFF) .setMaxWidthLimit(220) @@ -173,7 +171,7 @@ protected String getDisplayString() { builder.widget(new ToggleButtonWidget(215, 183, 18, 18, GuiTextures.BUTTON_LOCK, this::isLocked, this::tryLocking).shouldUseBaseBackground() - .setTooltipText("gregtech.gui.fission.lock")); + .setTooltipText("gregtech.gui.fission.lock")); builder.widget(new ImageWidget(215, 201, 18, 6, GuiTextures.BUTTON_POWER_DETAIL)); // Voiding Mode Button @@ -208,7 +206,7 @@ public double getFillPercentage(int index) { protected @NotNull Widget getFlexButton(int x, int y, int width, int height) { return new ToggleButtonWidget(x, y, width, height, this::areControlRodsRegulated, this::toggleControlRodRegulation).setButtonTexture(GuiTextures.BUTTON_CONTROL_ROD_HELPER) - .setTooltipText("gregtech.gui.fission.helper"); + .setTooltipText("gregtech.gui.fission.helper"); } /** @@ -382,28 +380,26 @@ public void updateFormedValid() { canWork = false; this.lockingState = LockingState.MISSING_FUEL; break; - } /* - * TODO else if (!((MetaTileEntityFuelRodImportBus) fuelImport).getExportHatch(this.height - - * 1) - * .getExportItems().insertItem(0, - * OreDictUnifier.get(OrePrefix.fuelRodHotDepleted, fuelImport.getFuel()), true) - * .isEmpty()) { - * // We still need to know if the output is blocked, even if the recipe doesn't start - * // yet - * canWork = false; - * this.lockingState = LockingState.FUEL_CLOGGED; - * break; - * } - */ + } else if (!((MetaTileEntityFuelRodImportBus) fuelImport).getExportHatch(this.height - + 1) + .getExportItems().insertItem(0, + FissionFuelRegistry.getDepletedFuel(fuelImport.getFuel()), true) + .isEmpty()) { + // We still need to know if the output is blocked, even if the recipe doesn't start + // yet + canWork = false; + this.lockingState = LockingState.FUEL_CLOGGED; + break; + } + } for (IFuelRodHandler fuelImport : this.getAbilities(MultiblockAbility.IMPORT_FUEL_ROD)) { if (fissionReactor.needsOutput()) { - // TODO ((MetaTileEntityFuelRodImportBus) fuelImport).getExportHatch(this.height - 1) - // .getExportItems().insertItem(0, - // OreDictUnifier.get(OrePrefix.fuelRodHotDepleted, - // fuelImport.getPartialFuel()), - // false); + ((MetaTileEntityFuelRodImportBus) fuelImport).getExportHatch(this.height - 1) + .getExportItems().insertItem(0, + FissionFuelRegistry.getDepletedFuel(fuelImport.getPartialFuel()), + false); this.fissionReactor.changeFuelMass(-60); } if (canWork) { @@ -582,19 +578,19 @@ public TraceabilityPredicate getImportPredicate() { MultiblockAbility[] allowedAbilities = { MultiblockAbility.IMPORT_COOLANT, MultiblockAbility.IMPORT_FUEL_ROD, MultiblockAbility.CONTROL_ROD_PORT }; return tilePredicate((state, tile) -> { - if (!(tile instanceof IMultiblockAbilityPart && - ArrayUtils.contains(allowedAbilities, ((IMultiblockAbilityPart) tile).getAbility()))) { - return false; - } - if (tile instanceof IFissionReactorHatch hatchPart) { - if (!hatchPart.checkValidity(height - 1)) { - state.setError(new PatternStringError("gregtech.multiblock.pattern.error.hatch_invalid")); + if (!(tile instanceof IMultiblockAbilityPart && + ArrayUtils.contains(allowedAbilities, ((IMultiblockAbilityPart) tile).getAbility()))) { + return false; + } + if (tile instanceof IFissionReactorHatch hatchPart) { + if (!hatchPart.checkValidity(height - 1)) { + state.setError(new PatternStringError("gregtech.multiblock.pattern.error.hatch_invalid")); + return false; + } + return true; + } return false; - } - return true; - } - return false; - }, + }, () -> Arrays.stream(allowedAbilities) .flatMap(ability -> MultiblockAbility.REGISTRY.get(ability).stream()) .filter(Objects::nonNull).map(tile -> { @@ -847,19 +843,17 @@ private void lockAndPrepareReactor() { if (mte instanceof ICoolantHandler coolantIn) { Fluid lockedFluid = coolantIn.getLockedObject(); if (lockedFluid != null) { - Material mat = FluidUnifier.getMaterialFromFluid(lockedFluid); - if (mat != null && mat.hasProperty(PropertyKey.COOLANT) && - mat.getProperty(PropertyKey.COOLANT).isCorrectFluid(mat, lockedFluid)) { - CoolantProperty prop = mat.getProperty(PropertyKey.COOLANT); - coolantIn.setCoolant(prop); + ICoolantStats stats = CoolantRegistry.getCoolant(lockedFluid); + if (stats != null) { + coolantIn.setCoolant(stats); BlockPos exportHatchPos = currentPos.offset(coolantIn.getFrontFacing().getOpposite(), height - 1); if (getWorld().getTileEntity( exportHatchPos) instanceof IGregTechTileEntity coolantOutCandidate) { MetaTileEntity coolantOutMTE = coolantOutCandidate.getMetaTileEntity(); if (coolantOutMTE instanceof MetaTileEntityCoolantExportHatch coolantOut) { - coolantOut.setCoolant(prop); - CoolantChannel component = new CoolantChannel(100050, 0, mat, 1000, coolantIn, + coolantOut.setCoolant(stats); + CoolantChannel component = new CoolantChannel(100050, 0, stats, 1000, coolantIn, coolantOut); fissionReactor.addComponent(component, i + radius - 1, j + radius - 1); continue; @@ -873,27 +867,24 @@ private void lockAndPrepareReactor() { } else if (mte instanceof IFuelRodHandler fuelIn) { ItemStack lockedFuel = fuelIn.getStackHandler().getStackInSlot(0); if (!lockedFuel.isEmpty()) { - MaterialStack mat = OreDictUnifier.getMaterial(lockedFuel); - if (mat != null && OreDictUnifier.getPrefix(lockedFuel) == OrePrefix.fuelRod) { - FissionFuelProperty property = mat.material.getProperty(PropertyKey.FISSION_FUEL); - if (property != null) { - FuelRod component; - fuelIn.setFuel(property); - foundFuel = true; - if (fissionReactor.getFuelDepletion() == 0 || fuelIn.getPartialFuel() == null) { - fuelIn.setPartialFuel(property); - component = new FuelRod(property.getMaxTemperature(), 1, property, 650); - fuelIn.setInternalFuelRod(component); - } else { - // It's guaranteed to have this property (if the implementation is correct). - FissionFuelProperty partialProp = fuelIn.getPartialFuel(); - component = new FuelRod(partialProp.getMaxTemperature(), 1, partialProp, 650); - fuelIn.setInternalFuelRod(component); - } + IFissionFuelStats stats = FissionFuelRegistry.getFissionFuel(lockedFuel); + if (stats != null) { + FuelRod component; + fuelIn.setFuel(stats); + foundFuel = true; + if (fissionReactor.getFuelDepletion() == 0 || fuelIn.getPartialFuel() == null) { + fuelIn.setPartialFuel(stats); + component = new FuelRod(stats.getMaxTemperature(), 1, stats, 650); + fuelIn.setInternalFuelRod(component); + } else { + // It's guaranteed to have this property (if the implementation is correct). + IFissionFuelStats partialProp = fuelIn.getPartialFuel(); + component = new FuelRod(partialProp.getMaxTemperature(), 1, partialProp, 650); fuelIn.setInternalFuelRod(component); - fissionReactor.addComponent(component, i + radius - 1, j + radius - 1); - continue; } + fuelIn.setInternalFuelRod(component); + fissionReactor.addComponent(component, i + radius - 1, j + radius - 1); + continue; } } this.unlockAll(); diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantExportHatch.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantExportHatch.java index b89de65c5d1..8736fa4e168 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantExportHatch.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantExportHatch.java @@ -16,6 +16,7 @@ import gregtech.api.metatileentity.multiblock.IFissionReactorHatch; import gregtech.api.metatileentity.multiblock.IMultiblockAbilityPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.nuclear.fission.ICoolantStats; import gregtech.api.unification.material.properties.CoolantProperty; import gregtech.client.renderer.texture.Textures; @@ -43,7 +44,7 @@ public class MetaTileEntityCoolantExportHatch extends MetaTileEntityMultiblockNo private boolean workingEnabled; private LockableFluidTank fluidTank; - private CoolantProperty coolant; + private ICoolantStats coolant; public MetaTileEntityCoolantExportHatch(ResourceLocation metaTileEntityId) { super(metaTileEntityId, 4, true); @@ -127,12 +128,12 @@ public Fluid getLockedObject() { } @Override - public CoolantProperty getCoolant() { + public ICoolantStats getCoolant() { return this.coolant; } @Override - public void setCoolant(CoolantProperty prop) { + public void setCoolant(ICoolantStats prop) { this.coolant = prop; } diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantImportHatch.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantImportHatch.java index 6caf7bbb38b..1f95e9fa1e2 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantImportHatch.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantImportHatch.java @@ -16,6 +16,7 @@ import gregtech.api.metatileentity.multiblock.IFissionReactorHatch; import gregtech.api.metatileentity.multiblock.IMultiblockAbilityPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.nuclear.fission.ICoolantStats; import gregtech.api.unification.material.properties.CoolantProperty; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockFissionCasing; @@ -52,7 +53,7 @@ public class MetaTileEntityCoolantImportHatch extends MetaTileEntityMultiblockNo private boolean workingEnabled; private LockableFluidTank fluidTank; - private CoolantProperty coolant; + private ICoolantStats coolant; public MetaTileEntityCoolantImportHatch(ResourceLocation metaTileEntityId) { super(metaTileEntityId, 4, false); @@ -183,12 +184,12 @@ public void readFromNBT(NBTTagCompound data) { } @Override - public CoolantProperty getCoolant() { + public ICoolantStats getCoolant() { return this.coolant; } @Override - public void setCoolant(CoolantProperty prop) { + public void setCoolant(ICoolantStats prop) { this.coolant = prop; } diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityFuelRodImportBus.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityFuelRodImportBus.java index fe5edd5c762..17f63c9aea0 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityFuelRodImportBus.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityFuelRodImportBus.java @@ -11,6 +11,8 @@ import gregtech.api.metatileentity.multiblock.IFissionReactorHatch; import gregtech.api.metatileentity.multiblock.IMultiblockAbilityPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.nuclear.fission.FissionFuelRegistry; +import gregtech.api.nuclear.fission.IFissionFuelStats; import gregtech.api.nuclear.fission.components.FuelRod; import gregtech.api.unification.material.properties.FissionFuelProperty; import gregtech.client.renderer.texture.Textures; @@ -44,9 +46,9 @@ public class MetaTileEntityFuelRodImportBus extends MetaTileEntityMultiblockNoti IControllable, IFissionReactorHatch { private boolean workingEnabled; - private FissionFuelProperty fuelProperty; + private IFissionFuelStats fuelProperty; public MetaTileEntityFuelRodExportBus pairedHatch; - private FissionFuelProperty partialFuel; + private IFissionFuelStats partialFuel; private FuelRod internalFuelRod; public MetaTileEntityFuelRodImportBus(ResourceLocation metaTileEntityId) { @@ -131,7 +133,7 @@ public void readFromNBT(NBTTagCompound data) { super.readFromNBT(data); getLockedImport().setLock(data.getBoolean("locked")); if (data.hasKey("partialFuel")) { - // TODO this.partialFuel = GregTechAPI.materialManager.getMaterial(data.getString("partialFuel")); + this.partialFuel = FissionFuelRegistry.getFissionFuel(data.getInteger("partialFuel")); } } @@ -139,7 +141,7 @@ public void readFromNBT(NBTTagCompound data) { public NBTTagCompound writeToNBT(NBTTagCompound data) { data.setBoolean("locked", getLockedImport().isLocked()); if (partialFuel != null) - data.setString("partialFuel", this.partialFuel.toString()); + data.setInteger("partialFuel", this.partialFuel.hashCode()); return super.writeToNBT(data); } @@ -191,22 +193,22 @@ public ItemStack getLockedObject() { } @Override - public FissionFuelProperty getFuel() { + public IFissionFuelStats getFuel() { return this.fuelProperty; } @Override - public void setFuel(FissionFuelProperty prop) { + public void setFuel(IFissionFuelStats prop) { this.fuelProperty = prop; } @Override - public FissionFuelProperty getPartialFuel() { + public IFissionFuelStats getPartialFuel() { return this.partialFuel; } @Override - public boolean setPartialFuel(FissionFuelProperty prop) { + public boolean setPartialFuel(IFissionFuelStats prop) { this.partialFuel = prop; if (this.internalFuelRod != null) { this.internalFuelRod.setFuel(prop);