Change models loading (WIP)

This commit is contained in:
Aleksey 2021-05-16 12:10:24 +03:00
parent 60568cea18
commit d11645aba3
7 changed files with 84 additions and 59 deletions

View file

@ -5,5 +5,13 @@ import net.minecraft.resources.ResourceLocation;
public interface ModelProvider {
String getModelString(String name);
BlockModel getModel(ResourceLocation resourceLocation);
default BlockModel getModel(ResourceLocation resourceLocation) {
return createItemModel(resourceLocation.getPath());
}
static BlockModel createItemModel(String name) {
String pattern = Patterns.createItemGenerated("item/" + name);
return BlockModel.fromString(pattern);
}
}