mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-25 06:04:32 +01:00
Add a proper collision box for the shaping bench
This commit is contained in:
parent
9ae1ef13ff
commit
44578ab4ac
1 changed files with 21 additions and 0 deletions
|
@ -2,9 +2,12 @@ package com.minelittlepony.unicopia.block.cloud;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import com.minelittlepony.unicopia.EquineContext;
|
||||||
import com.minelittlepony.unicopia.container.ShapingBenchScreenHandler;
|
import com.minelittlepony.unicopia.container.ShapingBenchScreenHandler;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.ShapeContext;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.screen.NamedScreenHandlerFactory;
|
import net.minecraft.screen.NamedScreenHandlerFactory;
|
||||||
import net.minecraft.screen.ScreenHandlerContext;
|
import net.minecraft.screen.ScreenHandlerContext;
|
||||||
|
@ -14,13 +17,31 @@ import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
import net.minecraft.util.shape.VoxelShapes;
|
||||||
|
import net.minecraft.world.BlockView;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ShapingBenchBlock extends CloudBlock {
|
public class ShapingBenchBlock extends CloudBlock {
|
||||||
|
private static final VoxelShape SHAPE = VoxelShapes.union(
|
||||||
|
Block.createCuboidShape(0, 13, 0, 3, 18, 3),
|
||||||
|
Block.createCuboidShape(13, 13, 0, 16, 18, 3),
|
||||||
|
Block.createCuboidShape(0, 13, 13, 3, 18, 16),
|
||||||
|
Block.createCuboidShape(13, 13, 13, 16, 18, 16),
|
||||||
|
Block.createCuboidShape(0, 13, 0, 16, 16, 16),
|
||||||
|
Block.createCuboidShape(2, 0, 2, 14, 17, 14),
|
||||||
|
Block.createCuboidShape(0, 0, 0, 16, 4, 16)
|
||||||
|
);
|
||||||
|
|
||||||
public ShapingBenchBlock(Settings settings) {
|
public ShapingBenchBlock(Settings settings) {
|
||||||
super(settings, false);
|
super(settings, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, EquineContext equineContext) {
|
||||||
|
return SHAPE;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||||
if (world.isClient) {
|
if (world.isClient) {
|
||||||
|
|
Loading…
Reference in a new issue