Skip to content

Commit

Permalink
Catch setWingGroupTransform() throwing an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
StewStrong committed Dec 28, 2023
1 parent 2e0c543 commit 72fac32
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,14 @@ private void postTick(final CallbackInfo ci) {
final LoadedServerShip ship = VSGameUtilsKt.getShipObjectManagingPos(serverLevel,
VectorConversionsMCKt.toJOML(thisAsAbstractContraptionEntity.position()));
if (ship != null) {
// This can happen if a player moves a train contraption from ship to world using a wrench
ship.getAttachment(WingManager.class).setWingGroupTransform(wingGroupId, computeContraptionWingTransform());
try {
// This can happen if a player moves a train contraption from ship to world using a wrench
ship.getAttachment(WingManager.class)
.setWingGroupTransform(wingGroupId, computeContraptionWingTransform());
} catch (final Exception e) {
// I'm not sure why, but this fails sometimes. For now just catch the error and print it
e.printStackTrace();
}
}
}
}
Expand Down

0 comments on commit 72fac32

Please sign in to comment.