Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ private boolean tryTransferOnRemoval() {
if (controllerBehaviour == null) return false;

final BlockState replacingState = this.getLevel().getBlockState(this.getPos());
final PathedCogwheelNode thisNode = controllerBehaviour.getControlledChain().getNodeFromControllerOffset(
// getControlledChain() may return null. pucgenie: idk why exactly, but it really happens in skies2 aero 1.6.0 https://mclo.gs/Oce6yL8
final PathedCogwheelNode thisNode = java.util.Optional.ofNullable(controllerBehaviour.getControlledChain()).map(controlledChain -> controlledChain.getNodeFromControllerOffset(
this.controllerOffset == null ? Vec3i.ZERO : this.controllerOffset
);
)).orElse(null);
final CogwheelChainCandidate replacingCandidate = CogwheelChainCandidate.getForBlock(replacingState);
if (replacingCandidate == null || thisNode == null ||
!replacingCandidate.isConsistentWithNode(thisNode) ||
Expand Down