2019-02-25 09:39:24 +00:00
|
|
|
From 706dbd57e4fe49d668ff31fa4e728d50502046c7 Mon Sep 17 00:00:00 2001
|
2018-09-13 01:18:31 +00:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Wed, 12 Sep 2018 21:12:57 -0400
|
|
|
|
Subject: [PATCH] Prevent mob spawning from loading/generating chunks
|
|
|
|
|
2018-09-18 01:50:02 +00:00
|
|
|
also prevents if out of world border bounds
|
2018-09-13 01:18:31 +00:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
2019-02-25 09:39:24 +00:00
|
|
|
index bfbe4d3e3..e2bf17f44 100644
|
2018-09-13 01:18:31 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
2018-09-15 17:46:01 +00:00
|
|
|
@@ -129,9 +129,9 @@ public final class SpawnerCreature {
|
2018-09-13 01:18:31 +00:00
|
|
|
int i2 = blockposition1.getX();
|
|
|
|
int j2 = blockposition1.getY();
|
|
|
|
int k2 = blockposition1.getZ();
|
|
|
|
- IBlockData iblockdata = worldserver.getType(blockposition1);
|
2018-09-18 01:50:02 +00:00
|
|
|
+ IBlockData iblockdata = worldserver.getTypeIfLoadedAndInBounds(blockposition1); // Paper - don't load chunks for mob spawn
|
2018-09-13 01:18:31 +00:00
|
|
|
|
2018-09-15 17:46:01 +00:00
|
|
|
- if (!iblockdata.isOccluding()) {
|
|
|
|
+ if (iblockdata != null && !iblockdata.isOccluding()) { // Paper - don't load chunks for mob spawn
|
2018-09-13 01:18:31 +00:00
|
|
|
int l2 = 0;
|
2018-09-15 17:46:01 +00:00
|
|
|
int i3 = 0;
|
|
|
|
|
2018-10-22 23:16:21 +00:00
|
|
|
@@ -171,7 +171,7 @@ public final class SpawnerCreature {
|
|
|
|
i4 = biomebase_biomemeta.c + worldserver.random.nextInt(1 + biomebase_biomemeta.d - biomebase_biomemeta.c);
|
|
|
|
}
|
2018-09-13 01:18:31 +00:00
|
|
|
|
2018-10-22 23:16:21 +00:00
|
|
|
- if (worldserver.a(enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) {
|
2018-09-18 01:50:02 +00:00
|
|
|
+ if (worldserver.isLoadedAndInBounds(blockposition_mutableblockposition) && worldserver.a(enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
|
2018-10-22 23:16:21 +00:00
|
|
|
EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(biomebase_biomemeta.b);
|
|
|
|
if (entitypositiontypes_surface != null && a(entitypositiontypes_surface, worldserver, blockposition_mutableblockposition, biomebase_biomemeta.b)) {
|
|
|
|
EntityInsentient entityinsentient;
|
2018-09-13 01:18:31 +00:00
|
|
|
--
|
2019-01-01 03:15:55 +00:00
|
|
|
2.20.1
|
2018-09-13 01:18:31 +00:00
|
|
|
|