Retrieve block name once per state
This commit is contained in:
parent
06726296fe
commit
31cc0a0da0
|
|
@ -42,8 +42,9 @@ public class ModelBakeEventHelper {
|
|||
this.topLevelModelLocations = new HashSet<>(modelRegistry.keySet());
|
||||
// Skip going through ModelLocationCache because most of the accesses will be misses
|
||||
for(Block block : ForgeRegistries.BLOCKS) {
|
||||
ResourceLocation name = block.delegate.name();
|
||||
for(BlockState state : block.getStateDefinition().getPossibleStates()) {
|
||||
topLevelModelLocations.add(BlockModelShaper.stateToModelLocation(state));
|
||||
topLevelModelLocations.add(BlockModelShaper.stateToModelLocation(name, state));
|
||||
}
|
||||
}
|
||||
ForgeRegistries.ITEMS.getKeys().forEach(key -> topLevelModelLocations.add(new ModelResourceLocation(key, "inventory")));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user