Fix bugs in 0013 and 0034
Shiroha CI / build (push) Canceled after 0s
Shiroha CI / Event File (push) Canceled after 0s

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
This commit is contained in:
2026-08-14 21:15:47 +08:00
parent dfe2c124e6
commit 6806b9d002
2 changed files with 4 additions and 4 deletions
@@ -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()),