Change models loading (yes, WIP)
This commit is contained in:
parent
9b67bc5719
commit
52fc329a0a
8 changed files with 98 additions and 17 deletions
|
@ -10,7 +10,9 @@ import net.minecraft.client.renderer.block.model.MultiVariant;
|
|||
import net.minecraft.client.renderer.block.model.Variant;
|
||||
import net.minecraft.client.resources.model.BlockModelRotation;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
@ -25,6 +27,11 @@ public class ModelsHelper {
|
|||
return pattern.map(BlockModel::fromString).orElse(null);
|
||||
}
|
||||
|
||||
public static BlockModel createBlockEmpty(ResourceLocation resourceLocation) {
|
||||
Optional<String> pattern = Patterns.createJson(Patterns.BLOCK_EMPTY, resourceLocation.getPath());
|
||||
return pattern.map(BlockModel::fromString).orElse(null);
|
||||
}
|
||||
|
||||
public static MultiVariant createBlockSimple(ResourceLocation resourceLocation) {
|
||||
Variant variant = new Variant(resourceLocation, Transformation.identity(), false, 1);
|
||||
return new MultiVariant(Lists.newArrayList(variant));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue