mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Implement a hard limit for pillager outpost spawns
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
From 38094095f810058cd996cb092a77a0787c910e25 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Mon, 22 Jul 2019 14:24:26 -0500
|
||||||
|
Subject: [PATCH] Implement a hard limit for pillager outpost spawns
|
||||||
|
|
||||||
|
---
|
||||||
|
.../java/net/minecraft/server/ChunkProviderGenerate.java | 1 +
|
||||||
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||||
|
2 files changed, 6 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||||
|
index b794a39d31..39159e34a2 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||||
|
@@ -142,6 +142,7 @@ public class ChunkProviderGenerate extends ChunkGeneratorAbstract<GeneratorSetti
|
||||||
|
}
|
||||||
|
} else if (enumcreaturetype == EnumCreatureType.MONSTER) {
|
||||||
|
if (WorldGenerator.PILLAGER_OUTPOST.a(this.a, blockposition)) {
|
||||||
|
+ if (getWorld().purpurConfig.limitPillagerOutpostSpawns > 0 && getWorld().getEntitiesByClass(EntityPillager.class, new AxisAlignedBB(blockposition).grow(128)).size() < getWorld().purpurConfig.limitPillagerOutpostSpawns) // Purpur
|
||||||
|
return WorldGenerator.PILLAGER_OUTPOST.e();
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index 3ec048adf3..e3fe4ed5f0 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -128,4 +128,9 @@ public class PurpurWorldConfig {
|
||||||
|
blockTickEvent = getBoolean("block-tick-events", blockTickEvent);
|
||||||
|
fluidTickEvent = getBoolean("fluid-tick-events", fluidTickEvent);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public int limitPillagerOutpostSpawns = 10;
|
||||||
|
+ private void limitPillagerOutpostSpawns() {
|
||||||
|
+ limitPillagerOutpostSpawns = getInt("limit-pillager-outpost-spawns", limitPillagerOutpostSpawns);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
Reference in New Issue
Block a user