From 8ec74ee96ddca638d35de0071d8099f5d7801cb9 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 4 Dec 2020 00:21:30 +0100 Subject: [PATCH] Minor contraption annoyances - Fixed belts sometimes popping off when disassembling a contraption - Made Portable Storage Interfaces a little more lenient to engage at funny angles --- .../components/actors/PortableStorageInterfaceMovement.java | 2 +- .../components/structureMovement/StructureTransform.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java index bfb1fbca9..30f62fada 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java @@ -142,7 +142,7 @@ public class PortableStorageInterfaceMovement extends MovementBehaviour { .getDirectionVec()); directionVec = context.rotation.apply(directionVec); Direction facingFromVector = Direction.getFacingFromVector(directionVec.x, directionVec.y, directionVec.z); - if (directionVec.distanceTo(new Vec3d(facingFromVector.getDirectionVec())) > 1 / 8f) + if (directionVec.distanceTo(new Vec3d(facingFromVector.getDirectionVec())) > 1 / 2f) return Optional.empty(); return Optional.of(facingFromVector); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/StructureTransform.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/StructureTransform.java index 0e7470654..85adf5e0d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/StructureTransform.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/StructureTransform.java @@ -250,6 +250,8 @@ public class StructureTransform { newDirection = direction; if (direction.getAxis() == rotationAxis) newSlope = BeltSlope.SIDEWAYS; + else if (direction.getAxis() != Axis.Z) + newDirection = direction.getOpposite(); } state = state.with(BeltBlock.HORIZONTAL_FACING, newDirection); @@ -332,8 +334,7 @@ public class StructureTransform { int readAngle = buffer.readInt(); int axisIndex = buffer.readVarInt(); int rotationIndex = buffer.readVarInt(); - return new StructureTransform(readBlockPos, readAngle, - axisIndex == -1 ? null : Axis.values()[axisIndex], + return new StructureTransform(readBlockPos, readAngle, axisIndex == -1 ? null : Axis.values()[axisIndex], rotationIndex == -1 ? null : Rotation.values()[rotationIndex]); }