Changing model loading (WIP)

This commit is contained in:
Aleksey 2021-05-22 19:14:52 +03:00
parent 4d2e3d7be6
commit 53c9525c2d
33 changed files with 435 additions and 128 deletions

View file

@ -106,11 +106,11 @@ public class EndBarrelBlock extends BarrelBlock implements BlockModelProvider {
@Override
public BlockModel getModel(ResourceLocation blockId) {
return (BlockModel) getBlockModel(blockId, defaultBlockState());
return getBlockModel(blockId, defaultBlockState());
}
@Override
public @Nullable UnbakedModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
String texture = blockId.getPath();
Optional<String> pattern;
if (blockState.getValue(OPEN)) {
@ -118,7 +118,7 @@ public class EndBarrelBlock extends BarrelBlock implements BlockModelProvider {
} else {
pattern = Patterns.createJson(Patterns.BLOCK_BOTTOM_TOP, texture, texture);
}
return pattern.map(BlockModel::fromString).orElse(null);
return ModelsHelper.fromPattern(pattern);
}
@Override