From 290f78994a0c15f69b0d719a9d005ef2e1c51b9e Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Mon, 20 Jan 2025 05:09:33 -0800 Subject: [PATCH] Do not invoke ender pearl registration logic The owner of the projectile would need to be retrieved, which may trip a thread check. We do not track ender pearls anyways, so the registration logic does nothing regardless. Fixes https://github.com/PaperMC/Folia/issues/315 --- .../projectile/ThrownEnderpearl.java.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/folia-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch b/folia-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch index 4ece4e7..5aa7059 100644 --- a/folia-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch +++ b/folia-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch @@ -1,5 +1,23 @@ --- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java +++ b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java +@@ -58,15 +_,11 @@ + } + + private void deregisterFromCurrentOwner() { +- if (this.getOwner() instanceof ServerPlayer serverPlayer) { +- serverPlayer.deregisterEnderPearl(this); +- } ++ // Folia - region threading - we remove the registration logic, we do not need to fetch the owner + } + + private void registerToCurrentOwner() { +- if (this.getOwner() instanceof ServerPlayer serverPlayer) { +- serverPlayer.registerEnderPearl(this); +- } ++ // Folia - region threading - we remove the registration logic, we do not need to fetch the owner + } + + @Nullable @@ -99,6 +_,81 @@ result.getEntity().hurt(this.damageSources().thrown(this, this.getOwner()), 0.0F); }