-
-
Notifications
You must be signed in to change notification settings - Fork 586
Make coolant types more generic #8365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.21.x
Are you sure you want to change the base?
Conversation
7247669 to
f509f84
Compare
src/api/java/mekanism/api/datamaps/chemical/attribute/IChemicalCoolant.java
Outdated
Show resolved
Hide resolved
src/api/java/mekanism/api/datamaps/chemical/attribute/HeatedCoolant.java
Outdated
Show resolved
Hide resolved
src/api/java/mekanism/api/datamaps/chemical/attribute/HeatedCoolant.java
Show resolved
Hide resolved
618a1d8 to
892e2a3
Compare
0232401 to
6d8d1c5
Compare
769dce0 to
8168b67
Compare
src/api/java/mekanism/api/datamaps/chemical/attribute/IChemicalCoolant.java
Show resolved
Hide resolved
| 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)) { |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
Changes proposed in this pull request:
IChemicalAttributefor aHolder<?>and a helper for aHolder<Chemical>CooledCoolantandHeatedCoolantto reflect these changes