More merging logic + 11 new block + Fix server / client sync #23
@ -42,7 +42,7 @@ public class ReFramed implements ModInitializer {
|
|||||||
SMALL_CUBE, SMALL_CUBES_STEP,
|
SMALL_CUBE, SMALL_CUBES_STEP,
|
||||||
STAIR, STAIRS_CUBE,
|
STAIR, STAIRS_CUBE,
|
||||||
HALF_STAIR, HALF_STAIRS_SLAB, HALF_STAIRS_STAIR,
|
HALF_STAIR, HALF_STAIRS_SLAB, HALF_STAIRS_STAIR,
|
||||||
SLAB, SLABS_CUBE, SLABS_STAIR,
|
SLAB, SLABS_CUBE, SLABS_STAIR, SLABS_OUTER_STAIR, SLABS_INNER_STAIR,
|
||||||
STEP, STEPS_SLAB,
|
STEP, STEPS_SLAB,
|
||||||
LAYER,
|
LAYER,
|
||||||
PILLAR, PILLARS_WALL, WALL,
|
PILLAR, PILLARS_WALL, WALL,
|
||||||
@ -74,6 +74,8 @@ public class ReFramed implements ModInitializer {
|
|||||||
SLAB = registerBlock("slab" , new ReFramedSlabBlock(cp(Blocks.OAK_SLAB)));
|
SLAB = registerBlock("slab" , new ReFramedSlabBlock(cp(Blocks.OAK_SLAB)));
|
||||||
SLABS_CUBE = registerBlock("slabs_cube" , new ReFramedSlabsCubeBlock(cp(Blocks.OAK_SLAB)));
|
SLABS_CUBE = registerBlock("slabs_cube" , new ReFramedSlabsCubeBlock(cp(Blocks.OAK_SLAB)));
|
||||||
SLABS_STAIR = registerBlock("slabs_stair" , new ReFramedSlabsStairBlock(cp(Blocks.OAK_STAIRS)));
|
SLABS_STAIR = registerBlock("slabs_stair" , new ReFramedSlabsStairBlock(cp(Blocks.OAK_STAIRS)));
|
||||||
|
SLABS_OUTER_STAIR = registerBlock("slabs_outer_stair" , new ReFramedSlabsOuterStairBlock(cp(Blocks.OAK_STAIRS)));
|
||||||
|
SLABS_INNER_STAIR = registerBlock("slabs_inner_stair" , new ReFramedSlabsInnerStairBlock(cp(Blocks.OAK_STAIRS)));
|
||||||
STEP = registerBlock("step" , new ReFramedStepBlock(cp(Blocks.OAK_SLAB)));
|
STEP = registerBlock("step" , new ReFramedStepBlock(cp(Blocks.OAK_SLAB)));
|
||||||
STEPS_SLAB = registerBlock("steps_slab" , new ReFramedStepsSlabBlock(cp(Blocks.OAK_SLAB)));
|
STEPS_SLAB = registerBlock("steps_slab" , new ReFramedStepsSlabBlock(cp(Blocks.OAK_SLAB)));
|
||||||
PILLAR = registerBlock("pillar" , new ReFramedPillarBlock(cp(Blocks.OAK_FENCE)));
|
PILLAR = registerBlock("pillar" , new ReFramedPillarBlock(cp(Blocks.OAK_FENCE)));
|
||||||
|
@ -62,6 +62,7 @@ public abstract class ConnectingReFramedBlock extends WaterloggableReFramedBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
||||||
s.with(getConnectionProperty(rotation.rotate(dir)), state.get(getConnectionProperty(dir)))
|
s.with(getConnectionProperty(rotation.rotate(dir)), state.get(getConnectionProperty(dir)))
|
||||||
@ -69,6 +70,7 @@ public abstract class ConnectingReFramedBlock extends WaterloggableReFramedBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
||||||
s.with(getConnectionProperty(mirror.apply(dir)), state.get(getConnectionProperty(dir)))
|
s.with(getConnectionProperty(mirror.apply(dir)), state.get(getConnectionProperty(dir)))
|
||||||
@ -78,6 +80,7 @@ public abstract class ConnectingReFramedBlock extends WaterloggableReFramedBlock
|
|||||||
protected abstract boolean connectsTo(BlockState state, boolean fs, Direction dir);
|
protected abstract boolean connectsTo(BlockState state, boolean fs, Direction dir);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public abstract VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context);
|
public abstract VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context);
|
||||||
|
|
||||||
public static BooleanProperty getConnectionProperty(Direction dir) {
|
public static BooleanProperty getConnectionProperty(Direction dir) {
|
||||||
|
@ -0,0 +1,68 @@
|
|||||||
|
package fr.adrien1106.reframed.block;
|
||||||
|
|
||||||
|
import fr.adrien1106.reframed.util.blocks.BlockHelper;
|
||||||
|
import fr.adrien1106.reframed.util.blocks.Corner;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.ShapeContext;
|
||||||
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
|
import net.minecraft.state.StateManager;
|
||||||
|
import net.minecraft.util.BlockMirror;
|
||||||
|
import net.minecraft.util.BlockRotation;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
import net.minecraft.world.BlockView;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER;
|
||||||
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER_FACE;
|
||||||
|
|
||||||
|
public abstract class CornerDoubleReFramedBlock extends WaterloggableReFramedDoubleBlock {
|
||||||
|
|
||||||
|
public CornerDoubleReFramedBlock(Settings settings) {
|
||||||
|
super(settings);
|
||||||
|
setDefaultState(getDefaultState().with(CORNER, Corner.NORTH_EAST_DOWN).with(CORNER_FACE, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||||
|
super.appendProperties(builder.add(CORNER,CORNER_FACE));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @Nullable BlockState getPlacementState(ItemPlacementContext ctx) {
|
||||||
|
Corner corner = BlockHelper.getPlacementCorner(ctx);
|
||||||
|
return super.getPlacementState(ctx)
|
||||||
|
.with(CORNER, corner)
|
||||||
|
.with(CORNER_FACE, corner.getDirectionIndex(ctx.getSide().getOpposite()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public abstract VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context);
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
|
Corner corner = state.get(CORNER);
|
||||||
|
Direction face = corner.getDirection(state.get(CORNER_FACE));
|
||||||
|
return state
|
||||||
|
.with(CORNER, corner.rotate(rotation))
|
||||||
|
.with(CORNER_FACE, corner.getDirectionIndex(rotation.rotate(face)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
|
Corner corner = state.get(CORNER);
|
||||||
|
Direction face = corner.getDirection(state.get(CORNER_FACE));
|
||||||
|
return state
|
||||||
|
.with(CORNER, corner.mirror(mirror))
|
||||||
|
.with(CORNER_FACE, corner.getDirectionIndex(mirror.apply(face)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public abstract VoxelShape getShape(BlockState state, int i);
|
||||||
|
}
|
@ -32,14 +32,17 @@ public abstract class PillarReFramedBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public abstract VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context);
|
public abstract VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(AXIS, rotation.rotate(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis());
|
return state.with(AXIS, rotation.rotate(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return state.with(AXIS, mirror.apply(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis());
|
return state.with(AXIS, mirror.apply(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis());
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,7 @@ public class ReFramedBlock extends Block implements BlockEntityProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
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 (!canUse(world, pos, player)) return ActionResult.PASS;
|
if (!canUse(world, pos, player)) return ActionResult.PASS;
|
||||||
ActionResult result = BlockHelper.useUpgrade(state, world, pos, player, hand);
|
ActionResult result = BlockHelper.useUpgrade(state, world, pos, player, hand);
|
||||||
@ -73,6 +74,7 @@ public class ReFramedBlock extends Block implements BlockEntityProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState new_state, boolean moved) {
|
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState new_state, boolean moved) {
|
||||||
if(!(new_state.getBlock() instanceof ReFramedBlock) &&
|
if(!(new_state.getBlock() instanceof ReFramedBlock) &&
|
||||||
world.getBlockEntity(pos) instanceof ReFramedEntity frame_entity &&
|
world.getBlockEntity(pos) instanceof ReFramedEntity frame_entity &&
|
||||||
@ -151,6 +153,7 @@ public class ReFramedBlock extends Block implements BlockEntityProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
|
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
|
||||||
return isGhost(view, pos)
|
return isGhost(view, pos)
|
||||||
? VoxelShapes.empty()
|
? VoxelShapes.empty()
|
||||||
@ -158,6 +161,7 @@ public class ReFramedBlock extends Block implements BlockEntityProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getCullingShape(BlockState state, BlockView view, BlockPos pos) {
|
public VoxelShape getCullingShape(BlockState state, BlockView view, BlockPos pos) {
|
||||||
return isGhost(view, pos)
|
return isGhost(view, pos)
|
||||||
? VoxelShapes.empty()
|
? VoxelShapes.empty()
|
||||||
@ -174,11 +178,13 @@ public class ReFramedBlock extends Block implements BlockEntityProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) {
|
public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) {
|
||||||
return view.getBlockEntity(pos) instanceof ReFramedEntity be && be.emitsRedstone() ? 15 : 0;
|
return view.getBlockEntity(pos) instanceof ReFramedEntity be && be.emitsRedstone() ? 15 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) {
|
public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) {
|
||||||
return getWeakRedstonePower(state, view, pos, dir);
|
return getWeakRedstonePower(state, view, pos, dir);
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ public class ReFramedButtonBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||||
return canPlaceAt(world, pos, getDirection(state).getOpposite());
|
return canPlaceAt(world, pos, getDirection(state).getOpposite());
|
||||||
}
|
}
|
||||||
@ -96,6 +97,7 @@ public class ReFramedButtonBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stackMerger) {
|
public void onExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stackMerger) {
|
||||||
if (explosion.getDestructionType() == Explosion.DestructionType.TRIGGER_BLOCK && !world.isClient() && !(Boolean)state.get(POWERED)) {
|
if (explosion.getDestructionType() == Explosion.DestructionType.TRIGGER_BLOCK && !world.isClient() && !(Boolean)state.get(POWERED)) {
|
||||||
powerOn(state, world, pos);
|
powerOn(state, world, pos);
|
||||||
@ -120,6 +122,7 @@ public class ReFramedButtonBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return BUTTON_VOXELS[
|
return BUTTON_VOXELS[
|
||||||
(state.get(POWERED) ? 12 : 0) +
|
(state.get(POWERED) ? 12 : 0) +
|
||||||
@ -129,11 +132,13 @@ public class ReFramedButtonBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(HORIZONTAL_FACING, rotation.rotate(state.get(HORIZONTAL_FACING)));
|
return state.with(HORIZONTAL_FACING, rotation.rotate(state.get(HORIZONTAL_FACING)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return state.with(HORIZONTAL_FACING, mirror.apply(state.get(HORIZONTAL_FACING)));
|
return state.with(HORIZONTAL_FACING, mirror.apply(state.get(HORIZONTAL_FACING)));
|
||||||
}
|
}
|
||||||
@ -159,16 +164,19 @@ public class ReFramedButtonBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean emitsRedstonePower(BlockState state) {
|
public boolean emitsRedstonePower(BlockState state) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
|
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
|
||||||
if (state.get(POWERED)) tryPowerWithProjectiles(state, world, pos);
|
if (state.get(POWERED)) tryPowerWithProjectiles(state, world, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
|
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
|
||||||
if (!world.isClient && !state.get(POWERED)) tryPowerWithProjectiles(state, world, pos);
|
if (!world.isClient && !state.get(POWERED)) tryPowerWithProjectiles(state, world, pos);
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ public class ReFramedDoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||||
BlockPos pos_down = pos.down();
|
BlockPos pos_down = pos.down();
|
||||||
BlockState state_down = world.getBlockState(pos_down);
|
BlockState state_down = world.getBlockState(pos_down);
|
||||||
@ -64,6 +65,7 @@ public class ReFramedDoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block source, BlockPos sourcePos, boolean notify) {
|
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block source, BlockPos sourcePos, boolean notify) {
|
||||||
if (world.isClient) return;
|
if (world.isClient) return;
|
||||||
boolean powered = world.isReceivingRedstonePower(pos)
|
boolean powered = world.isReceivingRedstonePower(pos)
|
||||||
@ -162,6 +164,7 @@ public class ReFramedDoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) {
|
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) {
|
||||||
return switch (type) {
|
return switch (type) {
|
||||||
case LAND, AIR -> state.get(OPEN);
|
case LAND, AIR -> state.get(OPEN);
|
||||||
@ -170,6 +173,7 @@ public class ReFramedDoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stack_merger) {
|
public void onExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stack_merger) {
|
||||||
if (explosion.getDestructionType() == Explosion.DestructionType.TRIGGER_BLOCK
|
if (explosion.getDestructionType() == Explosion.DestructionType.TRIGGER_BLOCK
|
||||||
&& !world.isClient()
|
&& !world.isClient()
|
||||||
@ -192,6 +196,7 @@ public class ReFramedDoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
Direction direction = state.get(HORIZONTAL_FACING);
|
Direction direction = state.get(HORIZONTAL_FACING);
|
||||||
if (state.get(OPEN)) direction = switch (state.get(DOOR_HINGE)) {
|
if (state.get(OPEN)) direction = switch (state.get(DOOR_HINGE)) {
|
||||||
@ -202,16 +207,19 @@ public class ReFramedDoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(HORIZONTAL_FACING, rotation.rotate(state.get(HORIZONTAL_FACING)));
|
return state.with(HORIZONTAL_FACING, rotation.rotate(state.get(HORIZONTAL_FACING)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return mirror == BlockMirror.NONE ? state : state.with(HORIZONTAL_FACING, mirror.apply(state.get(HORIZONTAL_FACING))).cycle(DOOR_HINGE);
|
return mirror == BlockMirror.NONE ? state : state.with(HORIZONTAL_FACING, mirror.apply(state.get(HORIZONTAL_FACING))).cycle(DOOR_HINGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public long getRenderingSeed(BlockState state, BlockPos pos) {
|
public long getRenderingSeed(BlockState state, BlockPos pos) {
|
||||||
return MathHelper.hashCode(pos.getX(), pos.down(state.get(DOUBLE_BLOCK_HALF) == DoubleBlockHalf.LOWER ? 0 : 1).getY(), pos.getZ());
|
return MathHelper.hashCode(pos.getX(), pos.down(state.get(DOUBLE_BLOCK_HALF) == DoubleBlockHalf.LOWER ? 0 : 1).getY(), pos.getZ());
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ import net.minecraft.world.World;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import static net.minecraft.util.shape.VoxelShapes.empty;
|
import static net.minecraft.util.shape.VoxelShapes.empty;
|
||||||
import static net.minecraft.util.shape.VoxelShapes.fullCube;
|
|
||||||
|
|
||||||
public abstract class ReFramedDoubleBlock extends ReFramedBlock {
|
public abstract class ReFramedDoubleBlock extends ReFramedBlock {
|
||||||
public ReFramedDoubleBlock(Settings settings) {
|
public ReFramedDoubleBlock(Settings settings) {
|
||||||
@ -61,7 +60,7 @@ public abstract class ReFramedDoubleBlock extends ReFramedBlock {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
|
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
|
||||||
return isGhost(view, pos) ? empty() : fullCube();
|
return isGhost(view, pos) ? empty() : getOutlineShape(state, view, pos, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -56,6 +56,7 @@ public class ReFramedFenceBlock extends ConnectingReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getCameraCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getCameraCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getOutlineShape(state, world, pos, context);
|
return getOutlineShape(state, world, pos, context);
|
||||||
}
|
}
|
||||||
@ -66,10 +67,12 @@ public class ReFramedFenceBlock extends ConnectingReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) {
|
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@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) {
|
||||||
ActionResult result = super.onUse(state, world, pos, player, hand, hit);
|
ActionResult result = super.onUse(state, world, pos, player, hand, hit);
|
||||||
if (result.isAccepted()) return result;
|
if (result.isAccepted()) return result;
|
||||||
|
@ -25,6 +25,7 @@ import java.util.Map;
|
|||||||
import static fr.adrien1106.reframed.util.VoxelHelper.VoxelListBuilder;
|
import static fr.adrien1106.reframed.util.VoxelHelper.VoxelListBuilder;
|
||||||
import static fr.adrien1106.reframed.util.blocks.BlockProperties.*;
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.*;
|
||||||
import static fr.adrien1106.reframed.util.blocks.Corner.*;
|
import static fr.adrien1106.reframed.util.blocks.Corner.*;
|
||||||
|
import static net.minecraft.state.property.Properties.FACING;
|
||||||
import static net.minecraft.state.property.Properties.WATERLOGGED;
|
import static net.minecraft.state.property.Properties.WATERLOGGED;
|
||||||
|
|
||||||
public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock {
|
public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock {
|
||||||
@ -42,6 +43,7 @@ public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
||||||
if (context.getPlayer() == null) return false;
|
if (context.getPlayer() == null) return false;
|
||||||
Direction dir = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
Direction dir = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
||||||
@ -51,7 +53,7 @@ public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock {
|
|||||||
|| (
|
|| (
|
||||||
!(
|
!(
|
||||||
block_item.getBlock() == this
|
block_item.getBlock() == this
|
||||||
&& ((ReFramedHalfStairsStairBlock) ReFramed.HALF_STAIRS_STAIR)
|
&& ReFramed.HALF_STAIRS_STAIR
|
||||||
.matchesShape(
|
.matchesShape(
|
||||||
context.getHitPos(),
|
context.getHitPos(),
|
||||||
context.getBlockPos(),
|
context.getBlockPos(),
|
||||||
@ -92,6 +94,15 @@ public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock {
|
|||||||
return ReFramed.HALF_STAIRS_STAIR.getDefaultState()
|
return ReFramed.HALF_STAIRS_STAIR.getDefaultState()
|
||||||
.with(EDGE, current_state.get(CORNER).getEdge(current_state.get(CORNER).getDirection(current_state.get(CORNER_FACE))))
|
.with(EDGE, current_state.get(CORNER).getEdge(current_state.get(CORNER).getDirection(current_state.get(CORNER_FACE))))
|
||||||
.with(WATERLOGGED, current_state.get(WATERLOGGED));
|
.with(WATERLOGGED, current_state.get(WATERLOGGED));
|
||||||
|
else if (current_state.isOf(ReFramed.SLAB)) {
|
||||||
|
Corner corner = BlockHelper.getPlacementCorner(ctx);
|
||||||
|
Direction face = current_state.get(FACING);
|
||||||
|
if (!corner.hasDirection(face)) corner = corner.change(face.getOpposite());
|
||||||
|
return ReFramed.SLABS_INNER_STAIR.getDefaultState()
|
||||||
|
.with(CORNER, corner)
|
||||||
|
.with(CORNER_FACE, corner.getDirectionIndex(face))
|
||||||
|
.with(WATERLOGGED, current_state.get(WATERLOGGED));
|
||||||
|
}
|
||||||
|
|
||||||
Corner corner = BlockHelper.getPlacementCorner(ctx);
|
Corner corner = BlockHelper.getPlacementCorner(ctx);
|
||||||
return super.getPlacementState(ctx)
|
return super.getPlacementState(ctx)
|
||||||
@ -100,11 +111,13 @@ public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getHalfStairShape(state.get(CORNER), state.get(CORNER_FACE));
|
return getHalfStairShape(state.get(CORNER), state.get(CORNER_FACE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
Corner corner = state.get(CORNER).rotate(rotation);
|
Corner corner = state.get(CORNER).rotate(rotation);
|
||||||
Direction face = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
Direction face = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
||||||
@ -112,6 +125,7 @@ public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
Corner corner = state.get(CORNER).mirror(mirror);
|
Corner corner = state.get(CORNER).mirror(mirror);
|
||||||
Direction face = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
Direction face = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
||||||
|
@ -21,7 +21,6 @@ import static fr.adrien1106.reframed.block.ReFramedSmallCubeBlock.getSmallCubeSh
|
|||||||
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER;
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER;
|
||||||
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER_FACE;
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER_FACE;
|
||||||
import static fr.adrien1106.reframed.util.blocks.Corner.NORTH_EAST_DOWN;
|
import static fr.adrien1106.reframed.util.blocks.Corner.NORTH_EAST_DOWN;
|
||||||
import static net.minecraft.util.shape.VoxelShapes.empty;
|
|
||||||
|
|
||||||
public class ReFramedHalfStairsSlabBlock extends WaterloggableReFramedDoubleBlock {
|
public class ReFramedHalfStairsSlabBlock extends WaterloggableReFramedDoubleBlock {
|
||||||
|
|
||||||
@ -44,16 +43,13 @@ public class ReFramedHalfStairsSlabBlock extends WaterloggableReFramedDoubleBloc
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
|
@SuppressWarnings("deprecation")
|
||||||
return isGhost(view, pos) ? empty(): getOutlineShape(state, view, pos, ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getSlabShape(state.get(CORNER).getDirection(state.get(CORNER_FACE)));
|
return getSlabShape(state.get(CORNER).getDirection(state.get(CORNER_FACE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
Corner corner = state.get(CORNER).rotate(rotation);
|
Corner corner = state.get(CORNER).rotate(rotation);
|
||||||
Direction face = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
Direction face = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
||||||
@ -61,6 +57,7 @@ public class ReFramedHalfStairsSlabBlock extends WaterloggableReFramedDoubleBloc
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
Corner corner = state.get(CORNER).mirror(mirror);
|
Corner corner = state.get(CORNER).mirror(mirror);
|
||||||
Direction face = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
Direction face = state.get(CORNER).getDirection(state.get(CORNER_FACE));
|
||||||
|
@ -21,7 +21,6 @@ import static fr.adrien1106.reframed.block.ReFramedHalfStairBlock.getHalfStairSh
|
|||||||
import static fr.adrien1106.reframed.block.ReFramedStairBlock.getStairShape;
|
import static fr.adrien1106.reframed.block.ReFramedStairBlock.getStairShape;
|
||||||
import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE;
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE;
|
||||||
import static fr.adrien1106.reframed.util.blocks.Edge.*;
|
import static fr.adrien1106.reframed.util.blocks.Edge.*;
|
||||||
import static net.minecraft.util.shape.VoxelShapes.empty;
|
|
||||||
|
|
||||||
public class ReFramedHalfStairsStairBlock extends WaterloggableReFramedDoubleBlock {
|
public class ReFramedHalfStairsStairBlock extends WaterloggableReFramedDoubleBlock {
|
||||||
public ReFramedHalfStairsStairBlock(Settings settings) {
|
public ReFramedHalfStairsStairBlock(Settings settings) {
|
||||||
@ -41,21 +40,19 @@ public class ReFramedHalfStairsStairBlock extends WaterloggableReFramedDoubleBlo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
|
@SuppressWarnings("deprecation")
|
||||||
return isGhost(view, pos) ? empty(): getStairShape(state.get(EDGE), StairShape.STRAIGHT);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getStairShape(state.get(EDGE), StairShape.STRAIGHT);
|
return getStairShape(state.get(EDGE), StairShape.STRAIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(EDGE, state.get(EDGE).rotate(rotation));
|
return state.with(EDGE, state.get(EDGE).rotate(rotation));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return state.with(EDGE, state.get(EDGE).mirror(mirror));
|
return state.with(EDGE, state.get(EDGE).mirror(mirror));
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,6 @@ import net.minecraft.item.ItemPlacementContext;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.loot.context.LootContextParameterSet;
|
import net.minecraft.loot.context.LootContextParameterSet;
|
||||||
import net.minecraft.state.StateManager;
|
import net.minecraft.state.StateManager;
|
||||||
import net.minecraft.util.BlockMirror;
|
|
||||||
import net.minecraft.util.BlockRotation;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.shape.VoxelShape;
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
@ -32,6 +30,7 @@ public class ReFramedLayerBlock extends ReFramedSlabBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public List<ItemStack> getDroppedStacks(BlockState state, LootContextParameterSet.Builder builder) {
|
public List<ItemStack> getDroppedStacks(BlockState state, LootContextParameterSet.Builder builder) {
|
||||||
List<ItemStack> drops = super.getDroppedStacks(state, builder);
|
List<ItemStack> drops = super.getDroppedStacks(state, builder);
|
||||||
drops.forEach((stack) -> {
|
drops.forEach((stack) -> {
|
||||||
@ -68,16 +67,6 @@ public class ReFramedLayerBlock extends ReFramedSlabBlock {
|
|||||||
return previous.with(LAYERS, previous.get(LAYERS) + 1);
|
return previous.with(LAYERS, previous.get(LAYERS) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
|
||||||
return state.with(FACING, rotation.rotate(state.get(FACING)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
|
||||||
return state.with(FACING, mirror.apply(state.get(FACING)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
VoxelListBuilder builder = VoxelListBuilder.create(createCuboidShape(0, 0, 0, 16, 2, 16), 48)
|
VoxelListBuilder builder = VoxelListBuilder.create(createCuboidShape(0, 0, 0, 16, 2, 16), 48)
|
||||||
.add(createCuboidShape(0, 0, 0, 16, 4, 16))
|
.add(createCuboidShape(0, 0, 0, 16, 4, 16))
|
||||||
|
@ -95,6 +95,7 @@ public class ReFramedPillarsWallBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
VoxelShape shape = WALL_VOXELS[0];
|
VoxelShape shape = WALL_VOXELS[0];
|
||||||
for (Direction dir: Direction.Type.HORIZONTAL) {
|
for (Direction dir: Direction.Type.HORIZONTAL) {
|
||||||
@ -106,6 +107,7 @@ public class ReFramedPillarsWallBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
||||||
s.with(getWallShape(rotation.rotate(dir)), state.get(getWallShape(dir)))
|
s.with(getWallShape(rotation.rotate(dir)), state.get(getWallShape(dir)))
|
||||||
@ -113,6 +115,7 @@ public class ReFramedPillarsWallBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
||||||
s.with(getWallShape(mirror.apply(dir)), state.get(getWallShape(dir)))
|
s.with(getWallShape(mirror.apply(dir)), state.get(getWallShape(dir)))
|
||||||
|
@ -74,6 +74,7 @@ public class ReFramedPostFenceBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
||||||
s.with(getConnectionProperty(rotation.rotate(dir)), state.get(getConnectionProperty(dir)))
|
s.with(getConnectionProperty(rotation.rotate(dir)), state.get(getConnectionProperty(dir)))
|
||||||
@ -81,6 +82,7 @@ public class ReFramedPostFenceBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
||||||
s.with(getConnectionProperty(mirror.apply(dir)), state.get(getConnectionProperty(dir)))
|
s.with(getConnectionProperty(mirror.apply(dir)), state.get(getConnectionProperty(dir)))
|
||||||
@ -104,6 +106,7 @@ public class ReFramedPostFenceBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
VoxelShape shape = FENCE_VOXELS[0];
|
VoxelShape shape = FENCE_VOXELS[0];
|
||||||
for (Direction dir: Direction.Type.HORIZONTAL) {
|
for (Direction dir: Direction.Type.HORIZONTAL) {
|
||||||
@ -124,6 +127,7 @@ public class ReFramedPostFenceBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getCameraCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getCameraCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getOutlineShape(state, world, pos, context);
|
return getOutlineShape(state, world, pos, context);
|
||||||
}
|
}
|
||||||
@ -134,6 +138,7 @@ public class ReFramedPostFenceBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) {
|
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -41,15 +41,19 @@ public class ReFramedSlabBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
||||||
if (context.getPlayer() == null
|
if (context.getPlayer() == null
|
||||||
|| context.getPlayer().isSneaking()
|
|| context.getPlayer().isSneaking()
|
||||||
|| !(context.getStack().getItem() instanceof BlockItem block_item)
|
|| !(context.getStack().getItem() instanceof BlockItem block_item)
|
||||||
) return false;
|
) return false;
|
||||||
|
|
||||||
// allow replacing with slab and step
|
// allow replacing with slab, step, small cube and half stair
|
||||||
if (block_item.getBlock() != this && block_item.getBlock() != ReFramed.STEP)
|
if (block_item.getBlock() != this
|
||||||
return false;
|
&& block_item.getBlock() != ReFramed.STEP
|
||||||
|
&& block_item.getBlock() != ReFramed.SMALL_CUBE
|
||||||
|
&& block_item.getBlock() != ReFramed.HALF_STAIR
|
||||||
|
) return false;
|
||||||
|
|
||||||
// check if the player is clicking on the inner part of the block
|
// check if the player is clicking on the inner part of the block
|
||||||
return ReFramed.SLABS_CUBE
|
return ReFramed.SLABS_CUBE
|
||||||
@ -73,16 +77,19 @@ public class ReFramedSlabBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getSlabShape(state.get(FACING));
|
return getSlabShape(state.get(FACING));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(FACING, rotation.rotate(state.get(FACING)));
|
return state.with(FACING, rotation.rotate(state.get(FACING)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return state.with(FACING, mirror.apply(state.get(FACING)));
|
return state.with(FACING, mirror.apply(state.get(FACING)));
|
||||||
}
|
}
|
||||||
@ -100,6 +107,10 @@ public class ReFramedSlabBlock extends WaterloggableReFramedBlock {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Integer, Integer> getThemeMap(BlockState state, BlockState new_state) {
|
public Map<Integer, Integer> getThemeMap(BlockState state, BlockState new_state) {
|
||||||
|
if (new_state.isOf(ReFramed.SLABS_STAIR)
|
||||||
|
|| new_state.isOf(ReFramed.SLABS_OUTER_STAIR)
|
||||||
|
|| new_state.isOf(ReFramed.SLABS_INNER_STAIR)
|
||||||
|
) return Map.of(1, 1);
|
||||||
if (new_state.isOf(ReFramed.SLABS_CUBE)) return Map.of(1, state.get(FACING).getDirection() == Direction.AxisDirection.POSITIVE ? 2 : 1);
|
if (new_state.isOf(ReFramed.SLABS_CUBE)) return Map.of(1, state.get(FACING).getDirection() == Direction.AxisDirection.POSITIVE ? 2 : 1);
|
||||||
return super.getThemeMap(state, new_state);
|
return super.getThemeMap(state, new_state);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ import net.minecraft.util.shape.VoxelShape;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import static fr.adrien1106.reframed.block.ReFramedSlabBlock.*;
|
import static fr.adrien1106.reframed.block.ReFramedSlabBlock.*;
|
||||||
import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE;
|
|
||||||
import static net.minecraft.state.property.Properties.AXIS;
|
import static net.minecraft.state.property.Properties.AXIS;
|
||||||
|
|
||||||
public class ReFramedSlabsCubeBlock extends ReFramedDoubleBlock {
|
public class ReFramedSlabsCubeBlock extends ReFramedDoubleBlock {
|
||||||
@ -33,11 +32,13 @@ public class ReFramedSlabsCubeBlock extends ReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(AXIS, rotation.rotate(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis());
|
return state.with(AXIS, rotation.rotate(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return state.with(AXIS, mirror.apply(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis());
|
return state.with(AXIS, mirror.apply(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis());
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
package fr.adrien1106.reframed.block;
|
||||||
|
|
||||||
|
import fr.adrien1106.reframed.util.blocks.Corner;
|
||||||
|
import fr.adrien1106.reframed.util.blocks.Edge;
|
||||||
|
import fr.adrien1106.reframed.util.blocks.StairShape;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.ShapeContext;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
import net.minecraft.world.BlockView;
|
||||||
|
|
||||||
|
import static fr.adrien1106.reframed.block.ReFramedHalfStairBlock.getHalfStairShape;
|
||||||
|
import static fr.adrien1106.reframed.block.ReFramedSlabBlock.getSlabShape;
|
||||||
|
import static fr.adrien1106.reframed.block.ReFramedStairBlock.getStairShape;
|
||||||
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER;
|
||||||
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER_FACE;
|
||||||
|
|
||||||
|
public class ReFramedSlabsInnerStairBlock extends CornerDoubleReFramedBlock {
|
||||||
|
|
||||||
|
public ReFramedSlabsInnerStairBlock(Settings settings) {
|
||||||
|
super(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
|
Corner corner = state.get(CORNER);
|
||||||
|
Direction face = corner.getDirection(state.get(CORNER_FACE));
|
||||||
|
Edge edge = corner.getEdge(face);
|
||||||
|
return getStairShape(
|
||||||
|
edge,
|
||||||
|
face.getDirection() == Direction.AxisDirection.POSITIVE
|
||||||
|
? StairShape.INNER_LEFT
|
||||||
|
: StairShape.INNER_RIGHT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VoxelShape getShape(BlockState state, int i) {
|
||||||
|
Corner corner = state.get(CORNER);
|
||||||
|
Direction face = corner.getDirection(state.get(CORNER_FACE));
|
||||||
|
if (i == 2) corner = corner.change(face);
|
||||||
|
return i == 2
|
||||||
|
? getHalfStairShape(corner, corner.getDirectionIndex(face.getOpposite()))
|
||||||
|
: getSlabShape(face);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package fr.adrien1106.reframed.block;
|
||||||
|
|
||||||
|
import fr.adrien1106.reframed.util.blocks.Corner;
|
||||||
|
import fr.adrien1106.reframed.util.blocks.Edge;
|
||||||
|
import fr.adrien1106.reframed.util.blocks.StairShape;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.ShapeContext;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
import net.minecraft.world.BlockView;
|
||||||
|
|
||||||
|
import static fr.adrien1106.reframed.block.ReFramedSlabBlock.getSlabShape;
|
||||||
|
import static fr.adrien1106.reframed.block.ReFramedSmallCubeBlock.getSmallCubeShape;
|
||||||
|
import static fr.adrien1106.reframed.block.ReFramedStairBlock.getStairShape;
|
||||||
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER;
|
||||||
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER_FACE;
|
||||||
|
|
||||||
|
public class ReFramedSlabsOuterStairBlock extends CornerDoubleReFramedBlock {
|
||||||
|
|
||||||
|
public ReFramedSlabsOuterStairBlock(Settings settings) {
|
||||||
|
super(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
|
Corner corner = state.get(CORNER);
|
||||||
|
Direction face = corner.getDirection(state.get(CORNER_FACE));
|
||||||
|
Edge edge = corner.getEdgeWith(face);
|
||||||
|
return getStairShape(
|
||||||
|
edge,
|
||||||
|
corner.getOtherDirection(edge).getDirection() == Direction.AxisDirection.POSITIVE
|
||||||
|
? edge.getDirectionIndex(face) == 1
|
||||||
|
? StairShape.FIRST_OUTER_LEFT
|
||||||
|
: StairShape.SECOND_OUTER_LEFT
|
||||||
|
: edge.getDirectionIndex(face) == 1
|
||||||
|
? StairShape.FIRST_OUTER_RIGHT
|
||||||
|
: StairShape.SECOND_OUTER_RIGHT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VoxelShape getShape(BlockState state, int i) {
|
||||||
|
Corner corner = state.get(CORNER);
|
||||||
|
Direction face = corner.getDirection(state.get(CORNER_FACE));
|
||||||
|
return i == 2
|
||||||
|
? getSmallCubeShape(corner.change(face))
|
||||||
|
: getSlabShape(face);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -21,7 +21,6 @@ import static fr.adrien1106.reframed.block.ReFramedStairBlock.getStairShape;
|
|||||||
import static fr.adrien1106.reframed.block.ReFramedStepBlock.getStepShape;
|
import static fr.adrien1106.reframed.block.ReFramedStepBlock.getStepShape;
|
||||||
import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE;
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE;
|
||||||
import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE_FACE;
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE_FACE;
|
||||||
import static net.minecraft.util.shape.VoxelShapes.empty;
|
|
||||||
|
|
||||||
public class ReFramedSlabsStairBlock extends WaterloggableReFramedDoubleBlock {
|
public class ReFramedSlabsStairBlock extends WaterloggableReFramedDoubleBlock {
|
||||||
|
|
||||||
@ -44,16 +43,13 @@ public class ReFramedSlabsStairBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
|
@SuppressWarnings("deprecation")
|
||||||
return isGhost(view, pos) ? empty() : getOutlineShape(state, view, pos, ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getStairShape(state.get(EDGE), StairShape.STRAIGHT);
|
return getStairShape(state.get(EDGE), StairShape.STRAIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
Edge edge = state.get(EDGE).rotate(rotation);
|
Edge edge = state.get(EDGE).rotate(rotation);
|
||||||
Direction face = state.get(EDGE).getDirection(state.get(EDGE_FACE));
|
Direction face = state.get(EDGE).getDirection(state.get(EDGE_FACE));
|
||||||
@ -61,6 +57,7 @@ public class ReFramedSlabsStairBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
Edge edge = state.get(EDGE).mirror(mirror);
|
Edge edge = state.get(EDGE).mirror(mirror);
|
||||||
Direction face = state.get(EDGE).getDirection(state.get(EDGE_FACE));
|
Direction face = state.get(EDGE).getDirection(state.get(EDGE_FACE));
|
||||||
|
@ -25,6 +25,7 @@ import java.util.Map;
|
|||||||
import static fr.adrien1106.reframed.util.VoxelHelper.VoxelListBuilder;
|
import static fr.adrien1106.reframed.util.VoxelHelper.VoxelListBuilder;
|
||||||
import static fr.adrien1106.reframed.util.blocks.BlockProperties.*;
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.*;
|
||||||
import static fr.adrien1106.reframed.util.blocks.Corner.*;
|
import static fr.adrien1106.reframed.util.blocks.Corner.*;
|
||||||
|
import static net.minecraft.state.property.Properties.FACING;
|
||||||
import static net.minecraft.state.property.Properties.WATERLOGGED;
|
import static net.minecraft.state.property.Properties.WATERLOGGED;
|
||||||
|
|
||||||
public class ReFramedSmallCubeBlock extends WaterloggableReFramedBlock {
|
public class ReFramedSmallCubeBlock extends WaterloggableReFramedBlock {
|
||||||
@ -42,6 +43,7 @@ public class ReFramedSmallCubeBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
||||||
if (context.getPlayer() == null) return false;
|
if (context.getPlayer() == null) return false;
|
||||||
Corner corner = state.get(CORNER);
|
Corner corner = state.get(CORNER);
|
||||||
@ -63,21 +65,21 @@ public class ReFramedSmallCubeBlock extends WaterloggableReFramedBlock {
|
|||||||
&& !(
|
&& !(
|
||||||
block_item.getBlock() == this
|
block_item.getBlock() == this
|
||||||
&& (
|
&& (
|
||||||
((ReFramedSmallCubesStepBlock) ReFramed.SMALL_CUBES_STEP)
|
ReFramed.SMALL_CUBES_STEP
|
||||||
.matchesShape(
|
.matchesShape(
|
||||||
context.getHitPos(),
|
context.getHitPos(),
|
||||||
context.getBlockPos(),
|
context.getBlockPos(),
|
||||||
ReFramed.SMALL_CUBES_STEP.getDefaultState().with(EDGE, corner.getEdge(corner.getFirstDirection())),
|
ReFramed.SMALL_CUBES_STEP.getDefaultState().with(EDGE, corner.getEdge(corner.getFirstDirection())),
|
||||||
corner.getFirstDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2
|
corner.getFirstDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2
|
||||||
)
|
)
|
||||||
|| ((ReFramedSmallCubesStepBlock) ReFramed.SMALL_CUBES_STEP)
|
|| ReFramed.SMALL_CUBES_STEP
|
||||||
.matchesShape(
|
.matchesShape(
|
||||||
context.getHitPos(),
|
context.getHitPos(),
|
||||||
context.getBlockPos(),
|
context.getBlockPos(),
|
||||||
ReFramed.SMALL_CUBES_STEP.getDefaultState().with(EDGE, corner.getEdge(corner.getSecondDirection())),
|
ReFramed.SMALL_CUBES_STEP.getDefaultState().with(EDGE, corner.getEdge(corner.getSecondDirection())),
|
||||||
corner.getSecondDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2
|
corner.getSecondDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2
|
||||||
)
|
)
|
||||||
|| ((ReFramedSmallCubesStepBlock) ReFramed.SMALL_CUBES_STEP)
|
|| ReFramed.SMALL_CUBES_STEP
|
||||||
.matchesShape(
|
.matchesShape(
|
||||||
context.getHitPos(),
|
context.getHitPos(),
|
||||||
context.getBlockPos(),
|
context.getBlockPos(),
|
||||||
@ -118,22 +120,33 @@ public class ReFramedSmallCubeBlock extends WaterloggableReFramedBlock {
|
|||||||
corner.getSecondDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2
|
corner.getSecondDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2
|
||||||
)) return state;
|
)) return state;
|
||||||
return state.with(EDGE, corner.getEdge(corner.getThirdDirection()));
|
return state.with(EDGE, corner.getEdge(corner.getThirdDirection()));
|
||||||
|
} else if (current_state.isOf(ReFramed.SLAB)) {
|
||||||
|
Corner corner = BlockHelper.getPlacementCorner(ctx);
|
||||||
|
Direction face = current_state.get(FACING);
|
||||||
|
if (!corner.hasDirection(face)) corner = corner.change(face.getOpposite());
|
||||||
|
return ReFramed.SLABS_OUTER_STAIR.getDefaultState()
|
||||||
|
.with(CORNER, corner)
|
||||||
|
.with(CORNER_FACE, corner.getDirectionIndex(face))
|
||||||
|
.with(WATERLOGGED, current_state.get(WATERLOGGED));
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getPlacementState(ctx).with(CORNER, BlockHelper.getPlacementCorner(ctx));
|
return super.getPlacementState(ctx).with(CORNER, BlockHelper.getPlacementCorner(ctx));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getSmallCubeShape(state.get(CORNER));
|
return getSmallCubeShape(state.get(CORNER));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(CORNER, state.get(CORNER).rotate(rotation));
|
return state.with(CORNER, state.get(CORNER).rotate(rotation));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return state.with(CORNER, state.get(CORNER).mirror(mirror));
|
return state.with(CORNER, state.get(CORNER).mirror(mirror));
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import static fr.adrien1106.reframed.block.ReFramedSmallCubeBlock.SMALL_CUBE_VOXELS;
|
import static fr.adrien1106.reframed.block.ReFramedSmallCubeBlock.SMALL_CUBE_VOXELS;
|
||||||
import static fr.adrien1106.reframed.block.ReFramedStepBlock.getStepShape;
|
import static fr.adrien1106.reframed.block.ReFramedStepBlock.getStepShape;
|
||||||
import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE;
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE;
|
||||||
import static net.minecraft.util.shape.VoxelShapes.empty;
|
|
||||||
|
|
||||||
public class ReFramedSmallCubesStepBlock extends WaterloggableReFramedDoubleBlock {
|
public class ReFramedSmallCubesStepBlock extends WaterloggableReFramedDoubleBlock {
|
||||||
|
|
||||||
@ -39,21 +38,19 @@ public class ReFramedSmallCubesStepBlock extends WaterloggableReFramedDoubleBloc
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
|
@SuppressWarnings("deprecation")
|
||||||
return isGhost(view, pos) ? empty(): getStepShape(state.get(EDGE));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getStepShape(state.get(EDGE));
|
return getStepShape(state.get(EDGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(EDGE, state.get(EDGE).rotate(rotation));
|
return state.with(EDGE, state.get(EDGE).rotate(rotation));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return state.with(EDGE, state.get(EDGE).mirror(mirror));
|
return state.with(EDGE, state.get(EDGE).mirror(mirror));
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ public class ReFramedStairBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
||||||
if (context.getPlayer() == null) return false;
|
if (context.getPlayer() == null) return false;
|
||||||
return !(
|
return !(
|
||||||
@ -94,11 +95,13 @@ public class ReFramedStairBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getStairShape(state.get(EDGE), state.get(STAIR_SHAPE));
|
return getStairShape(state.get(EDGE), state.get(STAIR_SHAPE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
Edge prev_edge = state.get(EDGE);
|
Edge prev_edge = state.get(EDGE);
|
||||||
Edge edge = prev_edge.rotate(rotation);
|
Edge edge = prev_edge.rotate(rotation);
|
||||||
@ -115,6 +118,7 @@ public class ReFramedStairBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
Edge prev_edge = state.get(EDGE);
|
Edge prev_edge = state.get(EDGE);
|
||||||
Edge edge = prev_edge.mirror(mirror);
|
Edge edge = prev_edge.mirror(mirror);
|
||||||
|
@ -36,6 +36,7 @@ public class ReFramedStairsCubeBlock extends ReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighbor_state, WorldAccess world, BlockPos pos, BlockPos moved) {
|
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighbor_state, WorldAccess world, BlockPos pos, BlockPos moved) {
|
||||||
return super.getStateForNeighborUpdate(state, direction, neighbor_state, world, pos, moved)
|
return super.getStateForNeighborUpdate(state, direction, neighbor_state, world, pos, moved)
|
||||||
.with(STAIR_SHAPE, BlockHelper.getStairsShape(state.get(EDGE), world, pos));
|
.with(STAIR_SHAPE, BlockHelper.getStairsShape(state.get(EDGE), world, pos));
|
||||||
@ -52,6 +53,7 @@ public class ReFramedStairsCubeBlock extends ReFramedDoubleBlock {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
Edge prev_edge = state.get(EDGE);
|
Edge prev_edge = state.get(EDGE);
|
||||||
Edge edge = prev_edge.rotate(rotation);
|
Edge edge = prev_edge.rotate(rotation);
|
||||||
@ -68,6 +70,7 @@ public class ReFramedStairsCubeBlock extends ReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
Edge prev_edge = state.get(EDGE);
|
Edge prev_edge = state.get(EDGE);
|
||||||
Edge edge = prev_edge.mirror(mirror);
|
Edge edge = prev_edge.mirror(mirror);
|
||||||
|
@ -41,6 +41,7 @@ public class ReFramedStepBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
public boolean canReplace(BlockState state, ItemPlacementContext context) {
|
||||||
if (context.getPlayer() == null
|
if (context.getPlayer() == null
|
||||||
|| context.getPlayer().isSneaking()
|
|| context.getPlayer().isSneaking()
|
||||||
@ -96,8 +97,8 @@ public class ReFramedStepBlock extends WaterloggableReFramedBlock {
|
|||||||
else if (matchesShape(hit, pos,
|
else if (matchesShape(hit, pos,
|
||||||
current_state.with(EDGE, edge.getOpposite(edge.getSecondDirection()))
|
current_state.with(EDGE, edge.getOpposite(edge.getSecondDirection()))
|
||||||
)) return ReFramed.STEPS_SLAB.getDefaultState()
|
)) return ReFramed.STEPS_SLAB.getDefaultState()
|
||||||
.with(FACING, edge.getFirstDirection())
|
.with(FACING, edge.getSecondDirection())
|
||||||
.with(AXIS, edge.getSecondDirection().getAxis())
|
.with(AXIS, edge.getFirstDirection().getAxis())
|
||||||
.with(WATERLOGGED, current_state.get(WATERLOGGED));
|
.with(WATERLOGGED, current_state.get(WATERLOGGED));
|
||||||
|
|
||||||
// Steps Cross
|
// Steps Cross
|
||||||
@ -121,16 +122,19 @@ public class ReFramedStepBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getStepShape(state.get(EDGE));
|
return getStepShape(state.get(EDGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(EDGE, state.get(EDGE).rotate(rotation));
|
return state.with(EDGE, state.get(EDGE).rotate(rotation));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return state.with(EDGE, state.get(EDGE).mirror(mirror));
|
return state.with(EDGE, state.get(EDGE).mirror(mirror));
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ import static fr.adrien1106.reframed.block.ReFramedSlabBlock.getSlabShape;
|
|||||||
import static fr.adrien1106.reframed.block.ReFramedStepBlock.getStepShape;
|
import static fr.adrien1106.reframed.block.ReFramedStepBlock.getStepShape;
|
||||||
import static net.minecraft.state.property.Properties.AXIS;
|
import static net.minecraft.state.property.Properties.AXIS;
|
||||||
import static net.minecraft.state.property.Properties.FACING;
|
import static net.minecraft.state.property.Properties.FACING;
|
||||||
import static net.minecraft.util.shape.VoxelShapes.empty;
|
|
||||||
|
|
||||||
public class ReFramedStepsSlabBlock extends WaterloggableReFramedDoubleBlock {
|
public class ReFramedStepsSlabBlock extends WaterloggableReFramedDoubleBlock {
|
||||||
|
|
||||||
@ -44,16 +43,13 @@ public class ReFramedStepsSlabBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
|
@SuppressWarnings("deprecation")
|
||||||
return isGhost(view, pos) ? empty() : getSlabShape(state.get(FACING));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
return getSlabShape(state.get(FACING));
|
return getSlabShape(state.get(FACING));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state
|
return state
|
||||||
.with(AXIS, rotation.rotate(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis())
|
.with(AXIS, rotation.rotate(Direction.get(Direction.AxisDirection.POSITIVE, state.get(AXIS))).getAxis())
|
||||||
@ -61,6 +57,7 @@ public class ReFramedStepsSlabBlock extends WaterloggableReFramedDoubleBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
if (state.get(FACING).getAxis() != Axis.Y)
|
if (state.get(FACING).getAxis() != Axis.Y)
|
||||||
return state.with(FACING, mirror.apply(state.get(FACING)));
|
return state.with(FACING, mirror.apply(state.get(FACING)));
|
||||||
|
@ -48,6 +48,7 @@ public class ReFramedTrapdoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block source, BlockPos sourcePos, boolean notify) {
|
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block source, BlockPos sourcePos, boolean notify) {
|
||||||
if (world.isClient) return;
|
if (world.isClient) return;
|
||||||
boolean powered = world.isReceivingRedstonePower(pos);
|
boolean powered = world.isReceivingRedstonePower(pos);
|
||||||
@ -99,6 +100,7 @@ public class ReFramedTrapdoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) {
|
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) {
|
||||||
return switch (type) {
|
return switch (type) {
|
||||||
case LAND, AIR -> state.get(OPEN);
|
case LAND, AIR -> state.get(OPEN);
|
||||||
@ -107,6 +109,7 @@ public class ReFramedTrapdoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stack_merger) {
|
public void onExploded(BlockState state, World world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stack_merger) {
|
||||||
if (explosion.getDestructionType() == Explosion.DestructionType.TRIGGER_BLOCK
|
if (explosion.getDestructionType() == Explosion.DestructionType.TRIGGER_BLOCK
|
||||||
&& !world.isClient()
|
&& !world.isClient()
|
||||||
@ -129,6 +132,7 @@ public class ReFramedTrapdoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
int index;
|
int index;
|
||||||
if (!state.get(OPEN)) index = state.get(BLOCK_HALF) == BlockHalf.BOTTOM ? 0 : 1;
|
if (!state.get(OPEN)) index = state.get(BLOCK_HALF) == BlockHalf.BOTTOM ? 0 : 1;
|
||||||
@ -137,11 +141,13 @@ public class ReFramedTrapdoorBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return state.with(HORIZONTAL_FACING, rotation.rotate(state.get(HORIZONTAL_FACING)));
|
return state.with(HORIZONTAL_FACING, rotation.rotate(state.get(HORIZONTAL_FACING)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return state.with(HORIZONTAL_FACING, mirror.apply(state.get(HORIZONTAL_FACING)));
|
return state.with(HORIZONTAL_FACING, mirror.apply(state.get(HORIZONTAL_FACING)));
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ public class ReFramedWallBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
VoxelShape shape = state.get(UP) ? WALL_VOXELS[0]: VoxelShapes.empty();
|
VoxelShape shape = state.get(UP) ? WALL_VOXELS[0]: VoxelShapes.empty();
|
||||||
for (Direction dir : Direction.Type.HORIZONTAL) {
|
for (Direction dir : Direction.Type.HORIZONTAL) {
|
||||||
@ -109,6 +110,7 @@ public class ReFramedWallBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
public BlockState rotate(BlockState state, BlockRotation rotation) {
|
||||||
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
||||||
s.with(getWallShape(rotation.rotate(dir)), state.get(getWallShape(dir)))
|
s.with(getWallShape(rotation.rotate(dir)), state.get(getWallShape(dir)))
|
||||||
@ -116,6 +118,7 @@ public class ReFramedWallBlock extends WaterloggableReFramedBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
public BlockState mirror(BlockState state, BlockMirror mirror) {
|
||||||
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
return Direction.Type.HORIZONTAL.stream().reduce(state, (s, dir) ->
|
||||||
s.with(getWallShape(mirror.apply(dir)), state.get(getWallShape(dir)))
|
s.with(getWallShape(mirror.apply(dir)), state.get(getWallShape(dir)))
|
||||||
|
@ -33,10 +33,13 @@ public class WaterloggableReFramedBlock extends ReFramedBlock implements Waterlo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public FluidState getFluidState(BlockState state) {
|
public FluidState getFluidState(BlockState state) {
|
||||||
return state.get(Properties.WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state);
|
return state.get(Properties.WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState otherState, WorldAccess world, BlockPos pos, BlockPos moved) {
|
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState otherState, WorldAccess world, BlockPos pos, BlockPos moved) {
|
||||||
if(state.get(Properties.WATERLOGGED)) world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));
|
if(state.get(Properties.WATERLOGGED)) world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));
|
||||||
return super.getStateForNeighborUpdate(state, direction, otherState, world, pos, moved);
|
return super.getStateForNeighborUpdate(state, direction, otherState, world, pos, moved);
|
||||||
|
@ -33,10 +33,13 @@ public class WaterloggableReFramedDoubleBlock extends ReFramedDoubleBlock implem
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public FluidState getFluidState(BlockState state) {
|
public FluidState getFluidState(BlockState state) {
|
||||||
return state.get(Properties.WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state);
|
return state.get(Properties.WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState otherState, WorldAccess world, BlockPos pos, BlockPos moved) {
|
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState otherState, WorldAccess world, BlockPos pos, BlockPos moved) {
|
||||||
if(state.get(Properties.WATERLOGGED)) world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));
|
if(state.get(Properties.WATERLOGGED)) world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));
|
||||||
return super.getStateForNeighborUpdate(state, direction, otherState, world, pos, moved);
|
return super.getStateForNeighborUpdate(state, direction, otherState, world, pos, moved);
|
||||||
|
@ -147,6 +147,12 @@ public class ReFramedClient implements ClientModInitializer {
|
|||||||
// SLABS STAIR
|
// SLABS STAIR
|
||||||
HELPER.addReFramedModel("slabs_stair" , HELPER.autoDouble(ReFramed.id("block/slabs_stair/slab"), ReFramed.id("block/slabs_stair/step")));
|
HELPER.addReFramedModel("slabs_stair" , HELPER.autoDouble(ReFramed.id("block/slabs_stair/slab"), ReFramed.id("block/slabs_stair/step")));
|
||||||
HELPER.addReFramedModel("slabs_stair_side" , HELPER.autoDouble(ReFramed.id("block/slabs_stair/side/slab"), ReFramed.id("block/slabs_stair/side/step")));
|
HELPER.addReFramedModel("slabs_stair_side" , HELPER.autoDouble(ReFramed.id("block/slabs_stair/side/slab"), ReFramed.id("block/slabs_stair/side/step")));
|
||||||
|
// SLABS OUTER STAIR
|
||||||
|
HELPER.addReFramedModel("slabs_outer_stair" , HELPER.autoDouble(ReFramed.id("block/slabs_stair/outer/slab"), ReFramed.id("block/slabs_stair/outer/cube")));
|
||||||
|
HELPER.addReFramedModel("slabs_outer_stair_side" , HELPER.autoDouble(ReFramed.id("block/slabs_stair/outer/side/slab"), ReFramed.id("block/slabs_stair/outer/side/cube")));
|
||||||
|
// SLABS OUTER STAIR
|
||||||
|
HELPER.addReFramedModel("slabs_inner_stair" , HELPER.autoDouble(ReFramed.id("block/slabs_stair/inner/slab"), ReFramed.id("block/slabs_stair/inner/half_stair")));
|
||||||
|
HELPER.addReFramedModel("slabs_inner_stair_side" , HELPER.autoDouble(ReFramed.id("block/slabs_stair/inner/side/slab"), ReFramed.id("block/slabs_stair/inner/side/half_stair")));
|
||||||
|
|
||||||
|
|
||||||
//item model assignments (in lieu of models/item/___.json)
|
//item model assignments (in lieu of models/item/___.json)
|
||||||
@ -174,6 +180,8 @@ public class ReFramedClient implements ClientModInitializer {
|
|||||||
HELPER.assignItemModel("fence_inventory" , ReFramed.FENCE);
|
HELPER.assignItemModel("fence_inventory" , ReFramed.FENCE);
|
||||||
HELPER.assignItemModel("post_fence_inventory" , ReFramed.POST_FENCE);
|
HELPER.assignItemModel("post_fence_inventory" , ReFramed.POST_FENCE);
|
||||||
HELPER.assignItemModel("slabs_stair" , ReFramed.SLABS_STAIR);
|
HELPER.assignItemModel("slabs_stair" , ReFramed.SLABS_STAIR);
|
||||||
|
HELPER.assignItemModel("slabs_outer_stair" , ReFramed.SLABS_OUTER_STAIR);
|
||||||
|
HELPER.assignItemModel("slabs_inner_stair" , ReFramed.SLABS_INNER_STAIR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void privateInit() {
|
private void privateInit() {
|
||||||
|
@ -27,6 +27,8 @@ public class GBlockstate extends FabricModelProvider {
|
|||||||
providers.put(ReFramedSlabBlock.class, new Slab());
|
providers.put(ReFramedSlabBlock.class, new Slab());
|
||||||
providers.put(ReFramedSlabsCubeBlock.class, new SlabsCube());
|
providers.put(ReFramedSlabsCubeBlock.class, new SlabsCube());
|
||||||
providers.put(ReFramedSlabsStairBlock.class, new SlabsStair());
|
providers.put(ReFramedSlabsStairBlock.class, new SlabsStair());
|
||||||
|
providers.put(ReFramedSlabsOuterStairBlock.class, new SlabsOuterStair());
|
||||||
|
providers.put(ReFramedSlabsInnerStairBlock.class, new SlabsInnerStair());
|
||||||
providers.put(ReFramedSmallCubeBlock.class, new SmallCube());
|
providers.put(ReFramedSmallCubeBlock.class, new SmallCube());
|
||||||
providers.put(ReFramedSmallCubesStepBlock.class, new SmallCubesStep());
|
providers.put(ReFramedSmallCubesStepBlock.class, new SmallCubesStep());
|
||||||
providers.put(ReFramedStairBlock.class, new Stair());
|
providers.put(ReFramedStairBlock.class, new Stair());
|
||||||
|
@ -29,6 +29,8 @@ public class GRecipe extends FabricRecipeProvider {
|
|||||||
providers.put(ReFramedSlabBlock.class, new Slab());
|
providers.put(ReFramedSlabBlock.class, new Slab());
|
||||||
providers.put(ReFramedSlabsCubeBlock.class, new SlabsCube());
|
providers.put(ReFramedSlabsCubeBlock.class, new SlabsCube());
|
||||||
providers.put(ReFramedSlabsStairBlock.class, new SlabsStair());
|
providers.put(ReFramedSlabsStairBlock.class, new SlabsStair());
|
||||||
|
providers.put(ReFramedSlabsOuterStairBlock.class, new SlabsOuterStair());
|
||||||
|
providers.put(ReFramedSlabsInnerStairBlock.class, new SlabsInnerStair());
|
||||||
providers.put(ReFramedSmallCubeBlock.class, new SmallCube());
|
providers.put(ReFramedSmallCubeBlock.class, new SmallCube());
|
||||||
providers.put(ReFramedSmallCubesStepBlock.class, new SmallCubesStep());
|
providers.put(ReFramedSmallCubesStepBlock.class, new SmallCubesStep());
|
||||||
providers.put(ReFramedStairBlock.class, new Stair());
|
providers.put(ReFramedStairBlock.class, new Stair());
|
||||||
|
@ -0,0 +1,77 @@
|
|||||||
|
package fr.adrien1106.reframed.generator.block;
|
||||||
|
|
||||||
|
import fr.adrien1106.reframed.ReFramed;
|
||||||
|
import fr.adrien1106.reframed.generator.GBlockstate;
|
||||||
|
import fr.adrien1106.reframed.util.blocks.Corner;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.data.client.MultipartBlockStateSupplier;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER;
|
||||||
|
import static fr.adrien1106.reframed.util.blocks.BlockProperties.CORNER_FACE;
|
||||||
|
import static net.minecraft.data.client.VariantSettings.Rotation.*;
|
||||||
|
|
||||||
|
public class CornerDouble {
|
||||||
|
|
||||||
|
|
||||||
|
public static MultipartBlockStateSupplier getMultipart(Block block, String model_name) {
|
||||||
|
Identifier model_id = ReFramed.id(model_name + "_special");
|
||||||
|
Identifier side_id = ReFramed.id(model_name + "_side_special");
|
||||||
|
return MultipartBlockStateSupplier.create(block)
|
||||||
|
// BOTTOM
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.EAST_SOUTH_DOWN, CORNER_FACE, 2),
|
||||||
|
GBlockstate.variant(model_id, true, R0, R0))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.SOUTH_WEST_DOWN, CORNER_FACE, 2),
|
||||||
|
GBlockstate.variant(model_id, true, R0, R90))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.WEST_NORTH_DOWN, CORNER_FACE, 2),
|
||||||
|
GBlockstate.variant(model_id, true, R0, R180))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.NORTH_EAST_DOWN, CORNER_FACE, 2),
|
||||||
|
GBlockstate.variant(model_id, true, R0, R270))
|
||||||
|
// TOP
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.NORTH_EAST_UP, CORNER_FACE, 2),
|
||||||
|
GBlockstate.variant(model_id, true, R180, R0))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.EAST_SOUTH_UP, CORNER_FACE, 2),
|
||||||
|
GBlockstate.variant(model_id, true, R180, R90))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.SOUTH_WEST_UP, CORNER_FACE, 2),
|
||||||
|
GBlockstate.variant(model_id, true, R180, R180))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.WEST_NORTH_UP, CORNER_FACE, 2),
|
||||||
|
GBlockstate.variant(model_id, true, R180, R270))
|
||||||
|
// EAST
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.EAST_SOUTH_DOWN, CORNER_FACE, 0),
|
||||||
|
GBlockstate.variant(side_id, true, R0, R0))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.EAST_SOUTH_UP, CORNER_FACE, 0),
|
||||||
|
GBlockstate.variant(side_id, true, R90, R0))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.NORTH_EAST_UP, CORNER_FACE, 1),
|
||||||
|
GBlockstate.variant(side_id, true, R180, R0))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.NORTH_EAST_DOWN, CORNER_FACE, 1),
|
||||||
|
GBlockstate.variant(side_id, true, R270, R0))
|
||||||
|
// SOUTH
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.SOUTH_WEST_DOWN, CORNER_FACE, 0),
|
||||||
|
GBlockstate.variant(side_id, true, R0, R90))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.SOUTH_WEST_UP, CORNER_FACE, 0),
|
||||||
|
GBlockstate.variant(side_id, true, R90, R90))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.EAST_SOUTH_UP, CORNER_FACE, 1),
|
||||||
|
GBlockstate.variant(side_id, true, R180, R90))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.EAST_SOUTH_DOWN, CORNER_FACE, 1),
|
||||||
|
GBlockstate.variant(side_id, true, R270, R90))
|
||||||
|
// WEST
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.WEST_NORTH_DOWN, CORNER_FACE, 0),
|
||||||
|
GBlockstate.variant(side_id, true, R0, R180))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.WEST_NORTH_UP, CORNER_FACE, 0),
|
||||||
|
GBlockstate.variant(side_id, true, R90, R180))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.SOUTH_WEST_UP, CORNER_FACE, 1),
|
||||||
|
GBlockstate.variant(side_id, true, R180, R180))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.SOUTH_WEST_DOWN, CORNER_FACE, 1),
|
||||||
|
GBlockstate.variant(side_id, true, R270, R180))
|
||||||
|
// NORTH
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.NORTH_EAST_DOWN, CORNER_FACE, 0),
|
||||||
|
GBlockstate.variant(side_id, true, R0, R270))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.NORTH_EAST_UP, CORNER_FACE, 0),
|
||||||
|
GBlockstate.variant(side_id, true, R90, R270))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.WEST_NORTH_UP, CORNER_FACE, 1),
|
||||||
|
GBlockstate.variant(side_id, true, R180, R270))
|
||||||
|
.with(GBlockstate.when(CORNER, Corner.WEST_NORTH_DOWN, CORNER_FACE, 1),
|
||||||
|
GBlockstate.variant(side_id, true, R270, R270))
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package fr.adrien1106.reframed.generator.block;
|
||||||
|
|
||||||
|
import fr.adrien1106.reframed.ReFramed;
|
||||||
|
import fr.adrien1106.reframed.generator.BlockStateProvider;
|
||||||
|
import fr.adrien1106.reframed.generator.RecipeSetter;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.data.client.MultipartBlockStateSupplier;
|
||||||
|
import net.minecraft.data.server.recipe.RecipeExporter;
|
||||||
|
import net.minecraft.data.server.recipe.RecipeProvider;
|
||||||
|
import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder;
|
||||||
|
import net.minecraft.item.ItemConvertible;
|
||||||
|
import net.minecraft.recipe.book.RecipeCategory;
|
||||||
|
|
||||||
|
public class SlabsInnerStair implements RecipeSetter, BlockStateProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setRecipe(RecipeExporter exporter, ItemConvertible convertible) {
|
||||||
|
RecipeProvider.offerStonecuttingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, convertible, ReFramed.CUBE);
|
||||||
|
ShapelessRecipeJsonBuilder
|
||||||
|
.create(RecipeCategory.BUILDING_BLOCKS, convertible)
|
||||||
|
.input(ReFramed.HALF_STAIR)
|
||||||
|
.input(ReFramed.SLAB)
|
||||||
|
.criterion(FabricRecipeProvider.hasItem(ReFramed.CUBE), FabricRecipeProvider.conditionsFromItem(ReFramed.CUBE))
|
||||||
|
.criterion(FabricRecipeProvider.hasItem(convertible), FabricRecipeProvider.conditionsFromItem(convertible))
|
||||||
|
.offerTo(exporter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultipartBlockStateSupplier getMultipart(Block block) {
|
||||||
|
return CornerDouble.getMultipart(block, "slabs_inner_stair");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package fr.adrien1106.reframed.generator.block;
|
||||||
|
|
||||||
|
import fr.adrien1106.reframed.ReFramed;
|
||||||
|
import fr.adrien1106.reframed.generator.BlockStateProvider;
|
||||||
|
import fr.adrien1106.reframed.generator.RecipeSetter;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.data.client.MultipartBlockStateSupplier;
|
||||||
|
import net.minecraft.data.server.recipe.RecipeExporter;
|
||||||
|
import net.minecraft.data.server.recipe.RecipeProvider;
|
||||||
|
import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder;
|
||||||
|
import net.minecraft.item.ItemConvertible;
|
||||||
|
import net.minecraft.recipe.book.RecipeCategory;
|
||||||
|
|
||||||
|
public class SlabsOuterStair implements RecipeSetter, BlockStateProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setRecipe(RecipeExporter exporter, ItemConvertible convertible) {
|
||||||
|
RecipeProvider.offerStonecuttingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, convertible, ReFramed.CUBE);
|
||||||
|
ShapelessRecipeJsonBuilder
|
||||||
|
.create(RecipeCategory.BUILDING_BLOCKS, convertible)
|
||||||
|
.input(ReFramed.SMALL_CUBE)
|
||||||
|
.input(ReFramed.SLAB)
|
||||||
|
.criterion(FabricRecipeProvider.hasItem(ReFramed.CUBE), FabricRecipeProvider.conditionsFromItem(ReFramed.CUBE))
|
||||||
|
.criterion(FabricRecipeProvider.hasItem(convertible), FabricRecipeProvider.conditionsFromItem(convertible))
|
||||||
|
.offerTo(exporter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultipartBlockStateSupplier getMultipart(Block block) {
|
||||||
|
return CornerDouble.getMultipart(block, "slabs_outer_stair");
|
||||||
|
}
|
||||||
|
}
|
@ -116,6 +116,14 @@ public enum Corner implements StringIdentifiable {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Edge getEdgeWith(Direction direction) {
|
||||||
|
return Edge.getByDirections(
|
||||||
|
first_direction == direction ? first_direction : second_direction,
|
||||||
|
first_direction == direction ? second_direction : third_direction
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public Direction getOtherDirection(Edge edge) {
|
public Direction getOtherDirection(Edge edge) {
|
||||||
if (edge.getFirstDirection() != second_direction && edge.getSecondDirection() != second_direction) return second_direction;
|
if (edge.getFirstDirection() != second_direction && edge.getSecondDirection() != second_direction) return second_direction;
|
||||||
if (edge.getFirstDirection() != third_direction && edge.getSecondDirection() != third_direction) return third_direction;
|
if (edge.getFirstDirection() != third_direction && edge.getSecondDirection() != third_direction) return third_direction;
|
||||||
@ -137,4 +145,13 @@ public enum Corner implements StringIdentifiable {
|
|||||||
mirror.apply(third_direction)
|
mirror.apply(third_direction)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Corner change(Direction face) {
|
||||||
|
Direction opposite = face.getOpposite();
|
||||||
|
return getByDirections(
|
||||||
|
first_direction == face ? opposite : first_direction,
|
||||||
|
second_direction == face ? opposite : second_direction,
|
||||||
|
third_direction == face ? opposite : third_direction
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"credit": "Made with Blockbench",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"particle": "#side"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [8, 0, 0],
|
||||||
|
"to": [16, 8, 8],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 0]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "north"},
|
||||||
|
"east": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "east"},
|
||||||
|
"west": {"uv": [0, 8, 8, 16], "texture": "#side"},
|
||||||
|
"down": {"uv": [8, 8, 16, 16], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8, 0, 8],
|
||||||
|
"to": [16, 8, 16],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
|
||||||
|
"faces": {
|
||||||
|
"east": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "east"},
|
||||||
|
"south": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "south"},
|
||||||
|
"west": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "down"},
|
||||||
|
"down": {"uv": [8, 0, 16, 8], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8, 8, 8],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
|
||||||
|
"faces": {
|
||||||
|
"east": {"uv": [0, 0, 8, 8], "texture": "#side", "cullface": "east"},
|
||||||
|
"south": {"uv": [8, 0, 16, 8], "texture": "#side", "cullface": "south"},
|
||||||
|
"west": {"uv": [8, 0, 16, 8], "texture": "#side"},
|
||||||
|
"up": {"uv": [8, 8, 16, 16], "texture": "#top", "cullface": "up"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8, 8, 0],
|
||||||
|
"to": [16, 16, 8],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 0]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 0, 8, 8], "texture": "#side", "cullface": "north"},
|
||||||
|
"east": {"uv": [8, 0, 16, 8], "texture": "#side", "cullface": "east"},
|
||||||
|
"west": {"uv": [0, 0, 8, 8], "texture": "#side"},
|
||||||
|
"up": {"uv": [8, 0, 16, 8], "texture": "#top", "cullface": "up"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [75, -135, 0],
|
||||||
|
"translation": [0, 2.5, 0],
|
||||||
|
"scale": [0.375, 0.375, 0.375]
|
||||||
|
},
|
||||||
|
"gui": {
|
||||||
|
"rotation": [30, 135, 0],
|
||||||
|
"scale": [0.625, 0.625, 0.625]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [0, -90, 0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"credit": "Made with Blockbench",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"particle": "#side"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 8],
|
||||||
|
"to": [8, 8, 16],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [-8, 0, 8]},
|
||||||
|
"faces": {
|
||||||
|
"south": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "south"},
|
||||||
|
"west": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "west"},
|
||||||
|
"up": {"uv": [0, 8, 8, 16], "texture": "#top"},
|
||||||
|
"down": {"uv": [0, 0, 8, 8], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [8, 8, 8],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [-8, 0, 0]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "north"},
|
||||||
|
"west": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "west"},
|
||||||
|
"up": {"uv": [0, 0, 8, 8], "texture": "#top"},
|
||||||
|
"down": {"uv": [0, 8, 8, 16], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8, 0, 0],
|
||||||
|
"to": [16, 8, 8],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 0]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "north"},
|
||||||
|
"east": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "east"},
|
||||||
|
"up": {"uv": [8, 0, 16, 8], "texture": "#top"},
|
||||||
|
"down": {"uv": [8, 8, 16, 16], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8, 0, 8],
|
||||||
|
"to": [16, 8, 16],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
|
||||||
|
"faces": {
|
||||||
|
"east": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "east"},
|
||||||
|
"south": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "south"},
|
||||||
|
"up": {"uv": [8, 8, 16, 16], "texture": "#top"},
|
||||||
|
"down": {"uv": [8, 0, 16, 8], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [75, -135, 0],
|
||||||
|
"translation": [0, 2.5, 0],
|
||||||
|
"scale": [0.375, 0.375, 0.375]
|
||||||
|
},
|
||||||
|
"gui": {
|
||||||
|
"rotation": [30, 135, 0],
|
||||||
|
"scale": [0.625, 0.625, 0.625]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [0, -90, 0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"credit": "Made with Blockbench",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"particle": "#side"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [8, 8, 8],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [0, 8, 0]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 0, 8, 8], "texture": "#side"},
|
||||||
|
"east": {"uv": [0, 0, 8, 8], "texture": "#side", "cullface": "east"},
|
||||||
|
"south": {"uv": [8, 0, 16, 8], "texture": "#side", "cullface": "south"},
|
||||||
|
"west": {"uv": [8, 0, 16, 8], "texture": "#side"},
|
||||||
|
"up": {"uv": [8, 8, 16, 16], "texture": "#top", "cullface": "up"},
|
||||||
|
"down": {"uv": [8, 0, 16, 8], "texture": "#bottom"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [75, -135, 0],
|
||||||
|
"translation": [0, 2.5, 0],
|
||||||
|
"scale": [0.375, 0.375, 0.375]
|
||||||
|
},
|
||||||
|
"gui": {
|
||||||
|
"rotation": [30, 135, 0],
|
||||||
|
"scale": [0.625, 0.625, 0.625]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [0, -90, 0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"credit": "Made with Blockbench",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"particle": "#side"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 8],
|
||||||
|
"to": [8, 8, 16],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [-8, 0, 0]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [8, 8, 16, 16], "texture": "#side"},
|
||||||
|
"east": {"uv": [0, 8, 8, 16], "texture": "#side"},
|
||||||
|
"south": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "south"},
|
||||||
|
"west": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "west"},
|
||||||
|
"up": {"uv": [0, 8, 8, 16], "texture": "#top"},
|
||||||
|
"down": {"uv": [0, 0, 8, 8], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [75, -135, 0],
|
||||||
|
"translation": [0, 2.5, 0],
|
||||||
|
"scale": [0.375, 0.375, 0.375]
|
||||||
|
},
|
||||||
|
"gui": {
|
||||||
|
"rotation": [30, 135, 0],
|
||||||
|
"scale": [0.625, 0.625, 0.625]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [0, -90, 0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"credit": "Made with Blockbench",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"particle": "#side"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [8, 0, 8],
|
||||||
|
"to": [16, 8, 16],
|
||||||
|
"faces": {
|
||||||
|
"east": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "east"},
|
||||||
|
"south": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "south"},
|
||||||
|
"west": {"uv": [8, 8, 16, 16], "texture": "#side"},
|
||||||
|
"down": {"uv": [8, 0, 16, 8], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8, 8, 8],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [0, 8, 0]},
|
||||||
|
"faces": {
|
||||||
|
"east": {"uv": [0, 0, 8, 8], "texture": "#side", "cullface": "east"},
|
||||||
|
"south": {"uv": [8, 0, 16, 8], "texture": "#side", "cullface": "south"},
|
||||||
|
"west": {"uv": [8, 0, 16, 8], "texture": "#side"},
|
||||||
|
"up": {"uv": [8, 8, 16, 16], "texture": "#top", "cullface": "up"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8, 0, 0],
|
||||||
|
"to": [16, 16, 8],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [0, 0, -8]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 0, 8, 16], "texture": "#side", "cullface": "north"},
|
||||||
|
"east": {"uv": [8, 0, 16, 16], "texture": "#side", "cullface": "east"},
|
||||||
|
"west": {"uv": [0, 0, 8, 16], "texture": "#side"},
|
||||||
|
"up": {"uv": [8, 0, 16, 8], "texture": "#top", "cullface": "up"},
|
||||||
|
"down": {"uv": [8, 8, 16, 16], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [75, -135, 0],
|
||||||
|
"translation": [0, 2.5, 0],
|
||||||
|
"scale": [0.375, 0.375, 0.375]
|
||||||
|
},
|
||||||
|
"gui": {
|
||||||
|
"rotation": [30, 135, 0],
|
||||||
|
"scale": [0.625, 0.625, 0.625]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [0, -90, 0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"credit": "Made with Blockbench",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"particle": "#side"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [8, 0, 0],
|
||||||
|
"to": [16, 8, 8],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "north"},
|
||||||
|
"east": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "east"},
|
||||||
|
"up": {"uv": [8, 0, 16, 8], "texture": "#top"},
|
||||||
|
"down": {"uv": [8, 8, 16, 16], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8, 0, 8],
|
||||||
|
"to": [16, 8, 16],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 8]},
|
||||||
|
"faces": {
|
||||||
|
"east": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "east"},
|
||||||
|
"south": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "south"},
|
||||||
|
"up": {"uv": [8, 8, 16, 16], "texture": "#top"},
|
||||||
|
"down": {"uv": [8, 0, 16, 8], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [8, 8, 16],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "north"},
|
||||||
|
"south": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "south"},
|
||||||
|
"west": {"uv": [0, 8, 16, 16], "texture": "#side", "cullface": "west"},
|
||||||
|
"up": {"uv": [0, 0, 8, 16], "texture": "#top"},
|
||||||
|
"down": {"uv": [0, 0, 8, 16], "texture": "#bottom", "cullface": "down"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [75, -135, 0],
|
||||||
|
"translation": [0, 2.5, 0],
|
||||||
|
"scale": [0.375, 0.375, 0.375]
|
||||||
|
},
|
||||||
|
"gui": {
|
||||||
|
"rotation": [30, 135, 0],
|
||||||
|
"scale": [0.625, 0.625, 0.625]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [0, -90, 0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user