Compare commits
No commits in common. "f13546e9b43b5083bdb809b92b8216d867959d24" and "85bc6293b1d1c4598d17896f1261ed83bf63c180" have entirely different histories.
f13546e9b4
...
85bc6293b1
2 changed files with 2 additions and 51 deletions
|
@ -4,7 +4,6 @@ import fr.sushi.charmsnfabrics.common.entities.block.FloralWorkstationBlockEntit
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||||
import net.minecraft.world.level.BlockGetter;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.EntityBlock;
|
import net.minecraft.world.level.block.EntityBlock;
|
||||||
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
|
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
|
||||||
|
@ -14,33 +13,17 @@ import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.block.state.StateDefinition;
|
import net.minecraft.world.level.block.state.StateDefinition;
|
||||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
|
||||||
import net.minecraft.world.phys.shapes.Shapes;
|
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class FloralWorkstation extends Block implements EntityBlock
|
public class FloralWorkstation extends Block implements EntityBlock
|
||||||
{
|
{
|
||||||
public static final EnumProperty<Direction> FACING =
|
public static final EnumProperty<Direction> FACING =
|
||||||
HorizontalDirectionalBlock.FACING;
|
HorizontalDirectionalBlock.FACING;
|
||||||
|
|
||||||
private static final VoxelShape LEGS =
|
|
||||||
Shapes.or(Block.box(1.0, 0.0, 1.0, 3.0, 12.0, 3.0),
|
|
||||||
Block.box(1.0, 0.0, 13.0, 3.0, 12.0, 15.0),
|
|
||||||
Block.box(13.0, 0.0, 13.0, 15.0, 12.0, 15.0),
|
|
||||||
Block.box(13.0, 0.0, 1.0, 15.0, 12.0, 3.0));
|
|
||||||
private static final VoxelShape TABLE = Block.column(16.0, 12.0, 14.0);
|
|
||||||
private static final VoxelShape SUPPORT = Block.column(12.0, 2.0, 3.0);
|
|
||||||
private static final Map<Direction.Axis, VoxelShape> SHAPES =
|
|
||||||
Shapes.rotateHorizontalAxis(Shapes.or(LEGS, TABLE, SUPPORT));
|
|
||||||
|
|
||||||
public FloralWorkstation(BlockBehaviour.Properties properties)
|
public FloralWorkstation(BlockBehaviour.Properties properties)
|
||||||
{
|
{
|
||||||
super(properties);
|
super(properties);
|
||||||
this.registerDefaultState(
|
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
|
||||||
this.stateDefinition.any().setValue(FACING, Direction.NORTH));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -63,13 +46,6 @@ public class FloralWorkstation extends Block implements EntityBlock
|
||||||
return state.setValue(FACING, rot.rotate(state.getValue(FACING)));
|
return state.setValue(FACING, rot.rotate(state.getValue(FACING)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected VoxelShape getShape(BlockState state, BlockGetter level,
|
|
||||||
BlockPos pos, CollisionContext context)
|
|
||||||
{
|
|
||||||
return SHAPES.get(state.getValue(FACING).getAxis());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable BlockEntity newBlockEntity(BlockPos pos, BlockState state)
|
public @Nullable BlockEntity newBlockEntity(BlockPos pos, BlockState state)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"format_version": "1.21.6",
|
"format_version": "1.21.6",
|
||||||
"credit": "Made with Blockbench",
|
"credit": "Made with Blockbench",
|
||||||
"texture_size": [64, 64],
|
"texture_size": [64, 64],
|
||||||
"render_type": "minecraft:cutout_mipped",
|
"render_type": "minecraft:cutout",
|
||||||
"textures": {
|
"textures": {
|
||||||
"0": "charmsnfabrics:block/floral_workstation",
|
"0": "charmsnfabrics:block/floral_workstation",
|
||||||
"particle": "minecraft:block/oak_planks"
|
"particle": "minecraft:block/oak_planks"
|
||||||
|
@ -153,31 +153,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"display": {
|
|
||||||
"thirdperson_righthand": {
|
|
||||||
"scale": [0.5, 0.5, 0.5]
|
|
||||||
},
|
|
||||||
"thirdperson_lefthand": {
|
|
||||||
"scale": [0.5, 0.5, 0.5]
|
|
||||||
},
|
|
||||||
"firstperson_righthand": {
|
|
||||||
"scale": [0.5, 0.5, 0.5]
|
|
||||||
},
|
|
||||||
"firstperson_lefthand": {
|
|
||||||
"scale": [0.5, 0.5, 0.5]
|
|
||||||
},
|
|
||||||
"ground": {
|
|
||||||
"translation": [0, 2, 0],
|
|
||||||
"scale": [0.25, 0.25, 0.25]
|
|
||||||
},
|
|
||||||
"gui": {
|
|
||||||
"rotation": [30, 45, 0],
|
|
||||||
"scale": [0.625, 0.625, 0.625]
|
|
||||||
},
|
|
||||||
"head": {
|
|
||||||
"translation": [0, 1, 0]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"groups": [
|
"groups": [
|
||||||
{
|
{
|
||||||
"name": "legs",
|
"name": "legs",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue