2016-05-17 04:07:12 +02:00
From 7330300f4ce381a1f67de5cc44b9f0a6a94e67ca Mon Sep 17 00:00:00 2001
2016-03-18 20:13:03 +01: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
2016-05-17 04:07:12 +02:00
index 57e1fcf..3f8a47b 100644
2016-03-18 20:13:03 +01:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2016-05-17 04:07:12 +02:00
@@ -279,4 +279,13 @@ public class PaperWorldConfig {
2016-03-18 20:13:03 +01: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
2016-05-12 04:07:46 +02:00
index 29b6f16..c2ee9ce 100644
2016-03-18 20:13:03 +01:00
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
2016-05-12 04:07:46 +02:00
@@ -145,7 +145,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
2016-03-18 20:13:03 +01:00
2016-05-12 04:07:46 +02:00
if (block == this.av && i == this.aw) {
++this.ax;
- if (this.ax >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter
+ if (this.ax >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot - First int after shooter // Paper
2016-03-18 20:13:03 +01:00
this.die();
}
} else {
--
2016-05-12 04:07:46 +02:00
2.8.2
2016-03-18 20:13:03 +01:00