From f1057bf55894a787bc04d68c2b4eae175e3973cb Mon Sep 17 00:00:00 2001 From: zelophed Date: Mon, 30 Mar 2020 18:48:07 +0200 Subject: [PATCH] changed how the wrench rotates blocks - wrench now rotates the target block around the axis of the face that the it was used on --- .../modules/contraptions/IWrenchable.java | 54 ++++++++++++++++++- .../base/DirectionalAxisKineticBlock.java | 13 ----- .../base/DirectionalKineticBlock.java | 21 -------- .../base/HorizontalAxisKineticBlock.java | 15 ------ .../base/HorizontalKineticBlock.java | 15 ------ .../base/RotatedPillarKineticBlock.java | 13 ----- .../contraptions/bearing/BearingBlock.java | 6 --- .../piston/MechanicalPistonBlock.java | 12 +---- .../components/fan/EncasedFanBlock.java | 12 +++-- .../components/fan/EncasedFanTileEntity.java | 5 +- .../sequencer/SequencedGearshiftBlock.java | 15 +++--- .../relays/encased/EncasedBeltBlock.java | 31 +++++------ 12 files changed, 87 insertions(+), 125 deletions(-) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/IWrenchable.java b/src/main/java/com/simibubi/create/modules/contraptions/IWrenchable.java index 986f7c183..719fe908d 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/IWrenchable.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/IWrenchable.java @@ -1,13 +1,63 @@ package com.simibubi.create.modules.contraptions; +import com.simibubi.create.foundation.utility.VoxelShaper; +import com.simibubi.create.modules.contraptions.base.*; import net.minecraft.block.BlockState; import net.minecraft.item.ItemUseContext; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; +import net.minecraft.util.Direction; +import net.minecraft.world.World; public interface IWrenchable { - public default ActionResultType onWrenched(BlockState state, ItemUseContext context) { - return ActionResultType.PASS; + default ActionResultType onWrenched(BlockState state, ItemUseContext context) { + World world = context.getWorld(); + BlockState rotated = getRotatedBlockState(state, context.getFace()); + if (!rotated.isValidPosition(world, context.getPos())) + return ActionResultType.PASS; + + KineticTileEntity.switchToBlockState(world, context.getPos(), updateAfterWrenched(rotated, context)); + + TileEntity te = context.getWorld().getTileEntity(context.getPos()); + if (te instanceof GeneratingKineticTileEntity) { + ((GeneratingKineticTileEntity) te).updateGeneratedRotation(); + } + + return ActionResultType.SUCCESS; + } + + default BlockState updateAfterWrenched(BlockState newState, ItemUseContext context) { + return newState; + } + + static BlockState getRotatedBlockState(BlockState originalState, Direction targetedFace){ + BlockState newState = originalState; + + if (targetedFace.getAxis() == Direction.Axis.Y) { + if (originalState.has(HorizontalAxisKineticBlock.HORIZONTAL_AXIS)) + return originalState.with(HorizontalAxisKineticBlock.HORIZONTAL_AXIS, VoxelShaper.axisAsFace(originalState.get(HorizontalAxisKineticBlock.HORIZONTAL_AXIS)).rotateAround(targetedFace.getAxis()).getAxis()); + if (originalState.has(HorizontalKineticBlock.HORIZONTAL_FACING)) + return originalState.with(HorizontalKineticBlock.HORIZONTAL_FACING, originalState.get(HorizontalKineticBlock.HORIZONTAL_FACING).rotateAround(targetedFace.getAxis())); + } + + if (originalState.has(RotatedPillarKineticBlock.AXIS)) + return originalState.with(RotatedPillarKineticBlock.AXIS, VoxelShaper.axisAsFace(originalState.get(RotatedPillarKineticBlock.AXIS)).rotateAround(targetedFace.getAxis()).getAxis()); + + if (!originalState.has(DirectionalKineticBlock.FACING)) return originalState; + + Direction stateFacing = originalState.get(DirectionalKineticBlock.FACING); + + if (stateFacing.getAxis().equals(targetedFace.getAxis())) { + if (originalState.has(DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE)) return originalState.cycle(DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE); + else return originalState; + } else { + do { + newState = newState.with(DirectionalKineticBlock.FACING, newState.get(DirectionalKineticBlock.FACING).rotateAround(targetedFace.getAxis())); + if (targetedFace.getAxis() == Direction.Axis.Y && newState.has(DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE)) newState = newState.cycle(DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE); + } while (newState.get(DirectionalKineticBlock.FACING).getAxis().equals(targetedFace.getAxis())); + } + return newState; } } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/DirectionalAxisKineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/DirectionalAxisKineticBlock.java index 2b7078e6e..18a6377e0 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/DirectionalAxisKineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/DirectionalAxisKineticBlock.java @@ -3,10 +3,8 @@ package com.simibubi.create.modules.contraptions.base; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; -import net.minecraft.item.ItemUseContext; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; -import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Rotation; @@ -86,17 +84,6 @@ public abstract class DirectionalAxisKineticBlock extends DirectionalKineticBloc return this.getDefaultState().with(FACING, facing).with(AXIS_ALONG_FIRST_COORDINATE, alongFirst); } - @Override - public ActionResultType onWrenched(BlockState state, ItemUseContext context) { - World world = context.getWorld(); - Direction face = context.getFace(); - if ((turnBackOnWrenched() ? face.getOpposite() : face) == state.get(FACING)) { - KineticTileEntity.switchToBlockState(world, context.getPos(), state.cycle(AXIS_ALONG_FIRST_COORDINATE)); - return ActionResultType.SUCCESS; - } - return super.onWrenched(state, context); - } - @Override public Axis getRotationAxis(BlockState state) { Axis pistonAxis = state.get(FACING).getAxis(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/DirectionalKineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/DirectionalKineticBlock.java index b70f7303d..6f4f0937b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/DirectionalKineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/DirectionalKineticBlock.java @@ -3,15 +3,12 @@ package com.simibubi.create.modules.contraptions.base; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; -import net.minecraft.item.ItemUseContext; import net.minecraft.state.DirectionProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; -import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; -import net.minecraft.world.World; public abstract class DirectionalKineticBlock extends KineticBlock { @@ -45,24 +42,6 @@ public abstract class DirectionalKineticBlock extends KineticBlock { return prefferedSide; } - @Override - public ActionResultType onWrenched(BlockState state, ItemUseContext context) { - Direction facing = turnBackOnWrenched() ? context.getFace().getOpposite() : context.getFace(); - World world = context.getWorld(); - if (facing == state.get(FACING)) - return ActionResultType.PASS; - - BlockState with = state.with(FACING, facing); - if (!with.isValidPosition(world, context.getPos())) - return ActionResultType.PASS; - KineticTileEntity.switchToBlockState(world, context.getPos(), with); - return ActionResultType.SUCCESS; - } - - protected boolean turnBackOnWrenched() { - return false; - } - @Override public BlockState getStateForPlacement(BlockItemUseContext context) { Direction preferred = getPreferredFacing(context); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalAxisKineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalAxisKineticBlock.java index f23f2819f..ed522e416 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalAxisKineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalAxisKineticBlock.java @@ -3,11 +3,9 @@ package com.simibubi.create.modules.contraptions.base; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; -import net.minecraft.item.ItemUseContext; import net.minecraft.state.IProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; -import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; @@ -15,7 +13,6 @@ import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorldReader; -import net.minecraft.world.World; public abstract class HorizontalAxisKineticBlock extends KineticBlock { @@ -69,18 +66,6 @@ public abstract class HorizontalAxisKineticBlock extends KineticBlock { return face.getAxis() == state.get(HORIZONTAL_AXIS); } - @Override - public ActionResultType onWrenched(BlockState state, ItemUseContext context) { - Direction facing = context.getFace(); - if (facing.getAxis().isVertical()) - return ActionResultType.PASS; - World world = context.getWorld(); - if (facing.getAxis() == state.get(HORIZONTAL_AXIS)) - return ActionResultType.PASS; - KineticTileEntity.switchToBlockState(world, context.getPos(), state.cycle(HORIZONTAL_AXIS)); - return ActionResultType.SUCCESS; - } - @Override public BlockState rotate(BlockState state, Rotation rot) { Axis axis = state.get(HORIZONTAL_AXIS); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalKineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalKineticBlock.java index fbe62e2f5..2fbc3a639 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalKineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/HorizontalKineticBlock.java @@ -3,15 +3,12 @@ package com.simibubi.create.modules.contraptions.base; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; -import net.minecraft.item.ItemUseContext; import net.minecraft.state.IProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; -import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; -import net.minecraft.world.World; public abstract class HorizontalKineticBlock extends KineticBlock { @@ -52,18 +49,6 @@ public abstract class HorizontalKineticBlock extends KineticBlock { return prefferedSide; } - @Override - public ActionResultType onWrenched(BlockState state, ItemUseContext context) { - Direction facing = context.getFace(); - if (facing.getAxis().isVertical()) - return ActionResultType.PASS; - World world = context.getWorld(); - if (facing == state.get(HORIZONTAL_FACING)) - return ActionResultType.PASS; - KineticTileEntity.switchToBlockState(world, context.getPos(), state.with(HORIZONTAL_FACING, facing)); - return ActionResultType.SUCCESS; - } - @Override public BlockState rotate(BlockState state, Rotation rot) { return state.with(HORIZONTAL_FACING, rot.rotate(state.get(HORIZONTAL_FACING))); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/RotatedPillarKineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/RotatedPillarKineticBlock.java index c1195c94e..186ec70b0 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/RotatedPillarKineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/RotatedPillarKineticBlock.java @@ -3,15 +3,12 @@ package com.simibubi.create.modules.contraptions.base; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; -import net.minecraft.item.ItemUseContext; import net.minecraft.state.EnumProperty; import net.minecraft.state.StateContainer; import net.minecraft.state.properties.BlockStateProperties; -import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Rotation; -import net.minecraft.world.World; public abstract class RotatedPillarKineticBlock extends KineticBlock { @@ -72,14 +69,4 @@ public abstract class RotatedPillarKineticBlock extends KineticBlock { : context.getNearestLookingDirection().getAxis()); } - @Override - public ActionResultType onWrenched(BlockState state, ItemUseContext context) { - Axis axis = context.getFace().getAxis(); - World world = context.getWorld(); - if (axis == state.get(AXIS)) - return ActionResultType.PASS; - KineticTileEntity.switchToBlockState(world, context.getPos(), state.with(AXIS, axis)); - return ActionResultType.SUCCESS; - } - } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/BearingBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/BearingBlock.java index 6c7961167..709a20426 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/BearingBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/bearing/BearingBlock.java @@ -1,7 +1,6 @@ package com.simibubi.create.modules.contraptions.components.contraptions.bearing; import com.simibubi.create.modules.contraptions.base.DirectionalKineticBlock; - import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.util.Direction; @@ -25,11 +24,6 @@ public abstract class BearingBlock extends DirectionalKineticBlock { return true; } - @Override - protected boolean turnBackOnWrenched() { - return true; - } - @Override public Axis getRotationAxis(BlockState state) { return state.get(FACING).getAxis(); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java index e22d7d932..4f83e3331 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java @@ -7,7 +7,6 @@ import com.simibubi.create.foundation.block.IWithTileEntity; import com.simibubi.create.foundation.utility.AllShapes; import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.modules.contraptions.base.DirectionalAxisKineticBlock; - import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -18,11 +17,7 @@ import net.minecraft.state.EnumProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ActionResultType; -import net.minecraft.util.Direction; -import net.minecraft.util.Hand; -import net.minecraft.util.IStringSerializable; -import net.minecraft.util.SoundCategory; +import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.Vec3d; @@ -102,11 +97,6 @@ public class MechanicalPistonBlock extends DirectionalAxisKineticBlock return super.onWrenched(state, context); } - @Override - protected boolean turnBackOnWrenched() { - return true; - } - public enum PistonState implements IStringSerializable { RETRACTED, MOVING, EXTENDED; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanBlock.java index 56bf5616c..cd7434731 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanBlock.java @@ -2,11 +2,11 @@ package com.simibubi.create.modules.contraptions.components.fan; import com.simibubi.create.foundation.block.IWithTileEntity; import com.simibubi.create.modules.contraptions.base.DirectionalKineticBlock; - import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.ItemUseContext; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; @@ -50,15 +50,21 @@ public class EncasedFanBlock extends DirectionalKineticBlock implements IWithTil protected void blockUpdate(BlockState state, World worldIn, BlockPos pos) { notifyFanTile(worldIn, pos); - if (worldIn.isRemote || state.get(FACING) != Direction.DOWN) + if (worldIn.isRemote) return; - withTileEntityDo(worldIn, pos, EncasedFanTileEntity::updateGenerator); + withTileEntityDo(worldIn, pos, te -> te.updateGenerator(state.get(FACING))); } protected void notifyFanTile(IWorld world, BlockPos pos) { withTileEntityDo(world, pos, EncasedFanTileEntity::blockInFrontChanged); } + @Override + public BlockState updateAfterWrenched(BlockState newState, ItemUseContext context) { + blockUpdate(newState, context.getWorld(), context.getPos()); + return newState; + } + @Override public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanTileEntity.java index 246c49e87..502e8ca97 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/fan/EncasedFanTileEntity.java @@ -5,7 +5,6 @@ import com.simibubi.create.AllTileEntities; import com.simibubi.create.config.AllConfigs; import com.simibubi.create.config.CKinetics; import com.simibubi.create.modules.contraptions.base.GeneratingKineticTileEntity; - import net.minecraft.nbt.CompoundNBT; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; @@ -59,8 +58,8 @@ public class EncasedFanTileEntity extends GeneratingKineticTileEntity { return isGenerator ? AllConfigs.SERVER.kinetics.generatingFanSpeed.get() : 0; } - public void updateGenerator() { - boolean shouldGenerate = world.isBlockPowered(pos) && world.isBlockPresent(pos.down()) && blockBelowIsHot(); + public void updateGenerator(Direction facing) { + boolean shouldGenerate = world.isBlockPowered(pos) && facing == Direction.DOWN && world.isBlockPresent(pos.down()) && blockBelowIsHot(); if (shouldGenerate == isGenerator) return; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/advanced/sequencer/SequencedGearshiftBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/advanced/sequencer/SequencedGearshiftBlock.java index 2e3503b80..4a6f00f84 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/advanced/sequencer/SequencedGearshiftBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/advanced/sequencer/SequencedGearshiftBlock.java @@ -5,9 +5,7 @@ import com.simibubi.create.foundation.block.IWithTileEntity; import com.simibubi.create.foundation.gui.ScreenOpener; import com.simibubi.create.modules.contraptions.base.HorizontalAxisKineticBlock; import com.simibubi.create.modules.contraptions.base.KineticBlock; -import com.simibubi.create.modules.contraptions.base.KineticTileEntity; import com.simibubi.create.modules.contraptions.base.RotatedPillarKineticBlock; - import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -109,12 +107,13 @@ public class SequencedGearshiftBlock extends HorizontalAxisKineticBlock @Override public ActionResultType onWrenched(BlockState state, ItemUseContext context) { - Direction facing = context.getFace(); - if (facing.getAxis().isVertical() && !state.get(VERTICAL)) { - KineticTileEntity.switchToBlockState(context.getWorld(), context.getPos(), state.cycle(VERTICAL)); - return ActionResultType.SUCCESS; - } - return super.onWrenched(state, context); + BlockState newState = state; + + if (context.getFace().getAxis() != Axis.Y) + if (newState.get(HORIZONTAL_AXIS) != context.getFace().getAxis()) + newState = newState.cycle(VERTICAL); + + return super.onWrenched(newState, context); } private BlockState withAxis(Axis axis, BlockItemUseContext context) { diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/encased/EncasedBeltBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/encased/EncasedBeltBlock.java index 385159da0..21e4a9594 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/encased/EncasedBeltBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/encased/EncasedBeltBlock.java @@ -4,7 +4,6 @@ import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.modules.contraptions.base.DirectionalAxisKineticBlock; import com.simibubi.create.modules.contraptions.base.KineticTileEntity; import com.simibubi.create.modules.contraptions.base.RotatedPillarKineticBlock; - import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -16,7 +15,6 @@ import net.minecraft.state.EnumProperty; import net.minecraft.state.IProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; @@ -120,6 +118,22 @@ public class EncasedBeltBlock extends RotatedPillarKineticBlock { return stateIn.with(PART, part).with(CONNECTED_ALONG_FIRST_COORDINATE, connectionAlongFirst); } + @Override + public BlockState updateAfterWrenched(BlockState newState, ItemUseContext context) { + Blocks.AIR.getDefaultState().updateNeighbors(context.getWorld(), context.getPos(), 1); + Axis axis = newState.get(AXIS); + newState = getDefaultState().with(AXIS, axis); + for (Direction facing : Direction.values()) { + if (facing.getAxis() == axis) + continue; + BlockPos pos = context.getPos(); + BlockPos offset = pos.offset(facing); + newState = updatePostPlacement(newState, facing, context.getWorld().getBlockState(offset), context.getWorld(), + pos, offset); } + newState.updateNeighbors(context.getWorld(), context.getPos(), 1 | 2); + return newState; + } + @Override public boolean hasShaftTowards(IWorldReader world, BlockPos pos, BlockState state, Direction face) { return face.getAxis() == state.get(AXIS); @@ -169,19 +183,6 @@ public class EncasedBeltBlock extends RotatedPillarKineticBlock { return new EncasedShaftTileEntity(); } - @Override - public ActionResultType onWrenched(BlockState state, ItemUseContext context) { - Axis axis = state.get(AXIS); - boolean connectionAlongFirst = state.get(CONNECTED_ALONG_FIRST_COORDINATE); - Axis connectionAxis = connectionAlongFirst ? (axis == Axis.X ? Axis.Y : Axis.X) - : (axis == Axis.Z ? Axis.Y : Axis.Z); - - if (context.getFace().getAxis() == connectionAxis) - return ActionResultType.PASS; - - return super.onWrenched(state, context); - } - @Override protected boolean hasStaticPart() { return true;