-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ModelEvent.RegisterAdditional and BakedModelRenderable (#1083)
- Loading branch information
Showing
7 changed files
with
46 additions
and
26 deletions.
There are no files selected for viewing
12 changes: 5 additions & 7 deletions
12
patches/net/minecraft/client/resources/model/ModelBakery.java.patch
This file contains 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
This file contains 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
25 changes: 25 additions & 0 deletions
25
patches/net/minecraft/client/resources/model/ModelResourceLocation.java.patch
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- a/net/minecraft/client/resources/model/ModelResourceLocation.java | ||
+++ b/net/minecraft/client/resources/model/ModelResourceLocation.java | ||
@@ -8,6 +_,7 @@ | ||
@OnlyIn(Dist.CLIENT) | ||
public record ModelResourceLocation(ResourceLocation id, String variant) { | ||
public static final String INVENTORY_VARIANT = "inventory"; | ||
+ public static final String STANDALONE_VARIANT = "standalone"; | ||
|
||
public ModelResourceLocation(ResourceLocation id, String variant) { | ||
variant = lowercaseVariant(variant); | ||
@@ -21,6 +_,14 @@ | ||
|
||
public static ModelResourceLocation inventory(ResourceLocation p_352141_) { | ||
return new ModelResourceLocation(p_352141_, "inventory"); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Construct a {@code ModelResourceLocation} for use in the {@link net.neoforged.neoforge.client.event.ModelEvent.RegisterAdditional} | ||
+ * to load a model at the given path directly instead of going through blockstates or item model auto-prefixing. | ||
+ */ | ||
+ public static ModelResourceLocation standalone(ResourceLocation id) { | ||
+ return new ModelResourceLocation(id, STANDALONE_VARIANT); | ||
} | ||
|
||
private static String lowercaseVariant(String p_248567_) { |
This file contains 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
This file contains 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
This file contains 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
This file contains 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