Changed models loading (Done)
This commit is contained in:
parent
831faeb306
commit
5da634fc73
63 changed files with 490 additions and 729 deletions
|
@ -97,17 +97,7 @@ public class EndTerrainBlock extends BlockBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Optional<String> getModelString(String block) {
|
||||
String name = Registry.BLOCK.getKey(this).getPath();
|
||||
Map<String, String> map = Maps.newHashMap();
|
||||
map.put("%top%", "betterend:block/" + name + "_top");
|
||||
map.put("%side%", "betterend:block/" + name + "_side");
|
||||
map.put("%bottom%", "minecraft:block/end_stone");
|
||||
return Patterns.createJson(Patterns.BLOCK_TOP_SIDE_BOTTOM, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockModel getModel(ResourceLocation blockId) {
|
||||
public BlockModel getItemModel(ResourceLocation blockId) {
|
||||
return getBlockModel(blockId, defaultBlockState());
|
||||
}
|
||||
|
||||
|
@ -118,13 +108,14 @@ public class EndTerrainBlock extends BlockBase {
|
|||
textures.put("%top%", "betterend:block/" + name + "_top");
|
||||
textures.put("%side%", "betterend:block/" + name + "_side");
|
||||
textures.put("%bottom%", "minecraft:block/end_stone");
|
||||
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_PATH, textures);
|
||||
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_TOP_SIDE_BOTTOM, textures);
|
||||
return ModelsHelper.fromPattern(pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(), "block/" + resourceLocation.getPath());
|
||||
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath());
|
||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||
return ModelsHelper.createRandomTopModel(modelId);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue