PaperMC/paper-server/nms-patches/net/minecraft/world/item/ItemMonsterEgg.patch
CraftBukkit/Spigot 9d740b84b0 Update to Minecraft 1.20
By: md_5 <git@md-5.net>
2023-06-08 01:30:00 +10:00

20 lines
1,001 B
Diff

--- a/net/minecraft/world/item/ItemMonsterEgg.java
+++ b/net/minecraft/world/item/ItemMonsterEgg.java
@@ -185,7 +185,7 @@
return Optional.empty();
} else {
((EntityInsentient) object).moveTo(vec3d.x(), vec3d.y(), vec3d.z(), 0.0F, 0.0F);
- worldserver.addFreshEntityWithPassengers((Entity) object);
+ worldserver.addFreshEntityWithPassengers((Entity) object, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
if (itemstack.hasCustomHoverName()) {
((EntityInsentient) object).setCustomName(itemstack.getHoverName());
}
@@ -194,7 +194,7 @@
itemstack.shrink(1);
}
- return Optional.of(object);
+ return Optional.of((EntityInsentient) object); // CraftBukkit - decompile error
}
}
}