mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
38 lines
2.1 KiB
Diff
38 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Wed, 4 Nov 2020 13:12:50 -0600
|
|
Subject: [PATCH] Arrows should not reset despawn counter
|
|
|
|
This prevents keeping arrows alive indefinitely (such as when the block
|
|
the arrow is stuck in gets removed, like a piston head going up/down)
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
index 7226be19248a1ffb8ff2c89b55882529d33a6c0c..4f98d7f755ad692dd9589134524a604ec747d5d9 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
@@ -312,7 +312,7 @@ public abstract class AbstractArrow extends Projectile {
|
|
Vec3 vec3d = this.getDeltaMovement();
|
|
|
|
this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F)));
|
|
- this.life = 0;
|
|
+ if (this.level().purpurConfig.arrowMovementResetsDespawnCounter) this.life = 0; // Purpur - do not reset despawn counter
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index ef6fe57cce6c6ef6c6820ab2bd676fbe4b30370e..d1d51f147c91cb99ff3dc03c5e461cf6acf529d4 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -103,6 +103,11 @@ public class PurpurWorldConfig {
|
|
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
|
}
|
|
|
|
+ public boolean arrowMovementResetsDespawnCounter = true;
|
|
+ private void arrowSettings() {
|
|
+ arrowMovementResetsDespawnCounter = getBoolean("gameplay-mechanics.arrow.movement-resets-despawn-counter", arrowMovementResetsDespawnCounter);
|
|
+ }
|
|
+
|
|
public boolean useBetterMending = false;
|
|
public boolean boatEjectPlayersOnLand = false;
|
|
public boolean disableDropsOnCrammingDeath = false;
|