From 74a290fd16ac39c4949ca2bdb613413727f0a243 Mon Sep 17 00:00:00 2001 From: Adrien1106 Date: Thu, 28 Mar 2024 19:01:33 +0100 Subject: [PATCH] improved additivity of blocks and added pillar --- .../java/fr/adrien1106/reframed/ReFramed.java | 3 +- .../reframed/block/ReFramedDoubleBlock.java | 18 +--- .../block/ReFramedHalfStairBlock.java | 34 +++++- .../reframed/block/ReFramedLayerBlock.java | 9 +- .../reframed/block/ReFramedPillarBlock.java | 102 ++++++++++++++++++ .../reframed/block/ReFramedSlabBlock.java | 11 +- .../block/ReFramedSmallCubeBlock.java | 56 ++++++---- .../reframed/block/ReFramedStairBlock.java | 11 +- .../reframed/block/ReFramedStepBlock.java | 52 +++++---- .../reframed/client/ReFramedClient.java | 3 + .../assets/reframed/models/block/pillar.json | 21 ++++ 11 files changed, 254 insertions(+), 66 deletions(-) create mode 100644 src/main/java/fr/adrien1106/reframed/block/ReFramedPillarBlock.java create mode 100644 src/main/resources/assets/reframed/models/block/pillar.json diff --git a/src/main/java/fr/adrien1106/reframed/ReFramed.java b/src/main/java/fr/adrien1106/reframed/ReFramed.java index 5e6fe38..8c1e693 100644 --- a/src/main/java/fr/adrien1106/reframed/ReFramed.java +++ b/src/main/java/fr/adrien1106/reframed/ReFramed.java @@ -37,7 +37,7 @@ public class ReFramed implements ModInitializer { public static final String MODID = "reframed"; public static final ArrayList BLOCKS = new ArrayList<>(); - public static Block CUBE, SMALL_CUBE, SMALL_CUBES_STEP, STAIR, HALF_STAIR, STAIRS_CUBE, HALF_STAIRS_SLAB, HALF_STAIRS_STAIR, SLAB, SLABS_CUBE, STEP, STEPS_SLAB, LAYER; + public static Block CUBE, SMALL_CUBE, SMALL_CUBES_STEP, STAIR, HALF_STAIR, STAIRS_CUBE, HALF_STAIRS_SLAB, HALF_STAIRS_STAIR, SLAB, SLABS_CUBE, STEP, STEPS_SLAB, LAYER, PILLAR; public static final ArrayList ITEMS = new ArrayList<>(); public static Item HAMMER, SCREWDRIVER, BLUEPRINT, BLUEPRINT_WRITTEN; @@ -64,6 +64,7 @@ public class ReFramed implements ModInitializer { SLABS_CUBE = registerBlock("slabs_cube" , new ReFramedSlabsCubeBlock(cp(Blocks.OAK_SLAB))); STEP = registerBlock("step" , new ReFramedStepBlock(cp(Blocks.OAK_SLAB))); STEPS_SLAB = registerBlock("steps_slab" , new ReFramedStepsSlabBlock(cp(Blocks.OAK_SLAB))); + PILLAR = registerBlock("pillar" , new ReFramedPillarBlock(cp(Blocks.OAK_FENCE))); HAMMER = registerItem("hammer" , new ReFramedHammerItem(new Item.Settings().maxCount(1))); SCREWDRIVER = registerItem("screwdriver" , new ReFramedScrewdriverItem(new Item.Settings().maxCount(1))); diff --git a/src/main/java/fr/adrien1106/reframed/block/ReFramedDoubleBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedDoubleBlock.java index 1b76a5e..46bd75a 100644 --- a/src/main/java/fr/adrien1106/reframed/block/ReFramedDoubleBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedDoubleBlock.java @@ -7,7 +7,6 @@ import net.minecraft.block.BlockState; import net.minecraft.block.ShapeContext; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.state.property.Property; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; @@ -50,22 +49,7 @@ public abstract class ReFramedDoubleBlock extends ReFramedBlock { return 0; } - @SafeVarargs - public final > boolean matchesAnyOutline(Vec3d hit, BlockPos pos, Property property, T... values) { - for (T value : values) - if (matchesOutline(hit, pos, property, value)) return true; - return false; - } - - public > boolean matchesOutline(Vec3d hit, BlockPos pos, Property property, T value) { - Vec3d rel = BlockHelper.getRelativePos(hit, pos); - return BlockHelper.cursorMatchesFace( - getOutlineShape(getDefaultState().with(property, value), null, null, null), - rel - ); - } - - public > boolean matchesShape(Vec3d hit, BlockPos pos, BlockState state, int i) { + public boolean matchesShape(Vec3d hit, BlockPos pos, BlockState state, int i) { Vec3d rel = BlockHelper.getRelativePos(hit, pos); return BlockHelper.cursorMatchesFace( getShape(state, i), diff --git a/src/main/java/fr/adrien1106/reframed/block/ReFramedHalfStairBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedHalfStairBlock.java index ee2e6f9..3674153 100644 --- a/src/main/java/fr/adrien1106/reframed/block/ReFramedHalfStairBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedHalfStairBlock.java @@ -34,6 +34,7 @@ import static fr.adrien1106.reframed.util.VoxelHelper.VoxelListBuilder; import static fr.adrien1106.reframed.util.blocks.BlockProperties.*; import static fr.adrien1106.reframed.util.blocks.Corner.*; import static net.minecraft.data.client.VariantSettings.Rotation.*; +import static net.minecraft.state.property.Properties.WATERLOGGED; public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock implements BlockStateProvider { @@ -63,12 +64,35 @@ public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock implement @Override public boolean canReplace(BlockState state, ItemPlacementContext context) { + Direction dir = state.get(CORNER).getDirection(state.get(CORNER_FACE)); return !( context.getPlayer().isSneaking() || !(context.getStack().getItem() instanceof BlockItem block_item) || ( - block_item.getBlock() != this - && block_item.getBlock() != ReFramed.SMALL_CUBE + !( + block_item.getBlock() == this + && ((ReFramedHalfStairsStairBlock) ReFramed.HALF_STAIRS_STAIR) + .matchesShape( + context.getHitPos(), + context.getBlockPos(), + ReFramed.HALF_STAIRS_STAIR.getDefaultState() + .with(EDGE, state.get(CORNER).getEdge(dir)), + dir.getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2 + ) + ) + && !( + block_item.getBlock() == ReFramed.SMALL_CUBE + && BlockHelper.cursorMatchesFace( + ReFramed.SMALL_CUBE.getOutlineShape( + ReFramed.SMALL_CUBE.getDefaultState() + .with(CORNER, state.get(CORNER).getOpposite(state.get(CORNER_FACE))), + context.getWorld(), + context.getBlockPos(), + ShapeContext.absent() + ), + BlockHelper.getRelativePos(context.getHitPos(), context.getBlockPos()) + ) + ) ) ); } @@ -80,12 +104,14 @@ public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock implement Corner corner = current_state.get(CORNER).getOpposite(ctx.getSide().getOpposite()); return ReFramed.HALF_STAIRS_SLAB.getDefaultState() .with(CORNER, corner) - .with(CORNER_FACE, corner.getDirectionIndex(ctx.getSide().getOpposite())); + .with(CORNER_FACE, corner.getDirectionIndex(ctx.getSide().getOpposite())) + .with(WATERLOGGED, current_state.get(WATERLOGGED)); } if (current_state.isOf(this)) 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)); Corner corner = BlockHelper.getPlacementCorner(ctx); return super.getPlacementState(ctx) diff --git a/src/main/java/fr/adrien1106/reframed/block/ReFramedLayerBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedLayerBlock.java index e7e8be5..d7ab8b7 100644 --- a/src/main/java/fr/adrien1106/reframed/block/ReFramedLayerBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedLayerBlock.java @@ -7,6 +7,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.ShapeContext; import net.minecraft.data.client.MultipartBlockStateSupplier; +import net.minecraft.item.BlockItem; import net.minecraft.item.ItemPlacementContext; import net.minecraft.state.StateManager; import net.minecraft.util.Identifier; @@ -52,8 +53,12 @@ public class ReFramedLayerBlock extends ReFramedSlabBlock { } @Override - public boolean canReplace(BlockState state, ItemPlacementContext ctx) { - return !(!state.isOf(this) || ctx.getPlayer().isSneaking() || state.get(LAYERS) == 8); + public boolean canReplace(BlockState state, ItemPlacementContext context) { + return !( + context.getPlayer().isSneaking() + || !(context.getStack().getItem() instanceof BlockItem block_item) + || !(block_item.getBlock() == this && state.get(LAYERS) < 8) + ); } @Override diff --git a/src/main/java/fr/adrien1106/reframed/block/ReFramedPillarBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedPillarBlock.java new file mode 100644 index 0000000..1cb8153 --- /dev/null +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedPillarBlock.java @@ -0,0 +1,102 @@ +package fr.adrien1106.reframed.block; + +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.generator.BlockStateProvider; +import fr.adrien1106.reframed.generator.GBlockstate; +import fr.adrien1106.reframed.util.VoxelHelper; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.ShapeContext; +import net.minecraft.data.client.BlockStateSupplier; +import net.minecraft.data.client.MultipartBlockStateSupplier; +import net.minecraft.item.BlockItem; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.state.StateManager; +import net.minecraft.util.Identifier; +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 java.util.Map; + +import static net.minecraft.data.client.VariantSettings.Rotation.*; +import static net.minecraft.state.property.Properties.AXIS; + +public class ReFramedPillarBlock extends WaterloggableReFramedBlock implements BlockStateProvider { + + public static final VoxelShape[] PILLAR_VOXELS; + + public ReFramedPillarBlock(Settings settings) { + super(settings); + setDefaultState(getDefaultState().with(AXIS, Direction.Axis.Y)); + } + + @Override + public Object getModelCacheKey(BlockState state) { + return state.get(AXIS); + } + + @Override + public int getModelStateCount() { + return 3; + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder.add(AXIS)); + } + + @Override + public boolean canReplace(BlockState state, ItemPlacementContext context) { + return !(context.getPlayer().isSneaking() + || !(context.getStack().getItem() instanceof BlockItem block_item) + || !( + block_item.getBlock() == this + && state.get(AXIS) != context.getSide().getAxis() + ) + ); + } + + @Override + public @Nullable BlockState getPlacementState(ItemPlacementContext ctx) { + // TODO: PILLARS WALL + return super.getPlacementState(ctx).with(AXIS, ctx.getSide().getAxis()); + } + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return getPillarShape(state.get(AXIS)); + } + + public static VoxelShape getPillarShape(Direction.Axis axis) { + return PILLAR_VOXELS[axis.ordinal()]; + } + + @Override + public Map getThemeMap(BlockState state, BlockState new_state) { +// if (new_state.getBlock() == ReFramed.PILLARS_WALL) return Map.of(1, 1); // TODO: PILLARS WALL + return super.getThemeMap(state, new_state); + } + + @Override + public BlockStateSupplier getMultipart() { + Identifier model_id = ReFramed.id("pillar_special"); + return MultipartBlockStateSupplier.create(this) + .with(GBlockstate.when(AXIS, Direction.Axis.X), + GBlockstate.variant(model_id, true, R90, R90)) + .with(GBlockstate.when(AXIS, Direction.Axis.Y), + GBlockstate.variant(model_id, true, R0, R0)) + .with(GBlockstate.when(AXIS, Direction.Axis.Z), + GBlockstate.variant(model_id, true, R90, R0)); + } + + static { + final VoxelShape PILLAR = createCuboidShape(0, 4, 4, 16, 12, 12); + PILLAR_VOXELS = VoxelHelper.VoxelListBuilder.create(PILLAR, 3) + .add(VoxelHelper::rotateZ) + .add(VoxelHelper::rotateX) + .build(); + } +} diff --git a/src/main/java/fr/adrien1106/reframed/block/ReFramedSlabBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedSlabBlock.java index ec309d4..7ed411f 100644 --- a/src/main/java/fr/adrien1106/reframed/block/ReFramedSlabBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedSlabBlock.java @@ -63,7 +63,16 @@ public class ReFramedSlabBlock extends WaterloggableReFramedBlock implements Blo return !( context.getPlayer().isSneaking() || !(context.getStack().getItem() instanceof BlockItem block_item) - || block_item.getBlock() != this + || !( + block_item.getBlock() == this + && ((ReFramedSlabsCubeBlock) ReFramed.SLABS_CUBE) + .matchesShape( + context.getHitPos(), + context.getBlockPos(), + ReFramed.SLABS_CUBE.getDefaultState().with(AXIS, state.get(FACING).getAxis()), + state.get(FACING).getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2 + ) + ) ); } diff --git a/src/main/java/fr/adrien1106/reframed/block/ReFramedSmallCubeBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedSmallCubeBlock.java index be280d8..46eb263 100644 --- a/src/main/java/fr/adrien1106/reframed/block/ReFramedSmallCubeBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedSmallCubeBlock.java @@ -34,6 +34,7 @@ import static fr.adrien1106.reframed.util.VoxelHelper.VoxelListBuilder; import static fr.adrien1106.reframed.util.blocks.BlockProperties.*; import static fr.adrien1106.reframed.util.blocks.Corner.*; import static net.minecraft.data.client.VariantSettings.Rotation.*; +import static net.minecraft.state.property.Properties.WATERLOGGED; public class ReFramedSmallCubeBlock extends WaterloggableReFramedBlock implements BlockStateProvider { @@ -79,22 +80,29 @@ public class ReFramedSmallCubeBlock extends WaterloggableReFramedBlock implement ) && !( block_item.getBlock() == this - && !( - corner.hasDirection(context.getSide()) - && BlockHelper.cursorMatchesFace( - getOutlineShape(state, context.getWorld(), context.getBlockPos(), null), - BlockHelper.getRelativePos(context.getHitPos(), context.getBlockPos()) - ) + && ( + ((ReFramedSmallCubesStepBlock) ReFramed.SMALL_CUBES_STEP) + .matchesShape( + context.getHitPos(), + context.getBlockPos(), + ReFramed.SMALL_CUBES_STEP.getDefaultState().with(EDGE, corner.getEdge(corner.getFirstDirection())), + corner.getFirstDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2 + ) + || ((ReFramedSmallCubesStepBlock) ReFramed.SMALL_CUBES_STEP) + .matchesShape( + context.getHitPos(), + context.getBlockPos(), + ReFramed.SMALL_CUBES_STEP.getDefaultState().with(EDGE, corner.getEdge(corner.getSecondDirection())), + corner.getSecondDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2 + ) + || ((ReFramedSmallCubesStepBlock) ReFramed.SMALL_CUBES_STEP) + .matchesShape( + context.getHitPos(), + context.getBlockPos(), + ReFramed.SMALL_CUBES_STEP.getDefaultState().with(EDGE, corner.getEdge(corner.getThirdDirection())), + corner.getThirdDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2 + ) ) - && ((ReFramedSmallCubesStepBlock) ReFramed.SMALL_CUBES_STEP) - .matchesAnyOutline( - context.getHitPos(), - context.getBlockPos(), - EDGE, - corner.getEdge(corner.getFirstDirection()), - corner.getEdge(corner.getSecondDirection()), - corner.getEdge(corner.getThirdDirection()) - ) ) ) ); @@ -107,23 +115,27 @@ public class ReFramedSmallCubeBlock extends WaterloggableReFramedBlock implement if (current_state.isOf(ReFramed.HALF_STAIR)) return ReFramed.HALF_STAIRS_SLAB.getDefaultState() .with(CORNER, current_state.get(CORNER)) - .with(CORNER_FACE, current_state.get(CORNER_FACE)); + .with(CORNER_FACE, current_state.get(CORNER_FACE)) + .with(WATERLOGGED, current_state.get(WATERLOGGED)); if (current_state.isOf(this)) { Vec3d hit = ctx.getHitPos(); Corner corner = current_state.get(CORNER); ReFramedSmallCubesStepBlock block = ((ReFramedSmallCubesStepBlock) ReFramed.SMALL_CUBES_STEP); - BlockState state = block.getDefaultState().with(EDGE, corner.getEdge(corner.getFirstDirection())); - if (!block.matchesShape( + BlockState state = block.getDefaultState() + .with(EDGE, corner.getEdge(corner.getFirstDirection())) + .with(WATERLOGGED, current_state.get(WATERLOGGED)); + if (block.matchesShape( hit, pos, state, corner.getFirstDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2 - )) state = state.with(EDGE, corner.getEdge(corner.getSecondDirection())); - if (!block.matchesShape( + )) return state; + state = state.with(EDGE, corner.getEdge(corner.getSecondDirection())); + if (block.matchesShape( hit, pos, state, corner.getSecondDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2 - )) state = state.with(EDGE, corner.getEdge(corner.getThirdDirection())); - return state; + )) return state; + return state.with(EDGE, corner.getEdge(corner.getThirdDirection())); } return super.getPlacementState(ctx).with(CORNER, BlockHelper.getPlacementCorner(ctx)); diff --git a/src/main/java/fr/adrien1106/reframed/block/ReFramedStairBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedStairBlock.java index b0ef401..f9df7f4 100644 --- a/src/main/java/fr/adrien1106/reframed/block/ReFramedStairBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedStairBlock.java @@ -70,7 +70,16 @@ public class ReFramedStairBlock extends WaterloggableReFramedBlock implements Bl return !( context.getPlayer().isSneaking() || !(context.getStack().getItem() instanceof BlockItem block_item) - || block_item.getBlock() != ReFramed.STEP + || !( + block_item.getBlock() == ReFramed.STEP + && ((ReFramedStairsCubeBlock) ReFramed.STAIRS_CUBE) + .matchesShape( + context.getHitPos(), + context.getBlockPos(), + state, + 2 + ) + ) ); } diff --git a/src/main/java/fr/adrien1106/reframed/block/ReFramedStepBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedStepBlock.java index 298d730..4843f6f 100644 --- a/src/main/java/fr/adrien1106/reframed/block/ReFramedStepBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedStepBlock.java @@ -34,8 +34,8 @@ import static fr.adrien1106.reframed.util.blocks.BlockProperties.EDGE; import static fr.adrien1106.reframed.util.blocks.BlockProperties.STAIR_SHAPE; import static fr.adrien1106.reframed.util.blocks.Edge.*; import static net.minecraft.data.client.VariantSettings.Rotation.*; -import static net.minecraft.state.property.Properties.AXIS; -import static net.minecraft.state.property.Properties.FACING; +import static net.minecraft.state.property.Properties.*; +import static net.minecraft.state.property.Properties.WATERLOGGED; public class ReFramedStepBlock extends WaterloggableReFramedBlock implements BlockStateProvider { @@ -68,24 +68,39 @@ public class ReFramedStepBlock extends WaterloggableReFramedBlock implements Blo context.getPlayer().isSneaking() || !(context.getStack().getItem() instanceof BlockItem block_item) || ( - block_item.getBlock() != ReFramed.STAIR - && !( - block_item.getBlock() == this - && !( - (edge.isSide(context.getSide()) || edge.hasDirection(context.getSide())) - && BlockHelper.cursorMatchesFace( - getOutlineShape(state, context.getWorld(), context.getBlockPos(), null), - BlockHelper.getRelativePos(context.getHitPos(), context.getBlockPos()) - ) - ) - && ((ReFramedStepsSlabBlock) ReFramed.STEPS_SLAB) - .matchesAnyOutline( + !( + block_item.getBlock() == ReFramed.STAIR + && ((ReFramedStairsCubeBlock) ReFramed.STAIRS_CUBE) + .matchesShape( context.getHitPos(), context.getBlockPos(), - FACING, - edge.getFirstDirection(), - edge.getSecondDirection() + ReFramed.STAIRS_CUBE.getDefaultState().with(EDGE, edge.opposite()), + 1 ) + + ) + && !( + block_item.getBlock() == this + && ( + ((ReFramedStepsSlabBlock) ReFramed.STEPS_SLAB) + .matchesShape( + context.getHitPos(), + context.getBlockPos(), + ReFramed.STEPS_SLAB.getDefaultState() + .with(FACING, edge.getFirstDirection()) + .with(AXIS, edge.getSecondDirection().getAxis()), + edge.getSecondDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2 + ) + || ((ReFramedStepsSlabBlock) ReFramed.STEPS_SLAB) + .matchesShape( + context.getHitPos(), + context.getBlockPos(), + ReFramed.STEPS_SLAB.getDefaultState() + .with(FACING, edge.getSecondDirection()) + .with(AXIS, edge.getFirstDirection().getAxis()), + edge.getFirstDirection().getDirection() == Direction.AxisDirection.POSITIVE ? 1 : 2 + ) + ) ) ) ); @@ -109,7 +124,8 @@ public class ReFramedStepBlock extends WaterloggableReFramedBlock implements Blo ReFramedStepsSlabBlock block = ((ReFramedStepsSlabBlock) ReFramed.STEPS_SLAB); BlockState state = block.getDefaultState() .with(FACING, dir) - .with(AXIS, edge.getOtherDirection(dir).getAxis()); + .with(AXIS, edge.getOtherDirection(dir).getAxis()) + .with(WATERLOGGED, current_state.get(WATERLOGGED)); if (!block.matchesShape( hit, pos, state, diff --git a/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java b/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java index 355cce5..450267c 100644 --- a/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java +++ b/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java @@ -73,6 +73,8 @@ public class ReFramedClient implements ClientModInitializer { HELPER.addReFramedModel("layer_6_special" , HELPER.auto(new Identifier("block/snow_height12"))); HELPER.addReFramedModel("layer_7_special" , HELPER.auto(new Identifier("block/snow_height14"))); HELPER.addReFramedModel("layer_8_special" , HELPER.auto(new Identifier("block/cube"))); + // PILLAR + HELPER.addReFramedModel("pillar_special" , HELPER.auto(ReFramed.id("block/pillar"))); //item model assignments (in lieu of models/item/___.json) HELPER.assignItemModel("cube_special" , ReFramed.CUBE); @@ -88,6 +90,7 @@ public class ReFramedClient implements ClientModInitializer { HELPER.assignItemModel("step_special" , ReFramed.STEP); HELPER.assignItemModel("steps_slab_special" , ReFramed.STEPS_SLAB); HELPER.assignItemModel("layer_1_special" , ReFramed.LAYER); + HELPER.assignItemModel("pillar_special" , ReFramed.PILLAR); } private void privateInit() { diff --git a/src/main/resources/assets/reframed/models/block/pillar.json b/src/main/resources/assets/reframed/models/block/pillar.json new file mode 100644 index 0000000..ec4c188 --- /dev/null +++ b/src/main/resources/assets/reframed/models/block/pillar.json @@ -0,0 +1,21 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "particle": "#side" + }, + "elements": [ + { + "from": [4, 0, 4], + "to": [12, 16, 12], + "faces": { + "north": {"uv": [4, 0, 12, 16], "texture": "#side"}, + "east": {"uv": [4, 0, 12, 16], "texture": "#side"}, + "south": {"uv": [4, 0, 12, 16], "texture": "#side"}, + "west": {"uv": [4, 0, 12, 16], "texture": "#side"}, + "up": {"uv": [4, 4, 12, 12], "texture": "#top", "cullface": "up"}, + "down": {"uv": [4, 4, 12, 12], "texture": "#bottom", "cullface": "down"} + } + } + ] +} \ No newline at end of file