Skip to content

Commit 290f789

Browse files
committed
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 #315
1 parent 35b9863 commit 290f789

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

folia-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
--- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
22
+++ b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
3+
@@ -58,15 +_,11 @@
4+
}
5+
6+
private void deregisterFromCurrentOwner() {
7+
- if (this.getOwner() instanceof ServerPlayer serverPlayer) {
8+
- serverPlayer.deregisterEnderPearl(this);
9+
- }
10+
+ // Folia - region threading - we remove the registration logic, we do not need to fetch the owner
11+
}
12+
13+
private void registerToCurrentOwner() {
14+
- if (this.getOwner() instanceof ServerPlayer serverPlayer) {
15+
- serverPlayer.registerEnderPearl(this);
16+
- }
17+
+ // Folia - region threading - we remove the registration logic, we do not need to fetch the owner
18+
}
19+
20+
@Nullable
321
@@ -99,6 +_,81 @@
422
result.getEntity().hurt(this.damageSources().thrown(this, this.getOwner()), 0.0F);
523
}

0 commit comments

Comments
 (0)