Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@5436d44 Deprecate several Keyed#getKey methods (#10357)
PaperMC/Paper@a7f1dc6 Change online mode default for Velocity configuration (#10413)
PaperMC/Paper@37db2d7 [ci skip] Update book page/char limit for book meta doc (#10415)
PaperMC/Paper@526795b Update patches to handle vineflower decompiler (#10406)
PaperMC/Paper@8fe90de [ci skip] Referenced InventoryDragEvent in documentation of InventoryClickEvent (#10395)
PaperMC/Paper@46d462b Fix StackOverflowException thrown on shutdown (Fixes #10404) (#10408)
PaperMC/Paper@f061e76 Fix hit criteria advancement triggered before changing state (#10409)
PaperMC/Paper@3263470 Add color transition and clone functions to ParticleBuilder (#10342)
PaperMC/Paper@4445d23 Deprecate ItemStack#setType & add ItemStack#withType (#10290)
This commit is contained in:
granny
2024-04-12 17:45:35 -07:00
parent 9069ede4b1
commit 0b95a8072a
210 changed files with 751 additions and 918 deletions

View File

@@ -5,10 +5,10 @@ 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 5f407535298a31a34cfe114dd863fd6a9b977707..29c7e33fe961020e5a0007287fe9b6631689f1b8 100644
index 5d1610eddcaf0cf65c726a5438b42e53bab85332..5665aa461f8c943bd7373df28d7d152251cce431 100644
--- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
@@ -30,7 +30,7 @@ public class CatSpawner implements CustomSpawner {
@@ -28,7 +28,7 @@ public class CatSpawner implements CustomSpawner {
if (this.nextTick > 0) {
return 0;
} else {
@@ -17,41 +17,36 @@ index 5f407535298a31a34cfe114dd863fd6a9b977707..29c7e33fe961020e5a0007287fe9b663
Player player = world.getRandomPlayer();
if (player == null) {
return 0;
@@ -63,11 +63,15 @@ public class CatSpawner implements CustomSpawner {
}
@@ -62,8 +62,12 @@ public class CatSpawner implements CustomSpawner {
private int spawnInVillage(ServerLevel world, BlockPos pos) {
- int i = 48;
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) -> {
return entry.is(PoiTypes.HOME);
- }, pos, 48, PoiManager.Occupancy.IS_OCCUPIED) > 4L) {
- List<Cat> list = world.getEntitiesOfClass(Cat.class, (new AABB(pos)).inflate(48.0D, 8.0D, 48.0D));
+ }, pos, range, PoiManager.Occupancy.IS_OCCUPIED) > 4L) {
+ List<Cat> list = world.getEntitiesOfClass(Cat.class, (new AABB(pos)).inflate(range, 8.0D, range));
+ // Purpur end
+ 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);
}
@@ -77,8 +81,11 @@ public class CatSpawner implements CustomSpawner {
}
@@ -74,7 +78,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.0D, 8.0D, 16.0D));
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.0D, range));
+ 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 ba7f378b9b0c791dd77862439f310a6653cccf30..6102535823eab8862c23919f20a8062f9f750eb6 100644
index 6649787fc15ca06ec2d4e7ac7b0ff061c4d4de82..c9dbbe9dde5b463bdde68604d6e5b1c2902d57fa 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -272,6 +272,9 @@ public class PurpurWorldConfig {