Updated Upstream (Pufferfish) (#1575)

Upstream has released updates that appear to apply and compile correctly

Pufferfish Changes:
pufferfish-gg/Pufferfish@c9f4e20 Final 1.20.4 Update
pufferfish-gg/Pufferfish@1f3ad02 Final 1.20.4 update, for realzies
pufferfish-gg/Pufferfish@b1ab664 Enable SIMD on java 21
pufferfish-gg/Pufferfish@0674c2b 1.21 compiles
pufferfish-gg/Pufferfish@98ea973 Fix 1.21 version checkers
pufferfish-gg/Pufferfish@68f859c Fix lambda/tick guard patch
pufferfish-gg/Pufferfish@eaa18d5 Updated Upstream (Paper)
pufferfish-gg/Pufferfish@1d72eea Updated Upstream (Paper)
pufferfish-gg/Pufferfish@1d3c743 Update pufferfish version detector stuff
pufferfish-gg/Pufferfish@5e30963 Fix crash bug
pufferfish-gg/Pufferfish@12571eb Use mojmapped paperclip jar instead (CI only)
pufferfish-gg/Pufferfish@4d16ae0 Drop a patch - moonrise includes it
pufferfish-gg/Pufferfish@52c2d05 Revert "Drop a patch - moonrise includes it"
pufferfish-gg/Pufferfish@bdb56f1 Fix entity interactions with fluids
pufferfish-gg/Pufferfish@469e5c1 Updated Upstream (Paper)
pufferfish-gg/Pufferfish@d75961f 1.21.1 Update (Updated Upstream (Paper))
This commit is contained in:
granny
2024-08-15 14:07:11 -07:00
committed by GitHub
parent 3f790ac3a7
commit 201e928fa6
346 changed files with 1012 additions and 1814 deletions

View File

@@ -0,0 +1,71 @@
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 e0e5046c84941a8d17e18c177f3daea9cb631940..d503d7a5837dbeb98e58dbe8f7e5de45f6d88990 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 e5c4ca83392f398e24be193a0ed77daa85db9913..7da688e575a1c4ca35c0d23401bf52f3bbbed6ae 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;