mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: d94d6a29 Optimise IEntityAccess#getPlayerByUUID (#2842) 4237539e Guard against serializing mismatching chunk coordinate (#2844) c1f57657 Updated Upstream (CraftBukkit) f5569fd3 Fix SkullMeta.setPlayerProfile() (#2833) 2f527126 Update upstream CB 4151617d Update no chunk loads for hoppers and double chests patch (#2777) d224bc03 [CI-SKIP] Passage outdated (#2776) db3af11c Fix race condition with regionfile being closed right after getting one (#2812) a817508f [CI-SKIP] Update dependency version in README.md (#2817) 9aeba7c9 Prevent bees loading chunks checking hive position (#2828)
This commit is contained in:
78
patches/server/0090-Add-natural-cat-spawning-options.patch
Normal file
78
patches/server/0090-Add-natural-cat-spawning-options.patch
Normal file
@@ -0,0 +1,78 @@
|
||||
From 5b069fb531f188e9fbdf32c49a8836169d78d8f0 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Dec 2019 18:52:55 -0600
|
||||
Subject: [PATCH] Add natural cat spawning options
|
||||
|
||||
---
|
||||
.../net/minecraft/server/MobSpawnerCat.java | 19 +++++++++++++------
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 9 +++++++++
|
||||
2 files changed, 22 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerCat.java b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
index 6024478dc0..034b973365 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
@@ -15,7 +15,7 @@ public class MobSpawnerCat {
|
||||
if (this.a > 0) {
|
||||
return 0;
|
||||
} else {
|
||||
- this.a = 1200;
|
||||
+ this.a = worldserver.purpurConfig.catSpawnDelay; // Purpur
|
||||
EntityPlayer entityplayer = worldserver.k();
|
||||
|
||||
if (entityplayer == null) {
|
||||
@@ -49,10 +49,13 @@ public class MobSpawnerCat {
|
||||
}
|
||||
|
||||
private int a(WorldServer worldserver, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
+ // Purpur start
|
||||
+ int range = worldserver.purpurConfig.catSpawnVillageScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+ // Purpur end
|
||||
|
||||
- if (worldserver.B().a(VillagePlaceType.q.c(), blockposition, 48, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
- List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(48.0D, 8.0D, 48.0D));
|
||||
+ if (worldserver.B().a(VillagePlaceType.q.c(), blockposition, range, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
+ List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range)); // Purpur
|
||||
|
||||
if (list.size() < 5) {
|
||||
return this.a(blockposition, (World) worldserver);
|
||||
@@ -63,8 +66,12 @@ public class MobSpawnerCat {
|
||||
}
|
||||
|
||||
private int a(World world, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
- List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(16.0D, 8.0D, 16.0D));
|
||||
+ // Purpur start
|
||||
+ int range = world.purpurConfig.catSpawnSwampHutScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+ // Purpur end
|
||||
+
|
||||
+ List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range)); // Purpur
|
||||
|
||||
return list.size() < 1 ? this.a(blockposition, world) : 0;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 17fe278a33..060eac7121 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -189,6 +189,15 @@ public class PurpurWorldConfig {
|
||||
sleepCondition = getString("sleep.condition", sleepCondition);
|
||||
}
|
||||
|
||||
+ public int catSpawnDelay = 1200;
|
||||
+ public int catSpawnSwampHutScanRange = 16;
|
||||
+ public int catSpawnVillageScanRange = 48;
|
||||
+ private void catSettings() {
|
||||
+ catSpawnDelay = getInt("mobs.cat.natural-spawns.delay", catSpawnDelay);
|
||||
+ catSpawnSwampHutScanRange = getInt("mobs.cat.natural-spawns.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange);
|
||||
+ catSpawnVillageScanRange = getInt("mobs.cat.natural-spawns.scan-range-for-other-cats.village", catSpawnVillageScanRange);
|
||||
+ }
|
||||
+
|
||||
public int chickenEggsHatchWhenDespawnedMax = 0;
|
||||
public int chickenEggsHatchWhenDespawnedRange = 10;
|
||||
private void chickenSettings() {
|
||||
--
|
||||
2.24.0
|
||||
|
||||
Reference in New Issue
Block a user