Skip to content
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

Chemical stack reunification #8196

Merged
merged 77 commits into from
Aug 20, 2024
Merged

Chemical stack reunification #8196

merged 77 commits into from
Aug 20, 2024

Conversation

thiakil
Copy link
Member

@thiakil thiakil commented Aug 9, 2024

Changes proposed in this pull request:

  • Merges chemical types to single Chemical type
  • Slight change to IChemicalHandler to allow for direct implementation on blocks alongside fluid handling (method clashes)
  • Complete removal of Boxed types
  • Adds Infusion recipes to Oxidiser

Todo

backcompat loading

  • Dynamic tank
  • Turbine
  • Fusion
  • Fission
  • SPS
  • Chemical Dissolution - Tile fine, items with both tanks present will lose both due to shared indexes
  • Entangoloporter (first non-empty chemical tank wins)

other

  • crafttweaker example scripts generating extra lines
  • testing CT
  • testing JSON Things
  • ensure redundant caps got removed
  • Tubes not rendering contents until transmitter added/removed
  • gasses not loading after saving world in new format
  • Rename gas upgrade to chemical upgrade, and potentially rename in code as well?
  • Remove excess old chemical colors from gui_objects color map
  • Implement propper support for the new ItemStackChemicalToItemStackRecipe#perTickUsage method. Currently is only used by things that are generic to the IC2I recipe for viewers and mappers, but can't be set on a per recipe basis and giving different values than the default doesn't change the actual behavior of the machines. (This method allows us to further deduplicate some of our code, and is also something that has been requested for some of our recipes that currently are per tick based)

case PIGMENT -> MekanismUtils.getScale(prevScale, getPigmentTank());
case SLURRY -> MekanismUtils.getScale(prevScale, getSlurryTank());
case CHEMICAL -> MekanismUtils.getScale(prevScale, getChemicalTank());
//todo shouldn't this use the lowest amount? - Thiakil
Copy link
Member

Choose a reason for hiding this comment

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

Unsure? My initial thinking was that in general we display the larger number for chemicals in the GUI when the tank is empty. Though technically based on the implementation details of MekanismUtils#getScale, because we pass zero as the stored amount, the passed capacity is effectively ignored.

Copy link
Member Author

Choose a reason for hiding this comment

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

My initial thinking was that in general we display the larger number for chemicals in the GUI when the tank is empty

but why? its misleading - though I think the capacity should be the same or at least very similar, it causes confusion when they get less than they bargained for

@pupnewfster pupnewfster added this to the 10.7.0 milestone Aug 20, 2024
thiakil and others added 4 commits August 20, 2024 20:58
…ification

# Conflicts:
#	src/api/java/mekanism/api/SerializationConstants.java
#	src/main/java/mekanism/common/tile/component/config/slot/ChemicalSlotInfo.java
@pupnewfster pupnewfster merged commit b74b68b into 1.21.x Aug 20, 2024
2 checks passed
@pupnewfster pupnewfster deleted the chemical-stack-reunification branch August 20, 2024 14:55
throw new EncoderException("Empty Chemicals are not allowed");
}
BOXED_OPTIONAL_STREAM_CODEC.encode(buffer, chemical);
public static Chemical parseOptional(HolderLookup.Provider lookupProvider, String tag) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'lookupProvider' is never used.
@@ -114,7 +112,7 @@
*
* @param chemicalProvider Chemical to match
*/
default INGREDIENT of(IChemicalProvider<CHEMICAL> chemicalProvider) {
default ChemicalIngredient of(IChemicalProvider chemicalProvider) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method IChemicalIngredientCreator.of(..) could be confused with overloaded method
of
, since dispatch depends on static types.
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