Rework injects in preparation for NeoForge enum extensions.#776
Merged
BluSpring merged 8 commits intoMay 24, 2026
Merged
Conversation
…hout enum extension otherwise). Note that there is still something wrong with CreateInitializer so the lambdas aren't copied properly.
Merged
Member
|
go ahead |
BluSpring
requested changes
May 23, 2026
| target = "Lnet/minecraft/resources/ResourceLocation;withDefaultNamespace(Ljava/lang/String;)Lnet/minecraft/resources/ResourceLocation;" | ||
| ) | ||
| ) | ||
| private static ResourceLocation kilt$getNamspeacedTextureLocation(String texture, Operation<ResourceLocation> original) { |
| RarityInject(String fieldName, int ordinal, int id, String name, ChatFormatting color) {} | ||
|
|
||
| @Inject(method = "<init>(Ljava/lang/String;IILjava/lang/String;Lnet/minecraft/ChatFormatting;)V", at = @At("RETURN")) | ||
| public void kilt$init(String string, int i, int id, String name, ChatFormatting color, CallbackInfo ci) { |
Member
There was a problem hiding this comment.
kilt$setupDefaultStyleModifier
…1-enum-extension-inject-prep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I went through all the injects to make sure they would be ready for enum extensions.
All of them appear to work with my enum extension draft (they don't crash at least).
This also removes the older static create methods because they don't seem to be present on NeoForge anyway.
Also, how would you feel about removing RecipeBookCategoriesInjection and RecipeBookTypeInjection?
RecipeBookCategoriesInjection doesn't seem to be used for anything anywhere, but RecipeBookTypeInjection is used to invoke getExtensionInfo from the forge module, although I'm unsure if that will return the correct value.
Edit: Now depends on KiltMC/NeoForge#12