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

@ -356,11 +356,11 @@ public class PedestalBlock extends BlockBaseNotFull implements EntityBlock {
@Override
public BlockModel getModel(ResourceLocation blockId) {
return (BlockModel) getBlockModel(blockId, defaultBlockState());
return getBlockModel(blockId, defaultBlockState());
}
@Override
public @Nullable UnbakedModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
Map<String, String> textures = createTexturesMap();
PedestalState state = blockState.getValue(STATE);
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_PEDESTAL_DEFAULT, textures);
@ -386,7 +386,7 @@ public class PedestalBlock extends BlockBaseNotFull implements EntityBlock {
break;
}
}
return pattern.map(BlockModel::fromString).orElse(null);
return ModelsHelper.fromPattern(pattern);
}
@Override