3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00

Fix ThrownEggHatchEvent#setHatching (#9448)

Dieser Commit ist enthalten in:
Lulu13022002 2023-07-05 09:46:12 +02:00 committet von GitHub
Ursprung c0936a71bd
Commit 12c970097d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -7,17 +7,18 @@ Adds a new event similar to PlayerEggThrowEvent, but without the Player requirem
(dispensers can throw eggs to hatch them, too).
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
index 88e8ce770ddc61702fc87cd8dcee498183dc1032..4aca131fe774c54b5cc274000d825687a1373b3f 100644
index 88e8ce770ddc61702fc87cd8dcee498183dc1032..588e5ac6fc9b2d12be3bb80bc3fe50d81470c441 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
@@ -82,6 +82,12 @@ public class ThrownEgg extends ThrowableItemProjectile {
@@ -82,6 +82,13 @@ public class ThrownEgg extends ThrowableItemProjectile {
}
}
// CraftBukkit end
+ // Paper start
+ com.destroystokyo.paper.event.entity.ThrownEggHatchEvent event = new com.destroystokyo.paper.event.entity.ThrownEggHatchEvent((org.bukkit.entity.Egg) getBukkitEntity(), hatching, b0, hatchingType);
+ event.callEvent();
+ b0 = event.getNumHatches();
+ hatching = event.isHatching();
+ b0 = hatching ? event.getNumHatches() : 0; // If hatching is set to false, ensure child count is 0
+ hatchingType = event.getHatchingType();
+ // Paper end