Change loading models (WIP)
This commit is contained in:
parent
8b94c91ea5
commit
87f8699dbb
64 changed files with 532 additions and 476 deletions
|
@ -0,0 +1,25 @@
|
|||
package ru.betterend.client.models;
|
||||
|
||||
import java.io.Reader;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
import net.minecraft.client.renderer.block.model.MultiVariant;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public interface BlockModelProvider extends ModelProvider {
|
||||
String getStatesPattern(Reader data);
|
||||
ResourceLocation statePatternId();
|
||||
|
||||
default BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
|
||||
String pattern = Patterns.createBlockSimple(resourceLocation.getPath());
|
||||
return BlockModel.fromString(pattern);
|
||||
}
|
||||
|
||||
default MultiVariant getModelVariant(ResourceLocation resourceLocation, BlockState blockState) {
|
||||
ResourceLocation modelId = new ResourceLocation(resourceLocation.getNamespace(),
|
||||
"block/" + resourceLocation.getPath());
|
||||
ModelsHelper.addBlockState(blockState, modelId);
|
||||
return ModelsHelper.createBlockSimple(modelId);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue