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
This commit is contained in:
Spottedleaf 2025-01-20 05:09:33 -08:00
parent 35b98633ba
commit 290f78994a

View File

@ -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);
}