From 66086f667575f752f01bc2c456944e26753e8d60 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 6 Jul 2021 13:25:25 +0200 Subject: [PATCH] Facing down - Ensured players really want to place a water wheel vertically --- .../waterwheel/WaterWheelBlock.java | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java index b07b69aa3..86d267b38 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java @@ -18,6 +18,7 @@ import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.BubbleColumnBlock; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.FluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.tileentity.TileEntity; @@ -88,7 +89,6 @@ public class WaterWheelBlock extends DirectionalKineticBlock implements ITE 0 ^ !clockwise ? -flow.y * clockwiseMultiplier : -flow.y; } - if (wf.getAxis() == Axis.Y) { if (side.getAxis() == Axis.Z) flowStrength = flow.x < 0 ^ !clockwise ? flow.x * clockwiseMultiplier : flow.x; @@ -141,7 +140,8 @@ public class WaterWheelBlock extends DirectionalKineticBlock implements ITE tolerance) + facing = Direction.DOWN; + else if (Vector3d.of(Direction.UP.getDirectionVec()) + .dotProduct(lookVec.normalize()) > tolerance) + facing = Direction.UP; + else + facing = horizontalFacing; + + } + + return getDefaultState().with(FACING, sneaking ? facing.getOpposite() : facing); } @Override