From c5cb65fbeb53b390e83258d5493c83eb194f16b5 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Thu, 30 Nov 2023 16:04:55 +0000 Subject: [PATCH] fix: null check for claim manager in ChunkMapMixin https://github.com/FTBTeam/FTB-Mods-Issues/issues/1020 --- .../dev/ftb/mods/ftbchunks/core/mixin/ChunkMapMixin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/dev/ftb/mods/ftbchunks/core/mixin/ChunkMapMixin.java b/common/src/main/java/dev/ftb/mods/ftbchunks/core/mixin/ChunkMapMixin.java index 5430d25f..1629d429 100644 --- a/common/src/main/java/dev/ftb/mods/ftbchunks/core/mixin/ChunkMapMixin.java +++ b/common/src/main/java/dev/ftb/mods/ftbchunks/core/mixin/ChunkMapMixin.java @@ -20,7 +20,10 @@ public abstract class ChunkMapMixin { @Inject(method = "anyPlayerCloseEnoughForSpawning", at = @At("RETURN"), cancellable = true) private void anyPlayerCloseEnoughForSpawningFTBC(ChunkPos pos, CallbackInfoReturnable ci) { - if (!ci.getReturnValue() && ClaimedChunkManagerImpl.getInstance().isChunkForceLoaded(new ChunkDimPos(level.dimension(), pos))) { + // it's possible for the claim manager to be null at this point, depending on what other mixins are in play... + // https://github.com/FTBTeam/FTB-Mods-Issues/issues/1020 + if (!ci.getReturnValue() && ClaimedChunkManagerImpl.getInstance() != null + && ClaimedChunkManagerImpl.getInstance().isChunkForceLoaded(new ChunkDimPos(level.dimension(), pos))) { ci.setReturnValue(true); } }