Change models loading (WIP)

This commit is contained in:
Aleksey 2021-05-16 13:29:31 +03:00
parent f5c91c3aad
commit 8b94c91ea5
6 changed files with 78 additions and 15 deletions

View file

@ -6,6 +6,8 @@ import java.util.List;
import java.util.Random;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.client.renderer.block.model.MultiVariant;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Registry;
@ -126,4 +128,15 @@ public abstract class FeatureSaplingBlock extends SaplingBlock implements IRende
public ResourceLocation statePatternId() {
return Patterns.STATE_SAPLING;
}
@Override
public BlockModel getModel(ResourceLocation resourceLocation) {
return BlockModelProvider.createBlockItem(resourceLocation);
}
@Override
public BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
String pattern = Patterns.createJson(Patterns.BLOCK_CROSS, resourceLocation.getPath());
return BlockModel.fromString(pattern);
}
}