2018-07-24 00:24:44 +00:00
|
|
|
From e6a1c83e22ebf7b1ccff924966d57c88588796ae Mon Sep 17 00:00:00 2001
|
2016-03-18 19:13:03 +00:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Fri, 18 Mar 2016 15:12:22 -0400
|
|
|
|
Subject: [PATCH] Configurable Non Player Arrow Despawn Rate
|
|
|
|
|
|
|
|
Can set a much shorter despawn rate for arrows that players can not pick up.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-07-24 00:24:44 +00:00
|
|
|
index 6f96627a2..0de300739 100644
|
2016-03-18 19:13:03 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-07-24 00:24:44 +00:00
|
|
|
@@ -203,4 +203,13 @@ public class PaperWorldConfig {
|
2016-03-18 19:13:03 +00:00
|
|
|
private void allowLeashingUndeadHorse() {
|
|
|
|
allowLeashingUndeadHorse = getBoolean("allow-leashing-undead-horse", false);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public int nonPlayerArrowDespawnRate = -1;
|
|
|
|
+ private void nonPlayerArrowDespawnRate() {
|
|
|
|
+ nonPlayerArrowDespawnRate = getInt("non-player-arrow-despawn-rate", -1);
|
|
|
|
+ if (nonPlayerArrowDespawnRate == -1) {
|
|
|
|
+ nonPlayerArrowDespawnRate = spigotConfig.arrowDespawnRate;
|
|
|
|
+ }
|
|
|
|
+ log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
|
2018-07-15 01:53:17 +00:00
|
|
|
index e16c8e8d9..75445b00d 100644
|
2016-03-18 19:13:03 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArrow.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
|
2018-07-15 01:53:17 +00:00
|
|
|
@@ -258,7 +258,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
|
|
|
|
|
|
|
protected void f() {
|
|
|
|
++this.despawnCounter;
|
|
|
|
- if (this.despawnCounter >= world.spigotConfig.arrowDespawnRate) { // Spigot
|
|
|
|
+ if (this.despawnCounter >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot // Paper
|
|
|
|
this.die();
|
|
|
|
}
|
|
|
|
|
2016-03-18 19:13:03 +00:00
|
|
|
--
|
2018-07-04 07:55:24 +00:00
|
|
|
2.18.0
|
2016-03-18 19:13:03 +00:00
|
|
|
|