From 493852bbd153ed36b6dd6c50d8a41f8293a0c2d1 Mon Sep 17 00:00:00 2001
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Date: Wed, 5 Jul 2023 09:46:12 +0200
Subject: [PATCH] Fix ThrownEggHatchEvent#setHatching (#9448)

---
 patches/server/Add-ThrownEggHatchEvent.patch | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/patches/server/Add-ThrownEggHatchEvent.patch b/patches/server/Add-ThrownEggHatchEvent.patch
index db2f39695c..ae364ab44c 100644
--- a/patches/server/Add-ThrownEggHatchEvent.patch
+++ b/patches/server/Add-ThrownEggHatchEvent.patch
@@ -17,7 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +                // 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