#1429: Add CreatureSpawnEvent.SpawnReason#TRIAL_SPAWNER

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot 2024-06-19 19:18:47 +10:00
parent 85ae59a767
commit be0055d2a0

View file

@ -0,0 +1,18 @@
--- a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
+++ b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
@@ -219,13 +219,13 @@
}
entityinsentient.setPersistenceRequired();
- Optional optional1 = mobspawnerdata.getEquipment();
+ Optional<net.minecraft.world.entity.EquipmentTable> optional1 = mobspawnerdata.getEquipment(); // CraftBukkit - decompile error
Objects.requireNonNull(entityinsentient);
optional1.ifPresent(entityinsentient::equip);
}
- if (!worldserver.tryAddFreshEntityWithPassengers(entity)) {
+ if (!worldserver.tryAddFreshEntityWithPassengers(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.TRIAL_SPAWNER)) { // CraftBukkit
return Optional.empty();
} else {
TrialSpawner.a trialspawner_a = this.isOminous ? TrialSpawner.a.OMINOUS : TrialSpawner.a.NORMAL;