Skip to content

Commit

Permalink
Do not invoke ender pearl registration logic
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Spottedleaf committed Jan 20, 2025
1 parent 35b9863 commit 290f789
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}
Expand Down

0 comments on commit 290f789

Please sign in to comment.