Changed models loading (Done)

This commit is contained in:
Aleksey 2021-05-24 15:04:16 +03:00
parent 831faeb306
commit 5da634fc73
63 changed files with 490 additions and 729 deletions

View file

@ -43,17 +43,7 @@ public class EndChestBlock extends ChestBlock implements BlockModelProvider {
}
@Override
public Optional<String> getModelString(String path) {
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (path.contains("item")) {
return Patterns.createJson(Patterns.ITEM_CHEST, blockId.getPath());
}
return Patterns.createJson(Patterns.BLOCK_EMPTY, parentId.getPath());
}
@Override
public BlockModel getModel(ResourceLocation blockId) {
public BlockModel getItemModel(ResourceLocation blockId) {
Optional<String> pattern = Patterns.createJson(Patterns.ITEM_CHEST, blockId.getPath());
return ModelsHelper.fromPattern(pattern);
}