From 6806b9d0025dae237d7a14e0118178c8e1ca489b Mon Sep 17 00:00:00 2001 From: NanaChiyo0721 Date: Fri, 14 Aug 2026 21:15:47 +0800 Subject: [PATCH] Fix bugs in 0013 and 0034 0013: Creating world via CraftSever#createWorld ignores spawn bonusChest() option(well although folia doesn't have world apis(x)) 0034: Misspelled class name causes incorrectly ignoring PreSpawnerSpawnEvent firing --- .../0034-Reduce-allocation-in-unlistened-spawn-events.patch | 4 ++-- .../0013-Leaf-Secure-seed-and-matter-seed-command.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shiroha-server/minecraft-patches/features/0034-Reduce-allocation-in-unlistened-spawn-events.patch b/shiroha-server/minecraft-patches/features/0034-Reduce-allocation-in-unlistened-spawn-events.patch index 86fc108..36fece8 100644 --- a/shiroha-server/minecraft-patches/features/0034-Reduce-allocation-in-unlistened-spawn-events.patch +++ b/shiroha-server/minecraft-patches/features/0034-Reduce-allocation-in-unlistened-spawn-events.patch @@ -45,14 +45,14 @@ index 6efaa78faca15c7a48bdffb24480d1bac29f3ba8..93f94d5b8f66b97bfd6a2fe3a35bbcbc T entity = this.create(level, postSpawnConfig, spawnPos, spawnReason, tryMoveDown, movedUp); if (entity != null) { diff --git a/net/minecraft/world/level/BaseSpawner.java b/net/minecraft/world/level/BaseSpawner.java -index 2f89a9145902e514089924462003709f256ac3f4..6ef921e08c52e9611e261066724d8893b531fcd8 100644 +index 2f89a9145902e514089924462003709f256ac3f4..01a68ad7c5d32bafd5ab24398f71a8ac0eb560a0 100644 --- a/net/minecraft/world/level/BaseSpawner.java +++ b/net/minecraft/world/level/BaseSpawner.java @@ -140,6 +140,7 @@ public abstract class BaseSpawner { } // Paper start - PreCreatureSpawnEvent -+ if (com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent.getHandlerList().getRegisteredListeners().length != 0) { // Shiroha - Reduce allocation in unlistened spawn events ++ if (com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent.getHandlerList().getRegisteredListeners().length != 0) { // Shiroha - Reduce allocation in unlistened spawn events com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent event = new com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent( org.bukkit.craftbukkit.util.CraftLocation.toBukkit(spawnPos, level), org.bukkit.craftbukkit.entity.CraftEntityType.minecraftToBukkit(entityType.get()), diff --git a/shiroha-server/paper-patches/features/0013-Leaf-Secure-seed-and-matter-seed-command.patch b/shiroha-server/paper-patches/features/0013-Leaf-Secure-seed-and-matter-seed-command.patch index 264c8d8..214128a 100644 --- a/shiroha-server/paper-patches/features/0013-Leaf-Secure-seed-and-matter-seed-command.patch +++ b/shiroha-server/paper-patches/features/0013-Leaf-Secure-seed-and-matter-seed-command.patch @@ -25,7 +25,7 @@ index 10b351d8bd6b0e117ecbe961ae2f101686a38fe4..35137db138d8d14f9b9675ae51e135cb @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 774997f11c8b50287c10e48c01278c4d995aae45..f4eb1594a1af0a50dfbf7dacb1b58e3903913aa3 100644 +index 774997f11c8b50287c10e48c01278c4d995aae45..8fc7014b457382277c91dc302417fdd1aea20580 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1260,7 +1260,11 @@ public final class CraftServer implements Server { @@ -35,7 +35,7 @@ index 774997f11c8b50287c10e48c01278c4d995aae45..f4eb1594a1af0a50dfbf7dacb1b58e39 - WorldOptions worldOptions = new WorldOptions(creator.seed(), creator.generateStructures(), creator.bonusChest()); + // Leaf start - Matter - Secure Seed + WorldOptions worldOptions = io.nanachiyo0721.shiroha.config.modules.function.SecureSeedConfig.enabled -+ ? new WorldOptions(creator.seed(), su.plo.matter.Globals.createRandomWorldSeed(), creator.generateStructures(), false) ++ ? new WorldOptions(creator.seed(), su.plo.matter.Globals.createRandomWorldSeed(), creator.generateStructures(), creator.bonusChest()) + : new WorldOptions(creator.seed(), creator.generateStructures(), creator.bonusChest()); + // Leaf end - Matter - Secure Seed