From 48d918783b416328fa1c1f1c32ef33c91c6c6cb5 Mon Sep 17 00:00:00 2001 From: Qzimyion Date: Wed, 8 Nov 2023 14:49:34 +0530 Subject: [PATCH] Fixed up some errors --- .../blocks/customBlocks/ShojiBlocks/ShojiBlocks.java | 8 ++++---- .../blocks/customBlocks/ShojiBlocks/ShojiShapes.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/qzimyion/cellulose/blocks/customBlocks/ShojiBlocks/ShojiBlocks.java b/src/main/java/net/qzimyion/cellulose/blocks/customBlocks/ShojiBlocks/ShojiBlocks.java index 4ff7149..2214591 100644 --- a/src/main/java/net/qzimyion/cellulose/blocks/customBlocks/ShojiBlocks/ShojiBlocks.java +++ b/src/main/java/net/qzimyion/cellulose/blocks/customBlocks/ShojiBlocks/ShojiBlocks.java @@ -69,11 +69,11 @@ public BlockState getStateForNeighborUpdate(BlockState state, Direction directio public BlockState getConnection(BlockState state, WorldAccess world, BlockPos pos){ Direction facing = state.get(FACING); - BlockState top = world.getBlockState(pos.offset(facing.rotateClockwise(Direction.Axis.Y))); - BlockState bottom = world.getBlockState(pos.offset(facing.rotateCounterclockwise(Direction.Axis.Y))); + BlockState top = world.getBlockState(pos.up()); + BlockState bottom = world.getBlockState(pos.down()); - boolean sideU = (top.getBlock() instanceof ShojiBlocks && (top.get(FACING)==facing) || top.get(FACING)==facing.rotateClockwise(Direction.Axis.Y)); - boolean sideD = (top.getBlock() instanceof ShojiBlocks && (bottom.get(FACING)==facing) || top.get(FACING)==facing.rotateCounterclockwise(Direction.Axis.Y)); + boolean sideU = (bottom.getBlock() instanceof ShojiBlocks && (bottom.get(FACING)==facing)); + boolean sideD = (top.getBlock() instanceof ShojiBlocks && (top.get(FACING)==facing)); ShojiShapes shapes = sideU && sideD ? ShojiShapes.MID : (sideD ? ShojiShapes.BOTTOM : (sideU ? ShojiShapes.TOP : ShojiShapes.NONE)); return state.with(SHOJI_SHAPE, shapes); } diff --git a/src/main/java/net/qzimyion/cellulose/blocks/customBlocks/ShojiBlocks/ShojiShapes.java b/src/main/java/net/qzimyion/cellulose/blocks/customBlocks/ShojiBlocks/ShojiShapes.java index 60886b0..9272804 100644 --- a/src/main/java/net/qzimyion/cellulose/blocks/customBlocks/ShojiBlocks/ShojiShapes.java +++ b/src/main/java/net/qzimyion/cellulose/blocks/customBlocks/ShojiBlocks/ShojiShapes.java @@ -19,6 +19,6 @@ public String toString() { @Override public String asString() { - return null; + return this.name; } }