2020-04-22 00:06:30 +02:00
|
|
|
From 6021ab3aee3fc3c4ca4c8f47288501cc78907389 Mon Sep 17 00:00:00 2001
|
2018-09-13 03:18:31 +02: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 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-04-22 00:06:30 +02:00
|
|
|
index 224443e0..fdac5bb3 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
|
2019-05-05 10:33:44 +02:00
|
|
|
@@ -25,9 +25,9 @@ public final class SpawnerCreature {
|
|
|
|
int l = blockposition1.getZ();
|
2018-09-13 03:18:31 +02:00
|
|
|
|
2019-05-05 10:33:44 +02:00
|
|
|
if (k >= 1) {
|
|
|
|
- IBlockData iblockdata = chunk.getType(blockposition1);
|
2019-12-13 02:18:18 +01:00
|
|
|
+ IBlockData iblockdata = worldserver.getTypeIfLoadedAndInBounds(blockposition1); // Paper - don't load chunks for mob spawn
|
2018-09-15 19:46:01 +02:00
|
|
|
|
2019-05-05 10:33:44 +02:00
|
|
|
- if (!iblockdata.isOccluding(chunk, blockposition1)) {
|
|
|
|
+ if (iblockdata != null && !iblockdata.isOccluding(chunk, blockposition1)) { // Paper - don't load chunks for mob spawn
|
|
|
|
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
|
|
|
int i1 = 0;
|
2018-09-13 03:18:31 +02:00
|
|
|
|
2019-07-20 06:01:24 +02:00
|
|
|
@@ -55,7 +55,7 @@ public final class SpawnerCreature {
|
|
|
|
if (entityhuman != null) {
|
2019-12-12 17:20:43 +01:00
|
|
|
double d0 = entityhuman.g((double) f, (double) k, (double) f1);
|
2019-03-24 05:59:45 +01:00
|
|
|
|
2019-07-20 06:01:24 +02:00
|
|
|
- if (d0 > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D)) {
|
2019-12-13 02:18:18 +01:00
|
|
|
+ if (d0 > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D) && worldserver.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
|
2019-07-20 06:01:24 +02:00
|
|
|
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition_mutableblockposition);
|
2019-05-05 10:33:44 +02:00
|
|
|
|
2019-12-12 17:20:43 +01:00
|
|
|
if (Objects.equals(chunkcoordintpair, chunk.getPos()) || worldserver.getChunkProvider().a(chunkcoordintpair)) {
|
2018-09-13 03:18:31 +02:00
|
|
|
--
|
2020-04-22 00:06:30 +02:00
|
|
|
2.25.1.windows.1
|
2018-09-13 03:18:31 +02:00
|
|
|
|