diff --git a/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_tick_iteration/ChunkMapMixin.java b/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_tick_iteration/ChunkMapMixin.java index 67360424..0b2001c2 100644 --- a/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_tick_iteration/ChunkMapMixin.java +++ b/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_tick_iteration/ChunkMapMixin.java @@ -85,11 +85,20 @@ private void removePlayerFromSpawnTracker(final ServerPlayer player, final boole } /** - * @reason Use nearby players to avoid iterating over all online players + * @reason Avoid checking first if there are nearby players, as we make internal perform this implicitly. * @author Spottedleaf */ @Overwrite public boolean anyPlayerCloseEnoughForSpawning(final ChunkPos pos) { + return this.anyPlayerCloseEnoughForSpawningInternal(pos); + } + + /** + * @reason Use nearby players to avoid iterating over all online players + * @author Spottedleaf + */ + @Overwrite + public boolean anyPlayerCloseEnoughForSpawningInternal(final ChunkPos pos) { final ReferenceList players = ((ChunkSystemServerLevel)this.level).moonrise$getNearbyPlayers().getPlayers( pos, NearbyPlayers.NearbyMapType.SPAWN_RANGE );