2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
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/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
2022-12-07 19:52:24 +01:00
|
|
|
index eff6a93af46476f173f13fc35ca6c8cec7de37c9..cfd202d32048abcd3e961d9f7f08c1bc6282e601 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
2022-12-07 19:52:24 +01:00
|
|
|
@@ -312,7 +312,7 @@ public abstract class AbstractArrow extends Projectile {
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
protected void tickDespawn() {
|
|
|
|
++this.life;
|
|
|
|
- if (this.life >= ((this instanceof ThrownTrident) ? level.spigotConfig.tridentDespawnRate : level.spigotConfig.arrowDespawnRate)) { // Spigot
|
2022-06-09 10:51:45 +02:00
|
|
|
+ if (this.life >= (pickup == Pickup.CREATIVE_ONLY ? level.paperConfig().entities.spawning.creativeArrowDespawnRate.value() : (pickup == Pickup.DISALLOWED ? level.paperConfig().entities.spawning.nonPlayerArrowDespawnRate.value() : ((this instanceof ThrownTrident) ? level.spigotConfig.tridentDespawnRate : level.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init?
|
2021-06-12 02:57:04 +02:00
|
|
|
this.discard();
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|