mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Fix a case where mob spawning could load/gen chunks
This commit is contained in:
parent
252420097a
commit
2651356bc9
1 changed files with 8 additions and 8 deletions
|
@ -6,7 +6,7 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks
|
|||
also prevents if out of world border bounds
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index bfbe4d3e3..e2bf17f44 100644
|
||||
index bfbe4d3e39..17bb81c03e 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
|
||||
|
@ -22,12 +22,12 @@ index bfbe4d3e3..e2bf17f44 100644
|
|||
int i3 = 0;
|
||||
|
||||
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
|
||||
i4 = biomebase_biomemeta.c + worldserver.random.nextInt(1 + biomebase_biomemeta.d - biomebase_biomemeta.c);
|
||||
}
|
||||
float f1 = (float) l3 + 0.5F;
|
||||
EntityHuman entityhuman1 = worldserver.a((double) f, (double) f1, -1.0D);
|
||||
|
||||
- if (worldserver.a(enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) {
|
||||
+ if (worldserver.isLoadedAndInBounds(blockposition_mutableblockposition) && worldserver.a(enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
|
||||
EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(biomebase_biomemeta.b);
|
||||
if (entitypositiontypes_surface != null && a(entitypositiontypes_surface, worldserver, blockposition_mutableblockposition, biomebase_biomemeta.b)) {
|
||||
EntityInsentient entityinsentient;
|
||||
- if (entityhuman1 != null) {
|
||||
+ if (entityhuman1 != null && worldserver.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
|
||||
double d0 = entityhuman1.d((double) f, (double) k3, (double) f1);
|
||||
|
||||
if (d0 > 576.0D && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) {
|
||||
--
|
Loading…
Reference in a new issue