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
This commit is contained in:
simibubi 2020-12-04 00:21:30 +01:00
parent 2a56bb76be
commit 8ec74ee96d
2 changed files with 4 additions and 3 deletions

View file

@ -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);
}

View file

@ -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]);
}