mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
47 lines
1.8 KiB
Diff
47 lines
1.8 KiB
Diff
From 3ff965a35c8175154ef2a19bb370ab5f69a4dccd 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
|
|
index cc831fca8..2dcdcc30b 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityItem.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityItem.java
|
|
@@ -124,7 +124,7 @@ public class EntityItem extends Entity {
|
|
}
|
|
}
|
|
|
|
- if (!this.world.isClientSide && this.age >= 6000) {
|
|
+ if (!this.world.isClientSide && this.age >= world.spigotConfig.itemDespawnRate) { // Spigot
|
|
// CraftBukkit start - fire ItemDespawnEvent
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
|
|
this.age = 0;
|
|
@@ -415,7 +415,7 @@ public class EntityItem extends Entity {
|
|
|
|
public void u() {
|
|
this.p();
|
|
- this.age = 5999;
|
|
+ this.age = world.spigotConfig.itemDespawnRate - 1; // Spigot
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
index 18d8fd3aa..e05cf1d4b 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
@@ -161,4 +161,11 @@ public class SpigotWorldConfig
|
|
mobSpawnRange = (byte) getInt( "mob-spawn-range", 6 );
|
|
log( "Mob Spawn Range: " + mobSpawnRange );
|
|
}
|
|
+
|
|
+ public int itemDespawnRate;
|
|
+ private void itemDespawnRate()
|
|
+ {
|
|
+ itemDespawnRate = getInt( "item-despawn-rate", 6000 );
|
|
+ log( "Item Despawn Rate: " + itemDespawnRate );
|
|
+ }
|
|
}
|
|
--
|
|
2.20.1
|
|
|