-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add method to allow generating family models for existing blocks
- Loading branch information
1 parent
f9eb871
commit bc5f055
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
patches/net/minecraft/client/data/models/BlockModelGenerators.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,19 @@ | ||
--- a/net/minecraft/client/data/models/BlockModelGenerators.java | ||
+++ b/net/minecraft/client/data/models/BlockModelGenerators.java | ||
@@ -5819,4 +_,16 @@ | ||
return this; | ||
} | ||
} | ||
+ | ||
+ /** | ||
+ * Neo: create a {@link BlockModelGenerators.BlockFamilyProvider} which re-uses the existing model of the given full | ||
+ * block instead of creating a model and blockstate file for it. Intended for use cases where the full block is | ||
+ * separately generated or otherwise exists such as when a dummy {@link BlockFamily} is used to create additional | ||
+ * variants for existing vanilla block families | ||
+ */ | ||
+ public BlockModelGenerators.BlockFamilyProvider familyWithExistingFullBlock(Block fullBlock) { | ||
+ var provider = new BlockModelGenerators.BlockFamilyProvider(TextureMapping.cube(fullBlock)); | ||
+ provider.fullBlock = ModelLocationUtils.getModelLocation(fullBlock); | ||
+ return provider; | ||
+ } | ||
} |
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