Skip to content

Commit 6529990

Browse files
committed
Immediately set chicken position for thrown egg
Fixes thread check failing when updating the chicken to a baby.
1 parent 77316d4 commit 6529990

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

folia-server/minecraft-patches/features/0001-Region-Threading-Base.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16226,6 +16226,25 @@ index 5104636be1de4bf1dc491673cad55854a106da53..a51bf62b9c72cf0092adafbdbfed06c1
1622616226
this.handleFirstTickBubbleColumn();
1622716227
this.applyGravity();
1622816228
this.applyInertia();
16229+
diff --git a/net/minecraft/world/entity/projectile/ThrownEgg.java b/net/minecraft/world/entity/projectile/ThrownEgg.java
16230+
index 73ec34b43f3fb2aa3edc3f1cb48a923d1fa32036..07dd05ceb9700e91088326290d211d94c1c2a6a6 100644
16231+
--- a/net/minecraft/world/entity/projectile/ThrownEgg.java
16232+
+++ b/net/minecraft/world/entity/projectile/ThrownEgg.java
16233+
@@ -97,12 +97,13 @@ public class ThrownEgg extends ThrowableItemProjectile {
16234+
for (int i1 = 0; i1 < i; i1++) {
16235+
net.minecraft.world.entity.Entity chicken = newEntityType.create(this.level(), net.minecraft.world.entity.EntitySpawnReason.TRIGGERED); // CraftBukkit
16236+
if (chicken != null) {
16237+
+ chicken.snapTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F); // Folia - region threading - moved up
16238+
// CraftBukkit start
16239+
if (chicken.getBukkitEntity() instanceof org.bukkit.entity.Ageable ageable) {
16240+
ageable.setBaby();
16241+
}
16242+
// CraftBukkit end
16243+
- chicken.snapTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F);
16244+
+ // Folia - region threading - move up
16245+
// CraftBukkit start
16246+
if (chicken instanceof Chicken realChicken) {
16247+
Optional.ofNullable(this.getItem().get(DataComponents.CHICKEN_VARIANT))
1622916248
diff --git a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
1623016249
index bda858b1e1c6b28cd9d5a664758b3e445eaf4f22..b28f74e1ef7e869f23ce2110b0494de360713e64 100644
1623116250
--- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java

0 commit comments

Comments
 (0)