Paper/CraftBukkit-Patches/0054-Item-Despawn-Rate.patch

39 lines
1.6 KiB
Diff
Raw Normal View History

2014-03-10 06:14:45 +08:00
From e5bbed4570854ea51ac8d114fe16320e314ebeee Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 22 Sep 2013 19:10:53 +1000
Subject: [PATCH] Item Despawn Rate
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
2013-12-01 11:40:53 +08:00
index 08b9ac8..8ea7abc 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
2013-12-01 11:40:53 +08:00
@@ -104,7 +104,7 @@ public class EntityItem extends Entity {
}
2013-12-01 11:40:53 +08:00
// ++this.age; // CraftBukkit - Moved up
- if (!this.world.isStatic && this.age >= 6000) {
+ if (!this.world.isStatic && this.age >= world.spigotConfig.itemDespawnRate) { // Spigot
// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
this.age = 0;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
2014-03-10 05:37:28 +08:00
index 9586c44..82d59e7 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -196,4 +196,11 @@ public class SpigotWorldConfig
log( "*** WARNING *** Please use this option with caution, SpigotMC is not responsible for any issues this option may cause in the future!" );
}
}
+
+ public int itemDespawnRate;
+ private void itemDespawnRate()
+ {
+ itemDespawnRate = getInt( "item-despawn-rate", 6000 );
+ log( "Item Despawn Rate: " + itemDespawnRate );
+ }
}
--
2013-12-01 11:40:53 +08:00
1.8.3.2