2016-04-22 22:01:28 +00:00
From 28d8d3671fcdb920d2db55fb577165fa4744485b 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
2016-03-31 03:55:46 +00:00
index 03dd637..26c1b72 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
2016-03-31 03:55:46 +00:00
@@ -282,4 +282,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
2016-03-31 00:50:23 +00:00
index 7a4f56d..a073e6c 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
@@ -144,7 +144,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
if (block == this.au && i == this.av) {
++this.aw;
- if (this.aw >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter
+ if (this.aw >= (fromPlayer != PickupStatus.DISALLOWED ? world.spigotConfig.arrowDespawnRate : world.paperConfig.nonPlayerArrowDespawnRate)) { // Spigot - First int after shooter
this.die();
}
} else {
--
2016-04-02 02:08:40 +00:00
2.8.0
2016-03-18 19:13:03 +00:00