2019-04-22 23:36:14 +02:00
|
|
|
From 25496ec74347f65858d1b02bf856dc89c3e44a65 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
|
2019-04-22 23:36:14 +02:00
|
|
|
index d125fae03b..297c53d15c 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
|
2018-09-15 19:46:01 +02:00
|
|
|
@@ -129,9 +129,9 @@ public final class SpawnerCreature {
|
2018-09-13 03:18:31 +02:00
|
|
|
int i2 = blockposition1.getX();
|
|
|
|
int j2 = blockposition1.getY();
|
|
|
|
int k2 = blockposition1.getZ();
|
|
|
|
- IBlockData iblockdata = worldserver.getType(blockposition1);
|
2018-09-18 03:50:02 +02:00
|
|
|
+ IBlockData iblockdata = worldserver.getTypeIfLoadedAndInBounds(blockposition1); // Paper - don't load chunks for mob spawn
|
2018-09-13 03:18:31 +02:00
|
|
|
|
2018-09-15 19:46:01 +02:00
|
|
|
- if (!iblockdata.isOccluding()) {
|
|
|
|
+ if (iblockdata != null && !iblockdata.isOccluding()) { // Paper - don't load chunks for mob spawn
|
2018-09-13 03:18:31 +02:00
|
|
|
int l2 = 0;
|
2018-09-15 19:46:01 +02:00
|
|
|
int i3 = 0;
|
|
|
|
|
2019-03-24 05:59:45 +01:00
|
|
|
@@ -158,7 +158,7 @@ public final class SpawnerCreature {
|
|
|
|
float f1 = (float) l3 + 0.5F;
|
|
|
|
EntityHuman entityhuman1 = worldserver.a((double) f, (double) f1, -1.0D);
|
2018-09-13 03:18:31 +02:00
|
|
|
|
2019-03-24 05:59:45 +01:00
|
|
|
- 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) {
|
2018-09-13 03:18:31 +02:00
|
|
|
--
|
2019-03-20 01:28:15 +01:00
|
|
|
2.21.0
|
2018-09-13 03:18:31 +02:00
|
|
|
|