diff --git a/paper-server/patches/sources/net/minecraft/world/level/NaturalSpawner.java.patch b/paper-server/patches/sources/net/minecraft/world/level/NaturalSpawner.java.patch index f58012a2a..5f188bd66 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/NaturalSpawner.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/NaturalSpawner.java.patch @@ -28,7 +28,7 @@ BlockPos blockPos = entity.blockPosition(); chunkGetter.query(ChunkPos.asLong(blockPos), chunk -> { MobSpawnSettings.MobSpawnCost mobSpawnCost = getRoughBiome(blockPos, chunk).getMobSettings().getMobSpawnCost(entity.getType()); -@@ -96,17 +_,36 @@ +@@ -96,17 +_,37 @@ return chunk.getNoiseBiome(QuartPos.fromBlock(pos.getX()), QuartPos.fromBlock(pos.getY()), QuartPos.fromBlock(pos.getZ())).value(); } @@ -68,8 +68,9 @@ + if ((spawnFriendlies || !enumcreaturetype.isFriendly()) + && (spawnEnemies || enumcreaturetype.isFriendly()) + && (spawnPassives || !enumcreaturetype.isPersistent()) -+ && spawnState.canSpawnForCategoryGlobal(enumcreaturetype)) { ++ && spawnState.canSpawnForCategoryGlobal(enumcreaturetype, limit)) { // Paper - Optional per player mob spawns; remove global check, check later during the local one + list.add(enumcreaturetype); ++ // CraftBukkit end } } @@ -96,7 +97,7 @@ int y = pos.getY(); - BlockState blockState = chunk.getBlockState(pos); - if (!blockState.isRedstoneConductor(chunk, pos)) { -+ BlockState blockState = chunk.getBlockStateIfLoadedAndInBounds(pos); // Paper - don't load chunks for mob spawn ++ BlockState blockState = level.getBlockStateIfLoadedAndInBounds(pos); // Paper - don't load chunks for mob spawn + if (blockState != null && !blockState.isRedstoneConductor(chunk, pos)) { // Paper - don't load chunks for mob spawn BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(); int i = 0;