mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 04:31:58 +01:00
44d032f1e9
* Houston, we got a patch * is this the end of the beginning or the beginning of the end
35 lines
2.1 KiB
Diff
35 lines
2.1 KiB
Diff
From 9df1428b0a73a35c6958d1019b4c4c85fbf503ff 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
|
|
|
|
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 487114367..bcca7faed 100644
|
|
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
|
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
|
@@ -25,9 +25,9 @@ public final class SpawnerCreature {
|
|
int l = blockposition1.getZ();
|
|
|
|
if (k >= 1) {
|
|
- IBlockData iblockdata = chunk.getType(blockposition1);
|
|
+ IBlockData iblockdata = world.getTypeIfLoadedAndInBounds(blockposition1); // Paper - don't load chunks for mob spawn
|
|
|
|
- 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;
|
|
|
|
@@ -55,7 +55,7 @@ public final class SpawnerCreature {
|
|
if (entityhuman != null) {
|
|
double d0 = entityhuman.g((double) f, (double) k, (double) f1);
|
|
|
|
- if (d0 > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D)) {
|
|
+ if (d0 > 576.0D && !blockposition.a((IPosition) (new Vec3D((double) f, (double) k, (double) f1)), 24.0D) && world.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn
|
|
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition_mutableblockposition);
|
|
|
|
if (Objects.equals(chunkcoordintpair, chunk.getPos()) || worldserver.getChunkProvider().a(chunkcoordintpair)) {
|
|
--
|
|
2.17.1
|
|
|