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
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
69b0d00
re-unify gas/infuse/pigment/slurry under Chemical
thiakil Aug 6, 2024
7188a93
remove todo
thiakil Aug 7, 2024
3cd1a17
merge infusion and chemical conversion and redo the hierarchy a little
thiakil Aug 7, 2024
0678da4
remove some lingering references to old types
thiakil Aug 7, 2024
28359b7
fix missed annotation
thiakil Aug 7, 2024
f0124bf
fix missed method removal
thiakil Aug 7, 2024
92706c1
javadoc
thiakil Aug 7, 2024
4484d40
recipe paths, fix pigment texture building
thiakil Aug 7, 2024
f397ab6
fix JEI
thiakil Aug 8, 2024
e0bb686
add infuser to chemical conversion category
thiakil Aug 8, 2024
01a06ea
add infusion recipes to the oxidizer
thiakil Aug 8, 2024
6a8e05e
datagen
thiakil Aug 8, 2024
19b75a2
Merge branch '1.21.x' into chemical-stack-reunification
thiakil Aug 9, 2024
e0d696f
fix textures for gas->chemical, lang entries
thiakil Aug 9, 2024
3c18a30
update JEI
thiakil Aug 9, 2024
58ebe06
fix bad test
thiakil Aug 9, 2024
1be83ac
rename legacy method
thiakil Aug 10, 2024
63f0e5e
fix multiblocks loading old data
thiakil Aug 10, 2024
8e2c06e
fix entangoloporter backcompat
thiakil Aug 10, 2024
ccfd688
remove redundant ChemicalType enum
thiakil Aug 10, 2024
566a11a
fix docs
thiakil Aug 10, 2024
3091f11
fix dissolution loading
thiakil Aug 10, 2024
26e38b2
redundant generic
thiakil Aug 10, 2024
adec8cd
accidentally removed override
thiakil Aug 10, 2024
0b909b2
add override
thiakil Aug 10, 2024
c234730
fix dupes in dictionary GUI for tag types
thiakil Aug 10, 2024
91a7388
add gaseous attribute to chemicals, remove subclasses of Chemical Ren…
thiakil Aug 10, 2024
892fde6
remove generic, replace instanceof with null check
thiakil Aug 10, 2024
b2341c0
inline some codecs, remove redundant interfaces
thiakil Aug 10, 2024
668d0cf
add missed annotations
thiakil Aug 10, 2024
f8a3cc5
remove some more redundant generics
thiakil Aug 11, 2024
b7cf4c0
fix CT example dupes
thiakil Aug 12, 2024
148c4c2
inline some things now it's not 4x the variants
thiakil Aug 12, 2024
554dd49
remove unused variable
thiakil Aug 12, 2024
fa8c66f
fixed being unable to load the new format
thiakil Aug 12, 2024
6add9b6
fix tube rendering chemical
thiakil Aug 13, 2024
b15fe84
Merge branch '1.21.x' into chemical-stack-reunification
thiakil Aug 13, 2024
94e9da0
Merge branch '1.21.x' into chemical-stack-reunification
thiakil Aug 14, 2024
a6ce49d
inline redundant helper
thiakil Aug 14, 2024
eb06650
Add some missing since tags to javadocs in API, and continue fixing n…
pupnewfster Aug 14, 2024
e306726
Remove unused ingredient interfaces
pupnewfster Aug 14, 2024
3923cd4
Rename GasAttributes to ChemicalAttributes
pupnewfster Aug 14, 2024
8e039f2
Continue making field and method names more generic rather than refer…
pupnewfster Aug 14, 2024
5ff1ad4
Remove intermediary GasToGasRecipe class
pupnewfster Aug 14, 2024
129b5e9
Remove unnecessary intermediary ItemStackGasToItemStackRecipe
pupnewfster Aug 14, 2024
dd3432d
Misc cleanup of generics in CraftTweaker code
pupnewfster Aug 14, 2024
0e2ed4b
game version in datagen cache headers
thiakil Aug 16, 2024
fd8993f
rename gas upgrade to chemical
thiakil Aug 16, 2024
5a3a44c
Remove some unnecessary parameters
pupnewfster Aug 16, 2024
8fed4b4
Merge branch '1.21.x' into chemical-stack-reunification
thiakil Aug 17, 2024
a56fd26
rerun datagen
thiakil Aug 17, 2024
68effd3
Remove unnecessary casts
pupnewfster Aug 17, 2024
929832b
Use static helper methods for creating chemical tanks
pupnewfster Aug 17, 2024
3aa7f91
Remove chemical tank builders in favor of static methods in the actua…
pupnewfster Aug 18, 2024
0a27dc5
Remove some no longer necessary presetVariable hacks
pupnewfster Aug 18, 2024
503e907
Inline certain copy calls rather than bouncing via a helper method
pupnewfster Aug 18, 2024
094b4a7
Reduce duplication in certain tooltips now that all chemicals are the…
pupnewfster Aug 18, 2024
5de8aeb
Cleanup class names to no longer reference BoxedChemicals
pupnewfster Aug 18, 2024
b080eed
Update gui_objects to only have a single entry for chemicals
pupnewfster Aug 19, 2024
531546a
Merge all inner classes for chemical tags into one
pupnewfster Aug 19, 2024
34a8f1d
Fix and cleanup a handful of things with the CrT integration, and mak…
pupnewfster Aug 19, 2024
d179d08
Merge json things builders into a single chemical builder. Still unte…
pupnewfster Aug 19, 2024
3c2ff30
Further cleanup and deduplicate chemical related recipe classes, and …
pupnewfster Aug 19, 2024
76d8ef3
Remove bouncer infusion conversion method
pupnewfster Aug 19, 2024
adb9aef
Deduplicate a couple cached recipe implementations
pupnewfster Aug 19, 2024
b82394c
Cleanup chemical ingredient code
pupnewfster Aug 19, 2024
16de0ce
Continued misc cleanup and remove GuiHybridGauge in favor of making t…
pupnewfster Aug 19, 2024
21274a0
Continued cleanup, and move away from CrT's NativeMethod annotation w…
pupnewfster Aug 19, 2024
6c4d2d1
Continued general code cleanup
pupnewfster Aug 20, 2024
e8e18c0
Replace update tag legacy chemical keys with chemical (no backcompat …
pupnewfster Aug 20, 2024
97d16a2
Replace certain keys in recipes with a more generic name
pupnewfster Aug 20, 2024
74daf75
Implement support for Item Chemical recipes to have specify if they u…
pupnewfster Aug 20, 2024
1e0f763
Merge TileEntityMetallurgicInfuserFactory into the ItemChemicalToItem…
pupnewfster Aug 20, 2024
524955d
fix item model for chemical upgrade
thiakil Aug 20, 2024
6443d74
Merge remote-tracking branch 'origin/1.21.x' into chemical-stack-reun…
pupnewfster Aug 20, 2024
da0a044
Adjust version in since tags
pupnewfster Aug 20, 2024
14a9c3e
Files updated by running datagen
pupnewfster Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ emi_version=1.1.10
grand_power_version=3.0.0
jade_api_id=5427895
jade_id=5572926
jei_version=19.5.2.66
jei_version=19.8.0.95
json_things_version=0.12.0
top_version=1.21_neo-12.0.0-1
wthit_version=12.2.3
Expand Down
65 changes: 2 additions & 63 deletions src/api/java/mekanism/api/IMekanismAccess.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
package mekanism.api;

import java.util.ServiceLoader;
import mekanism.api.chemical.gas.Gas;
import mekanism.api.chemical.gas.GasStack;
import mekanism.api.chemical.infuse.InfuseType;
import mekanism.api.chemical.infuse.InfusionStack;
import mekanism.api.chemical.pigment.Pigment;
import mekanism.api.chemical.pigment.PigmentStack;
import mekanism.api.chemical.slurry.Slurry;
import mekanism.api.chemical.slurry.SlurryStack;
import mekanism.api.integration.emi.IMekanismEmiHelper;
import mekanism.api.integration.jei.IMekanismJEIHelper;
import mekanism.api.recipes.ingredients.GasStackIngredient;
import mekanism.api.recipes.ingredients.InfusionStackIngredient;
import mekanism.api.recipes.ingredients.PigmentStackIngredient;
import mekanism.api.recipes.ingredients.SlurryStackIngredient;
import mekanism.api.recipes.ingredients.chemical.IGasIngredient;
import mekanism.api.recipes.ingredients.chemical.IInfusionIngredient;
import mekanism.api.recipes.ingredients.chemical.IPigmentIngredient;
import mekanism.api.recipes.ingredients.chemical.ISlurryIngredient;
import mekanism.api.recipes.ingredients.creator.IChemicalIngredientCreator;
import mekanism.api.recipes.ingredients.creator.IChemicalStackIngredientCreator;
import mekanism.api.recipes.ingredients.creator.IFluidStackIngredientCreator;
Expand Down Expand Up @@ -70,58 +54,13 @@ public interface IMekanismAccess {
*
* @apiNote Use {@link mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess#gasStack()} instead.
*/
IChemicalStackIngredientCreator<Gas, GasStack, IGasIngredient, GasStackIngredient> gasStackIngredientCreator();
IChemicalStackIngredientCreator chemicalStackIngredientCreator();

/**
* Gets the gas ingredient creator.
*
* @apiNote Use {@link mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess#gas()} instead.
* @since 10.6.0
*/
IChemicalIngredientCreator<Gas, IGasIngredient> gasIngredientCreator();

/**
* Gets the infusion stack ingredient creator.
*
* @apiNote Use {@link mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess#infusionStack()} instead.
*/
IChemicalStackIngredientCreator<InfuseType, InfusionStack, IInfusionIngredient, InfusionStackIngredient> infusionStackIngredientCreator();

/**
* Gets the infusion ingredient creator.
*
* @apiNote Use {@link mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess#infusion()} instead.
* @since 10.6.0
*/
IChemicalIngredientCreator<InfuseType, IInfusionIngredient> infusionIngredientCreator();

/**
* Gets the pigment stack ingredient creator.
*
* @apiNote Use {@link mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess#pigmentStack()} instead.
*/
IChemicalStackIngredientCreator<Pigment, PigmentStack, IPigmentIngredient, PigmentStackIngredient> pigmentStackIngredientCreator();

/**
* Gets the pigment ingredient creator.
*
* @apiNote Use {@link mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess#pigment()} instead.
* @since 10.6.0
*/
IChemicalIngredientCreator<Pigment, IPigmentIngredient> pigmentIngredientCreator();

/**
* Gets the slurry stack ingredient creator.
*
* @apiNote Use {@link mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess#slurryStack()} instead.
*/
IChemicalStackIngredientCreator<Slurry, SlurryStack, ISlurryIngredient, SlurryStackIngredient> slurryStackIngredientCreator();

/**
* Gets the slurry ingredient creator.
*
* @apiNote Use {@link mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess#slurry()} instead.
* @since 10.6.0
*/
IChemicalIngredientCreator<Slurry, ISlurryIngredient> slurryIngredientCreator();
IChemicalIngredientCreator chemicalIngredientCreator();
}
159 changes: 22 additions & 137 deletions src/api/java/mekanism/api/MekanismAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@
import com.mojang.logging.LogUtils;
import com.mojang.serialization.MapCodec;
import mekanism.api.annotations.NothingNullByDefault;
import mekanism.api.chemical.gas.Gas;
import mekanism.api.chemical.gas.GasBuilder;
import mekanism.api.chemical.infuse.InfuseType;
import mekanism.api.chemical.infuse.InfuseTypeBuilder;
import mekanism.api.chemical.pigment.Pigment;
import mekanism.api.chemical.pigment.PigmentBuilder;
import mekanism.api.chemical.slurry.Slurry;
import mekanism.api.chemical.slurry.SlurryBuilder;
import mekanism.api.chemical.Chemical;
import mekanism.api.chemical.ChemicalBuilder;
import mekanism.api.gear.ModuleData;
import mekanism.api.recipes.ingredients.chemical.IGasIngredient;
import mekanism.api.recipes.ingredients.chemical.IInfusionIngredient;
import mekanism.api.recipes.ingredients.chemical.IPigmentIngredient;
import mekanism.api.recipes.ingredients.chemical.ISlurryIngredient;
import mekanism.api.recipes.ingredients.chemical.IChemicalIngredient;
import mekanism.api.robit.RobitSkin;
import net.minecraft.core.DefaultedRegistry;
import net.minecraft.core.Registry;
Expand Down Expand Up @@ -68,61 +59,21 @@ private static <T> ResourceKey<Registry<MapCodec<? extends T>>> codecRegistryKey
public static final ResourceLocation EMPTY_CHEMICAL_NAME = rl("empty");

/**
* Gets the {@link ResourceKey} representing the name of the Registry for {@link Gas gases}.
* Gets the {@link ResourceKey} representing the name of the Registry for {@link Chemical gases}.
*
* @apiNote When registering {@link Gas gases} using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @apiNote When registering {@link Chemical gases} using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @since 10.4.0
*/
public static final ResourceKey<Registry<Gas>> GAS_REGISTRY_NAME = registryKey(Gas.class, "gas");
/**
* Gets the {@link ResourceKey} representing the name of the Registry for {@link IGasIngredient} ingredient type serializers.
*
* @apiNote When registering gas ingredient types using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @since 10.6.0
*/
public static final ResourceKey<Registry<MapCodec<? extends IGasIngredient>>> GAS_INGREDIENT_TYPE_REGISTRY_NAME = codecRegistryKey(IGasIngredient.class, "gas_ingredient_type");
/**
* Gets the {@link ResourceKey} representing the name of the Registry for {@link InfuseType infuse types}.
*
* @apiNote When registering {@link InfuseType infuse types} using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @since 10.4.0
*/
public static final ResourceKey<Registry<InfuseType>> INFUSE_TYPE_REGISTRY_NAME = registryKey(InfuseType.class, "infuse_type");
/**
* Gets the {@link ResourceKey} representing the name of the Registry for {@link IInfusionIngredient} ingredient type serializers.
*
* @apiNote When registering infusion ingredient types using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @since 10.6.0
*/
public static final ResourceKey<Registry<MapCodec<? extends IInfusionIngredient>>> INFUSION_INGREDIENT_TYPE_REGISTRY_NAME = codecRegistryKey(IInfusionIngredient.class, "infusion_ingredient_type");
/**
* Gets the {@link ResourceKey} representing the name of the Registry for {@link Pigment pigments}.
*
* @apiNote When registering {@link Pigment pigments} using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @since 10.4.0
*/
public static final ResourceKey<Registry<Pigment>> PIGMENT_REGISTRY_NAME = registryKey(Pigment.class, "pigment");
/**
* Gets the {@link ResourceKey} representing the name of the Registry for {@link IPigmentIngredient} ingredient type serializers.
*
* @apiNote When registering pigment ingredient types using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @since 10.6.0
*/
public static final ResourceKey<Registry<MapCodec<? extends IPigmentIngredient>>> PIGMENT_INGREDIENT_TYPE_REGISTRY_NAME = codecRegistryKey(IPigmentIngredient.class, "pigment_ingredient_type");
/**
* Gets the {@link ResourceKey} representing the name of the Registry for {@link Slurry sluries}.
*
* @apiNote When registering {@link Slurry sluries} using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @since 10.4.0
*/
public static final ResourceKey<Registry<Slurry>> SLURRY_REGISTRY_NAME = registryKey(Slurry.class, "slurry");
public static final ResourceKey<Registry<Chemical>> CHEMICAL_REGISTRY_NAME = registryKey(Chemical.class, "chemical");

/**
* Gets the {@link ResourceKey} representing the name of the Registry for {@link ISlurryIngredient} ingredient type serializers.
* Gets the {@link ResourceKey} representing the name of the Registry for {@link IChemicalIngredient} ingredient type serializers.
*
* @apiNote When registering slurry ingredient types using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @apiNote When registering chemical ingredient types using {@link DeferredRegister}, use this field to get access to the {@link ResourceKey}.
* @since 10.6.0
*/
public static final ResourceKey<Registry<MapCodec<? extends ISlurryIngredient>>> SLURRY_INGREDIENT_TYPE_REGISTRY_NAME = codecRegistryKey(ISlurryIngredient.class, "slurry_ingredient_type");
public static final ResourceKey<Registry<MapCodec<? extends IChemicalIngredient>>> CHEMICAL_INGREDIENT_TYPE_REGISTRY_NAME = codecRegistryKey(IChemicalIngredient.class, "chemical_ingredient_type");

/**
* Gets the {@link ResourceKey} representing the name of the Registry for {@link ModuleData modules}.
*
Expand All @@ -146,81 +97,26 @@ private static <T> ResourceKey<Registry<MapCodec<? extends T>>> codecRegistryKey
public static final ResourceKey<Registry<MapCodec<? extends RobitSkin>>> ROBIT_SKIN_SERIALIZER_REGISTRY_NAME = codecRegistryKey(RobitSkin.class, "robit_skin_serializer");

/**
* Gets the Registry for {@link Gas}.
*
* @see #GAS_REGISTRY_NAME
* @since 10.5.0
*/
public static final DefaultedRegistry<Gas> GAS_REGISTRY = (DefaultedRegistry<Gas>) new RegistryBuilder<>(GAS_REGISTRY_NAME)
.defaultKey(EMPTY_CHEMICAL_NAME)
.sync(true)
.create();
/**
* Gets the Registry for {@link IGasIngredient} type serializers.
*
* @see #GAS_INGREDIENT_TYPE_REGISTRY_NAME
* @since 10.6.0
*/
public static final Registry<MapCodec<? extends IGasIngredient>> GAS_INGREDIENT_TYPES = new RegistryBuilder<>(GAS_INGREDIENT_TYPE_REGISTRY_NAME)
.sync(true)
.create();
/**
* Gets the Registry for {@link InfuseType}.
* Gets the Registry for {@link Chemical}.
*
* @see #INFUSE_TYPE_REGISTRY_NAME
* @see #CHEMICAL_REGISTRY_NAME
* @since 10.5.0
*/
public static final DefaultedRegistry<InfuseType> INFUSE_TYPE_REGISTRY = (DefaultedRegistry<InfuseType>) new RegistryBuilder<>(INFUSE_TYPE_REGISTRY_NAME)
public static final DefaultedRegistry<Chemical> CHEMICAL_REGISTRY = (DefaultedRegistry<Chemical>) new RegistryBuilder<>(CHEMICAL_REGISTRY_NAME)
.defaultKey(EMPTY_CHEMICAL_NAME)
.sync(true)
.create();

/**
* Gets the Registry for {@link IInfusionIngredient} type serializers.
*
* @see #INFUSION_INGREDIENT_TYPE_REGISTRY_NAME
* @since 10.6.0
*/
public static final Registry<MapCodec<? extends IInfusionIngredient>> INFUSION_INGREDIENT_TYPES = new RegistryBuilder<>(INFUSION_INGREDIENT_TYPE_REGISTRY_NAME)
.sync(true)
.create();
/**
* Gets the Registry for {@link Pigment}.
*
* @see #PIGMENT_REGISTRY_NAME
* @since 10.5.0
*/
public static final DefaultedRegistry<Pigment> PIGMENT_REGISTRY = (DefaultedRegistry<Pigment>) new RegistryBuilder<>(PIGMENT_REGISTRY_NAME)
.defaultKey(EMPTY_CHEMICAL_NAME)
.sync(true)
.create();
/**
* Gets the Registry for {@link IPigmentIngredient} type serializers.
*
* @see #PIGMENT_INGREDIENT_TYPE_REGISTRY_NAME
* @since 10.6.0
*/
public static final Registry<MapCodec<? extends IPigmentIngredient>> PIGMENT_INGREDIENT_TYPES = new RegistryBuilder<>(PIGMENT_INGREDIENT_TYPE_REGISTRY_NAME)
.sync(true)
.create();
/**
* Gets the Registry for {@link Slurry}.
*
* @see #SLURRY_REGISTRY_NAME
* @since 10.5.0
*/
public static final DefaultedRegistry<Slurry> SLURRY_REGISTRY = (DefaultedRegistry<Slurry>) new RegistryBuilder<>(SLURRY_REGISTRY_NAME)
.defaultKey(EMPTY_CHEMICAL_NAME)
.sync(true)
.create();
/**
* Gets the Registry for {@link ISlurryIngredient} type serializers.
* Gets the Registry for {@link IChemicalIngredient} type serializers.
*
* @see #SLURRY_INGREDIENT_TYPE_REGISTRY_NAME
* @see #CHEMICAL_INGREDIENT_TYPE_REGISTRY_NAME
* @since 10.6.0
*/
public static final Registry<MapCodec<? extends ISlurryIngredient>> SLURRY_INGREDIENT_TYPES = new RegistryBuilder<>(SLURRY_INGREDIENT_TYPE_REGISTRY_NAME)
public static final Registry<MapCodec<? extends IChemicalIngredient>> CHEMICAL_INGREDIENT_TYPES = new RegistryBuilder<>(CHEMICAL_INGREDIENT_TYPE_REGISTRY_NAME)
.sync(true)
.create();

/**
* Gets the Registry for {@link ModuleData}.
*
Expand All @@ -242,19 +138,8 @@ private static <T> ResourceKey<Registry<MapCodec<? extends T>>> codecRegistryKey
//TODO: Potentially define these with DeferredHolder for purposes of fully defining them outside of the API
// would have some minor issues with how the empty stacks are declared
/**
* Empty Gas instance.
* Empty Chemical instance.
*/
public static final Gas EMPTY_GAS = new Gas(GasBuilder.builder());
/**
* Empty Infuse Type instance.
*/
public static final InfuseType EMPTY_INFUSE_TYPE = new InfuseType(InfuseTypeBuilder.builder());
/**
* Empty Pigment instance.
*/
public static final Pigment EMPTY_PIGMENT = new Pigment(PigmentBuilder.builder());
/**
* Empty Slurry instance.
*/
public static final Slurry EMPTY_SLURRY = new Slurry(SlurryBuilder.clean());
public static final Chemical EMPTY_CHEMICAL = new Chemical(ChemicalBuilder.builder());

}
Loading