2018-09-13 03:18:31 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
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 03:50:02 +02:00
|
|
|
also prevents if out of world border bounds
|
2018-09-13 03:18:31 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
2018-09-13 03:18:31 +02:00
|
|
|
--- 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 {
|
2020-06-25 16:09:55 +02:00
|
|
|
StructureManager structuremanager = worldserver.getStructureManager();
|
|
|
|
ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator();
|
|
|
|
int i = blockposition.getY();
|
|
|
|
- IBlockData iblockdata = ichunkaccess.getType(blockposition);
|
|
|
|
+ IBlockData iblockdata = worldserver.getTypeIfLoadedAndInBounds(blockposition); // Paper - don't load chunks for mob spawn
|
2018-09-15 19:46:01 +02:00
|
|
|
|
2020-06-25 16:09:55 +02:00
|
|
|
- if (!iblockdata.isOccluding(ichunkaccess, blockposition)) {
|
|
|
|
+ if (iblockdata != null && !iblockdata.isOccluding(ichunkaccess, blockposition)) { // Paper - don't load chunks for mob spawn
|
|
|
|
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
|
|
|
int j = 0;
|
|
|
|
int k = 0;
|
2018-09-13 03:18:31 +02:00
|
|
|
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
|
2020-06-25 16:09:55 +02:00
|
|
|
if (entityhuman != null) {
|
2020-08-25 04:22:08 +02:00
|
|
|
double d2 = entityhuman.h(d0, (double) i, d1);
|
2019-03-24 05:59:45 +01:00
|
|
|
|
2020-06-25 16:09:55 +02:00
|
|
|
- if (a(worldserver, ichunkaccess, blockposition_mutableblockposition, d2)) {
|
|
|
|
+ if (a(worldserver, ichunkaccess, blockposition_mutableblockposition, d2) && worldserver.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
|
2020-08-25 04:22:08 +02:00
|
|
|
if (biomesettingsmobs_c == null) {
|
|
|
|
biomesettingsmobs_c = a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, worldserver.random, (BlockPosition) blockposition_mutableblockposition);
|
|
|
|
if (biomesettingsmobs_c == null) {
|