diff --git a/src/main/java/com/voxelutopia/ultramarine/datagen/ModBlockModelProvider.java b/src/main/java/com/voxelutopia/ultramarine/datagen/ModBlockModelProvider.java index f60ed366..bdcc270c 100644 --- a/src/main/java/com/voxelutopia/ultramarine/datagen/ModBlockModelProvider.java +++ b/src/main/java/com/voxelutopia/ultramarine/datagen/ModBlockModelProvider.java @@ -378,52 +378,67 @@ else if (block instanceof SixSideBlock sixSideBlock){ simpleBlock(BlockRegistry.DEEPSLATE_HEMATITE_ORE.get()); simpleBlock(BlockRegistry.NETHER_COBALT_ORE.get()); - getMultipartBuilder(BlockRegistry.LONG_TABLE.get()) - .part() + getVariantBuilder(BlockRegistry.LONG_TABLE.get()) + .partialState() + .with(LongTableBlock.AXIS, Direction.Axis.X) + .with(LongTableBlock.LEFT, false) + .with(LongTableBlock.RIGHT, false) + .modelForState() .modelFile(models().getExistingFile(modLoc("block/long_table"))) .addModel() - .condition(LongTableBlock.AXIS, Direction.Axis.X) - .condition(LongTableBlock.LEFT, false) - .condition(LongTableBlock.RIGHT, false) - .end() - .part() + .partialState() + .with(LongTableBlock.AXIS, Direction.Axis.X) + .with(LongTableBlock.LEFT, false) + .with(LongTableBlock.RIGHT, true) + .modelForState() .modelFile(models().getExistingFile(modLoc("block/long_table_left"))) .addModel() - .condition(LongTableBlock.AXIS, Direction.Axis.X) - .condition(LongTableBlock.LEFT, false) - .condition(LongTableBlock.RIGHT, true) - .end() - .part() + .partialState() + .with(LongTableBlock.AXIS, Direction.Axis.X) + .with(LongTableBlock.LEFT, true) + .with(LongTableBlock.RIGHT, false) + .modelForState() .modelFile(models().getExistingFile(modLoc("block/long_table_right"))) .addModel() - .condition(LongTableBlock.AXIS, Direction.Axis.X) - .condition(LongTableBlock.LEFT, true) - .condition(LongTableBlock.RIGHT, false) - .end() - .part() + .partialState() + .with(LongTableBlock.AXIS, Direction.Axis.X) + .with(LongTableBlock.LEFT, true) + .with(LongTableBlock.RIGHT, true) + .modelForState() + .modelFile(models().getExistingFile(modLoc("block/long_table_both"))) + .addModel() + .partialState() + .with(LongTableBlock.AXIS, Direction.Axis.Y) + .with(LongTableBlock.LEFT, false) + .with(LongTableBlock.RIGHT, false) + .modelForState() .modelFile(models().getExistingFile(modLoc("block/long_table"))) .rotationY(90) .addModel() - .condition(LongTableBlock.AXIS, Direction.Axis.Z) - .condition(LongTableBlock.LEFT, false) - .condition(LongTableBlock.RIGHT, false) - .end() - .part() + .partialState() + .with(LongTableBlock.AXIS, Direction.Axis.Y) + .with(LongTableBlock.LEFT, false) + .with(LongTableBlock.RIGHT, true) + .modelForState() .modelFile(models().getExistingFile(modLoc("block/long_table_left"))) .rotationY(90) .addModel() - .condition(LongTableBlock.AXIS, Direction.Axis.Z) - .condition(LongTableBlock.LEFT, false) - .condition(LongTableBlock.RIGHT, true) - .end() - .part() + .partialState() + .with(LongTableBlock.AXIS, Direction.Axis.Y) + .with(LongTableBlock.LEFT, true) + .with(LongTableBlock.RIGHT, false) + .modelForState() .modelFile(models().getExistingFile(modLoc("block/long_table_right"))) .rotationY(90) .addModel() - .condition(LongTableBlock.AXIS, Direction.Axis.Z) - .condition(LongTableBlock.LEFT, true) - .condition(LongTableBlock.RIGHT, false) - .end(); + .partialState() + .with(LongTableBlock.AXIS, Direction.Axis.Y) + .with(LongTableBlock.LEFT, true) + .with(LongTableBlock.RIGHT, true) + .modelForState() + .modelFile(models().getExistingFile(modLoc("block/long_table_both"))) + .rotationY(90) + .addModel(); } private ResourceLocation blockLoc(Block block){ diff --git a/src/main/java/com/voxelutopia/ultramarine/world/block/LongTableBlock.java b/src/main/java/com/voxelutopia/ultramarine/world/block/LongTableBlock.java index 811d7df4..0a1b5d5d 100644 --- a/src/main/java/com/voxelutopia/ultramarine/world/block/LongTableBlock.java +++ b/src/main/java/com/voxelutopia/ultramarine/world/block/LongTableBlock.java @@ -4,12 +4,15 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; @@ -125,4 +128,10 @@ private boolean isTableBlock(Level level, BlockPos pos) { public BaseBlockProperty getProperty() { return property; } + + @Override + public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { + // Todo: voxel shape for long table. + return super.getShape(pState, pLevel, pPos, pContext); + } }