PaperSpigot-Parent/CraftBukkit-Patches/0076-Arrow-Despawn-Rate.patch

39 lines
1.4 KiB
Diff
Raw Normal View History

2013-10-16 10:38:15 +02:00
From f994c1f9c7f866dbc9defa92651248d01c324d8f Mon Sep 17 00:00:00 2001
2013-10-14 10:20:28 +02:00
From: md_5 <md_5@live.com.au>
Date: Mon, 14 Oct 2013 19:20:10 +1100
Subject: [PATCH] Arrow Despawn Rate
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index b1d3de8..75fe81b 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -142,7 +142,7 @@ public class EntityArrow extends Entity implements IProjectile {
if (j == this.g && k == this.h) {
++this.j;
- if (this.j == 1200) {
+ if (this.j == world.spigotConfig.arrowDespawnRate) { // Spigot
this.die();
}
} else {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 4631165..300db67 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -226,4 +226,11 @@ public class SpigotWorldConfig
itemDespawnRate = getInt( "item-despawn-rate", 6000 );
log( "Item Despawn Rate: " + itemDespawnRate );
}
+
+ public int arrowDespawnRate;
+ private void arrowDespawnRate()
+ {
+ arrowDespawnRate = getInt( "arrow-despawn-rate", 1200 );
+ log( "Arrow Despawn Rate: " + arrowDespawnRate );
+ }
}
--
1.8.1.2