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

@ -13,9 +13,9 @@ import ru.betterend.BetterEnd;
import static net.minecraft.client.resources.model.ModelBakery.MISSING_MODEL_LOCATION;
public interface BlockModelProvider extends ModelProvider {
default @Nullable UnbakedModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
default @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
Optional<String> pattern = Patterns.createBlockSimple(resourceLocation.getPath());
return pattern.map(BlockModel::fromString).orElse(null);
return ModelsHelper.fromPattern(pattern);
}
default UnbakedModel getModelVariant(ResourceLocation resourceLocation, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {