Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lemonzy <[email protected]>
Date: Wed, 28 May 2025 01:01:10 +0200
Subject: [PATCH] Retain owner after hit when owner is disconnected

Previously, due to a fix in Paper, projectiles would lose their owner when they hit an entity while the owner was disconnected from the server. This behavior caused issues with certain redstone contraptions relying on the projectile's owner.

diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
index 0a1cee73ee7d895dba55745647daa4870038515c..04e28b213561cdd3410329545d0152f0c36c4195 100644
--- a/net/minecraft/world/entity/projectile/Projectile.java
+++ b/net/minecraft/world/entity/projectile/Projectile.java
@@ -59,7 +59,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
this.cachedOwner = owner;
}
// Paper start - Refresh ProjectileSource for projectiles
- else {
+ else if (!this.level().purpurConfig.retainProjectileOwnerOnHitIfOwnerOffline) { // Purpur - Due to a fix in Paper, projectiles lose their owner when they hit an entity while the owner is disconnected from the server. This can render certain redstone contraptions unusable. This behavior can be adjusted via the 'retainProjectileOwnerOnHitIfOwnerOffline' configuration option.
this.ownerUUID = null;
this.cachedOwner = null;
this.projectileSource = null;
Original file line number Diff line number Diff line change
Expand Up @@ -3593,4 +3593,9 @@ private void shearsCanDefuseTntSettings() {
shearsCanDefuseTntChance = (float) getDouble("gameplay-mechanics.item.shears.defuse-tnt-chance", 0.00D);
shearsCanDefuseTnt = shearsCanDefuseTntChance > 0.00F;
}

public boolean retainProjectileOwnerOnHitIfOwnerOffline = false;
private void retainProjectileOwnerOnHitIfOwnerOffline() {
retainProjectileOwnerOnHitIfOwnerOffline = getBoolean("gameplay-mechanics.retain-projectile-owner-on-hit-if-owner-offline", true);
}
}