Fix bucket fish having CreatureSpawnEvent.SpawnReason.DEFAULT

Align with SPAWNER_EGG reason in previous versions
This commit is contained in:
md_5 2025-03-01 21:58:33 +11:00
parent 43f66f6cb7
commit 8f3da35f71
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -0,0 +1,22 @@
--- a/net/minecraft/world/item/MobBucketItem.java
+++ b/net/minecraft/world/item/MobBucketItem.java
@@ -26,6 +26,10 @@
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.material.FluidType;
+// CraftBukkit start
+import org.bukkit.event.entity.CreatureSpawnEvent;
+// CraftBukkit end
+
public class MobBucketItem extends ItemBucket {
private static final MapCodec<EntityTropicalFish.d> VARIANT_FIELD_CODEC = EntityTropicalFish.d.CODEC.fieldOf("BucketVariantTag");
@@ -63,7 +67,7 @@
}
if (entityinsentient != null) {
- worldserver.addFreshEntityWithPassengers(entityinsentient);
+ worldserver.addFreshEntityWithPassengers(entityinsentient, CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
entityinsentient.playAmbientSound();
}