mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
83 lines
3.8 KiB
Diff
83 lines
3.8 KiB
Diff
From 4d0a8cc4bd681061763e57d2addcbfff9a87f6b4 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] Cat spawning options
|
|
|
|
---
|
|
.../net/minecraft/server/MobSpawnerCat.java | 23 +++++++++++++------
|
|
.../net/pl3x/purpur/PurpurWorldConfig.java | 6 +++++
|
|
2 files changed, 22 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MobSpawnerCat.java b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
|
index 6024478dc0..4b55c07d41 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,14 @@ public class MobSpawnerCat {
|
|
}
|
|
|
|
private int a(WorldServer worldserver, BlockPosition blockposition) {
|
|
- boolean flag = true;
|
|
-
|
|
- 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));
|
|
+ // Purpur start
|
|
+ int range = worldserver.purpurConfig.catSpawnVillageScanRange;
|
|
+ if (range <= 0) {
|
|
+ return 0;
|
|
+ }
|
|
+ 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 end
|
|
|
|
if (list.size() < 5) {
|
|
return this.a(blockposition, (World) worldserver);
|
|
@@ -63,8 +67,13 @@ 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;
|
|
+ }
|
|
+ List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
|
+ // Purpur end
|
|
|
|
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 4aaf75fcf4..12fbdf65c5 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -101,10 +101,16 @@ public class PurpurWorldConfig {
|
|
public boolean catRidable = false;
|
|
public boolean catRidableInWater = false;
|
|
public boolean catRequireShiftToMount = true;
|
|
+ public int catSpawnDelay = 1200;
|
|
+ public int catSpawnSwampHutScanRange = 16;
|
|
+ public int catSpawnVillageScanRange = 48;
|
|
private void catSettings() {
|
|
catRidable = getBoolean("mobs.cat.ridable", catRidable);
|
|
catRidableInWater = getBoolean("mobs.cat.ridable-in-water", catRidableInWater);
|
|
catRequireShiftToMount = getBoolean("mobs.cat.require-shift-to-mount", catRequireShiftToMount);
|
|
+ catSpawnDelay = getInt("mobs.cat.spawn-delay", catSpawnDelay);
|
|
+ catSpawnSwampHutScanRange = getInt("mobs.cat.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange);
|
|
+ catSpawnVillageScanRange = getInt("mobs.cat.scan-range-for-other-cats.village", catSpawnVillageScanRange);
|
|
}
|
|
|
|
public boolean caveSpiderRidable = false;
|
|
--
|
|
2.24.0
|
|
|