Skip to content

Commit 31cc0a0

Browse files
committed
Retrieve block name once per state
1 parent 0672629 commit 31cc0a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

forge/src/main/java/org/embeddedt/modernfix/forge/dynresources/ModelBakeEventHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ public ModelBakeEventHelper(Map<ResourceLocation, BakedModel> modelRegistry) {
4242
this.topLevelModelLocations = new HashSet<>(modelRegistry.keySet());
4343
// Skip going through ModelLocationCache because most of the accesses will be misses
4444
for(Block block : ForgeRegistries.BLOCKS) {
45+
ResourceLocation name = block.delegate.name();
4546
for(BlockState state : block.getStateDefinition().getPossibleStates()) {
46-
topLevelModelLocations.add(BlockModelShaper.stateToModelLocation(state));
47+
topLevelModelLocations.add(BlockModelShaper.stateToModelLocation(name, state));
4748
}
4849
}
4950
ForgeRegistries.ITEMS.getKeys().forEach(key -> topLevelModelLocations.add(new ModelResourceLocation(key, "inventory")));

0 commit comments

Comments
 (0)