mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Implement configurable search radius for villagers to spawn iron golems
This commit is contained in:
@@ -264,3 +264,13 @@ fluid-tick-events
|
|||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
* **default**: true
|
* **default**: true
|
||||||
* **description**: Fire plugin events when fluids tick
|
* **description**: Fire plugin events when fluids tick
|
||||||
|
|
||||||
|
limit-pillager-outpost-spawns
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
* **default**: 10
|
||||||
|
* **description**: Limit the number of pillagers allowed to spawn at an outpost at any given time
|
||||||
|
|
||||||
|
radius-villager-iron-golem-spawns
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
* **default**: 10
|
||||||
|
* **description**: Radius villagers search for existing iron golems before spawning more
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
From e9d6ce7c7c718b19d3c2e95a2e083b9c91262bff Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Mon, 22 Jul 2019 17:32:17 -0500
|
||||||
|
Subject: [PATCH] Implement configurable search radius for villagers to spawn
|
||||||
|
iron golems
|
||||||
|
|
||||||
|
---
|
||||||
|
src/main/java/net/minecraft/server/EntityVillager.java | 2 +-
|
||||||
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||||
|
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||||
|
index 976473a678..c3bbf49978 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||||
|
@@ -844,7 +844,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||||
|
|
||||||
|
public void a(long i, int j) {
|
||||||
|
if (this.a(i)) {
|
||||||
|
- AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(10.0D, 10.0D, 10.0D);
|
||||||
|
+ AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(world.purpurConfig.radiusVillagerIronGolemSpawns);
|
||||||
|
List<EntityVillager> list = this.world.a(EntityVillager.class, axisalignedbb);
|
||||||
|
List<EntityVillager> list1 = (List) list.stream().filter((entityvillager) -> {
|
||||||
|
return entityvillager.a(i);
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index e3fe4ed5f0..9b8621e5a1 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -133,4 +133,9 @@ public class PurpurWorldConfig {
|
||||||
|
private void limitPillagerOutpostSpawns() {
|
||||||
|
limitPillagerOutpostSpawns = getInt("limit-pillager-outpost-spawns", limitPillagerOutpostSpawns);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public int radiusVillagerIronGolemSpawns = 10;
|
||||||
|
+ private void radiusVillagerIronGolemSpawns() {
|
||||||
|
+ radiusVillagerIronGolemSpawns = getInt("radius-villager-iron-golem-spawns", radiusVillagerIronGolemSpawns);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
Reference in New Issue
Block a user