diff --git a/src/main/java/com/kipti/bnb/content/kinetics/cogwheel_chain/behaviour/CogwheelChainBehaviour.java b/src/main/java/com/kipti/bnb/content/kinetics/cogwheel_chain/behaviour/CogwheelChainBehaviour.java index 8080493a..610a504f 100644 --- a/src/main/java/com/kipti/bnb/content/kinetics/cogwheel_chain/behaviour/CogwheelChainBehaviour.java +++ b/src/main/java/com/kipti/bnb/content/kinetics/cogwheel_chain/behaviour/CogwheelChainBehaviour.java @@ -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) ||