Use holders for GT content registration on 1.21 - #5358
Conversation
# Conflicts: # src/main/java/com/gregtechceu/gtceu/api/data/worldgen/modifier/DimensionFilter.java # src/main/java/com/gregtechceu/gtceu/api/data/worldgen/modifier/FrequencyModifier.java # src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java # src/main/java/com/gregtechceu/gtceu/common/data/GTFeatures.java # src/main/java/com/gregtechceu/gtceu/common/worldgen/modifier/BiomeDependentPlacement.java # src/main/java/com/gregtechceu/gtceu/common/worldgen/modifier/RubberTreeChancePlacement.java # src/main/java/com/gregtechceu/gtceu/data/loot/ChestGenHooks.java # src/test/java/com/gregtechceu/gtceu/gametest/world/RealWorldItemUsage.java
# Conflicts: # src/main/java/com/gregtechceu/gtceu/api/addon/IGTAddon.java # src/main/java/com/gregtechceu/gtceu/common/CommonProxy.java # src/main/java/com/gregtechceu/gtceu/common/data/GTSoundEntries.java # src/main/java/com/gregtechceu/gtceu/integration/kjs/GregTechKubeJSPlugin.java
htmlcsjs
left a comment
There was a problem hiding this comment.
I have read though the code and tested some stuff ingame, admitidly alot of it went over my head but i would appreciate someone else looking through this
| * @apiNote DO NOT REGISTER ANY OF YOUR OWN CONTENT HERE, AS IF YOU DO, IT'LL REGISTER AS IF GTCEu REGISTERED IT | ||
| * AND YOUR DATAGEN AND EVENTS WILL <b><i>NOT</i></b> WORK AS EXPECTED, IF AT ALL. | ||
| */ | ||
| void gtInitComplete(); |
There was a problem hiding this comment.
GT is loaded before addons are, so any addon code will always run after GT initialisation.
| public class GTIngredientTypes { | ||
|
|
||
| public static final DeferredRegister<IngredientType<?>> ITEM_INGREDIENT_TYPES = DeferredRegister | ||
| private static final DeferredRegister<IngredientType<?>> ITEM_INGREDIENT_TYPES = DeferredRegister |
There was a problem hiding this comment.
Why change the visibilities of these
There was a problem hiding this comment.
These should be private since they are only used for registration within this file, other mods shouldn't use these.
| private static final DeferredRegister<IngredientType<?>> ITEM_INGREDIENT_TYPES = DeferredRegister | ||
| .create(NeoForgeRegistries.INGREDIENT_TYPES, GTCEu.MOD_ID); | ||
| public static final DeferredRegister<FluidIngredientType<?>> FLUID_INGREDIENT_TYPES = DeferredRegister | ||
| private static final DeferredRegister<FluidIngredientType<?>> FLUID_INGREDIENT_TYPES = DeferredRegister |
| } | ||
|
|
||
| public static void init() { | ||
| PlaceholderHandler.addPlaceholder(new Placeholder("ae2itemCount") { |
There was a problem hiding this comment.
Does the change from camelCase to snake_case here break preexisting monitors?
There was a problem hiding this comment.
It will, but that's not really a big concern on 1.21
What
Wraps GT content registration in deferred holders, for everything except machines, material system stuff and recipe stuff (they will be handled in seperate PRs each).
No AI