mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
prepare for 1.21.4 update
This commit is contained in:
@@ -1,71 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 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
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
index b0236c7bf9441aa84d3795ffed05dd6099f29636..796dcc0dcf9022b455b8847e045266b8802da0cf 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
@@ -27,7 +27,7 @@ public class CatSpawner implements CustomSpawner {
|
||||
if (this.nextTick > 0) {
|
||||
return 0;
|
||||
} else {
|
||||
- this.nextTick = 1200;
|
||||
+ this.nextTick = world.purpurConfig.catSpawnDelay; // Purpur
|
||||
Player player = world.getRandomPlayer();
|
||||
if (player == null) {
|
||||
return 0;
|
||||
@@ -61,8 +61,12 @@ public class CatSpawner implements CustomSpawner {
|
||||
|
||||
private int spawnInVillage(ServerLevel world, BlockPos pos) {
|
||||
int i = 48;
|
||||
- if (world.getPoiManager().getCountInRange(entry -> entry.is(PoiTypes.HOME), pos, 48, PoiManager.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
- List<Cat> list = world.getEntitiesOfClass(Cat.class, new AABB(pos).inflate(48.0, 8.0, 48.0));
|
||||
+ // Purpur start
|
||||
+ int range = world.purpurConfig.catSpawnVillageScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+ if (world.getPoiManager().getCountInRange(entry -> entry.is(PoiTypes.HOME), pos, range, PoiManager.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
+ List<Cat> list = world.getEntitiesOfClass(Cat.class, new AABB(pos).inflate(range, 8.0, range));
|
||||
+ // Purpur end
|
||||
if (list.size() < 5) {
|
||||
return this.spawnCat(pos, world);
|
||||
}
|
||||
@@ -73,7 +77,11 @@ public class CatSpawner implements CustomSpawner {
|
||||
|
||||
private int spawnInHut(ServerLevel world, BlockPos pos) {
|
||||
int i = 16;
|
||||
- List<Cat> list = world.getEntitiesOfClass(Cat.class, new AABB(pos).inflate(16.0, 8.0, 16.0));
|
||||
+ // Purpur start
|
||||
+ int range = world.purpurConfig.catSpawnSwampHutScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+ List<Cat> list = world.getEntitiesOfClass(Cat.class, new AABB(pos).inflate(range, 8.0, range));
|
||||
+ // Purpur end
|
||||
return list.size() < 1 ? this.spawnCat(pos, world) : 0;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 149360f01139fa4b14e27e5b34fe3fe7682c7ffc..b3284dfbcdc240919776f47a780a824c406c2781 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -312,6 +312,9 @@ public class PurpurWorldConfig {
|
||||
public boolean catControllable = true;
|
||||
public double catMaxHealth = 10.0D;
|
||||
public double catScale = 1.0D;
|
||||
+ 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);
|
||||
@@ -323,6 +326,9 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
catMaxHealth = getDouble("mobs.cat.attributes.max_health", catMaxHealth);
|
||||
catScale = Mth.clamp(getDouble("mobs.cat.attributes.scale", catScale), 0.0625D, 16.0D);
|
||||
+ 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;
|
||||
Reference in New Issue
Block a user