Skip to content

Conversation

@bukowski912
Copy link
Contributor

Changes proposed in this pull request:

  • Add getter to IChemicalAttribute for a Holder<?> and a helper for a Holder<Chemical>
  • Update CooledCoolant and HeatedCoolant to reflect these changes

@bukowski912 bukowski912 marked this pull request as draft April 2, 2025 08:51
throw new IllegalArgumentException("Coolant attributes must have a conductivity greater than zero and at most one! Conductivity: " + conductivity);
static void validateCoolantParams(Holder<?> otherVariant, double thermalEnthalpy, double conductivity) {
//noinspection unchecked,rawtypes
if (otherVariant.is((ResourceKey) MekanismAPI.EMPTY_CHEMICAL_KEY)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there needs to be one of these if blocks for empty fluid too

RecipeViewerUtils.synthetic(key.location(), "boiler", Mekanism.MODID),
IngredientCreatorAccess.chemicalStack().fromHolder(MekanismAPI.CHEMICAL_REGISTRY.getHolderOrThrow(key), coolantAmount), water,
steam, coolant.cool(coolantAmount),
steam, new ChemicalStack(coolant.otherChemical(), coolantAmount),
Copy link
Member

@thiakil thiakil Apr 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to check the type (and have a BoilerRecipeViewerRecipe variant for fluids)

double portionToCool = coolantType.conductivity() * superheatedCoolantTank.getStored();
long toCool = Math.round(portionToCool * (1 - heatCapacitor.getTemperature() / coolantType.temperature()));
ChemicalStack cooledCoolant = coolantType.cool(toCool);
ChemicalStack cooledCoolant = new ChemicalStack(coolantType.otherChemical(), toCool);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be checked, not a blind cast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants