Skip to content

Commit

Permalink
fix: null check for claim manager in ChunkMapMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Nov 30, 2023
1 parent b34a96a commit c5cb65f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ public abstract class ChunkMapMixin {

@Inject(method = "anyPlayerCloseEnoughForSpawning", at = @At("RETURN"), cancellable = true)
private void anyPlayerCloseEnoughForSpawningFTBC(ChunkPos pos, CallbackInfoReturnable<Boolean> 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);
}
}
Expand Down

0 comments on commit c5cb65f

Please sign in to comment.