mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-14 22:43:56 +01:00
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:
parent
2a56bb76be
commit
8ec74ee96d
@ -142,7 +142,7 @@ public class PortableStorageInterfaceMovement extends MovementBehaviour {
|
|||||||
.getDirectionVec());
|
.getDirectionVec());
|
||||||
directionVec = context.rotation.apply(directionVec);
|
directionVec = context.rotation.apply(directionVec);
|
||||||
Direction facingFromVector = Direction.getFacingFromVector(directionVec.x, directionVec.y, directionVec.z);
|
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.empty();
|
||||||
return Optional.of(facingFromVector);
|
return Optional.of(facingFromVector);
|
||||||
}
|
}
|
||||||
|
@ -250,6 +250,8 @@ public class StructureTransform {
|
|||||||
newDirection = direction;
|
newDirection = direction;
|
||||||
if (direction.getAxis() == rotationAxis)
|
if (direction.getAxis() == rotationAxis)
|
||||||
newSlope = BeltSlope.SIDEWAYS;
|
newSlope = BeltSlope.SIDEWAYS;
|
||||||
|
else if (direction.getAxis() != Axis.Z)
|
||||||
|
newDirection = direction.getOpposite();
|
||||||
}
|
}
|
||||||
|
|
||||||
state = state.with(BeltBlock.HORIZONTAL_FACING, newDirection);
|
state = state.with(BeltBlock.HORIZONTAL_FACING, newDirection);
|
||||||
@ -332,8 +334,7 @@ public class StructureTransform {
|
|||||||
int readAngle = buffer.readInt();
|
int readAngle = buffer.readInt();
|
||||||
int axisIndex = buffer.readVarInt();
|
int axisIndex = buffer.readVarInt();
|
||||||
int rotationIndex = buffer.readVarInt();
|
int rotationIndex = buffer.readVarInt();
|
||||||
return new StructureTransform(readBlockPos, readAngle,
|
return new StructureTransform(readBlockPos, readAngle, axisIndex == -1 ? null : Axis.values()[axisIndex],
|
||||||
axisIndex == -1 ? null : Axis.values()[axisIndex],
|
|
||||||
rotationIndex == -1 ? null : Rotation.values()[rotationIndex]);
|
rotationIndex == -1 ? null : Rotation.values()[rotationIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user