From 4c960ef1eda0582fecc960ac0197191c75ca0eea Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 20 Nov 2020 16:28:57 +0100 Subject: [PATCH] Clean up - Fixed stabilizer bearings not always rotating their head against parent transform - Windmill bearings now display a tooltip when waiting to be updated by a player - Removed obsolete overrides from hotswapping streak --- .../structureMovement/AbstractContraptionEntity.java | 10 ---------- .../bearing/MechanicalBearingTileEntity.java | 5 ++--- .../bearing/StabilizedBearingMovementBehaviour.java | 4 +++- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java index a658429a2..bfbb03470 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java @@ -78,11 +78,6 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit return true; } - @Override - protected void addPassenger(Entity passenger) { - super.addPassenger(passenger); - } - public void addSittingPassenger(Entity passenger, int seatIndex) { passenger.startRiding(this, true); if (world.isRemote) @@ -93,11 +88,6 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit new ContraptionSeatMappingPacket(getEntityId(), contraption.getSeatMapping())); } - @Override - public void remove() { - super.remove(); - } - @Override protected void removePassenger(Entity passenger) { Vec3d transformedVector = getPassengerPosition(passenger, 1); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java index 21a08747d..2c8ffb149 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java @@ -260,15 +260,14 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity imp return true; if (isPlayerSneaking) return false; - if (isWindmill()) - return false; - if (getSpeed() == 0) + if (!isWindmill() && getSpeed() == 0) return false; if (running) return false; BlockState state = getBlockState(); if (!(state.getBlock() instanceof BearingBlock)) return false; + BlockState attachedState = world.getBlockState(pos.offset(state.get(BearingBlock.FACING))); if (attachedState.getMaterial() .isReplaceable()) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java index 03cc9e726..598c84a12 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java @@ -42,6 +42,8 @@ public class StabilizedBearingMovementBehaviour extends MovementBehaviour { // rotate against parent float offset = 0; + int offsetMultiplier = facing.getAxisDirection().getOffset(); + AbstractContraptionEntity entity = context.contraption.entity; if (entity instanceof ControlledContraptionEntity) { ControlledContraptionEntity controlledCE = (ControlledContraptionEntity) entity; @@ -60,7 +62,7 @@ public class StabilizedBearingMovementBehaviour extends MovementBehaviour { } } if (offset != 0) - superBuffer.rotateCentered(Direction.UP, AngleHelper.rad(offset)); + superBuffer.rotateCentered(Direction.UP, AngleHelper.rad(offset * offsetMultiplier)); // render superBuffer.light(msLocal.peek()