This commit is contained in:
Bjarne Koll 2024-10-21 01:46:12 +02:00 committed by Bjarne Koll
parent 8cc6b318b1
commit 8129c9c449
No known key found for this signature in database
GPG Key ID: 9576DAF3FDDB088F

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable Entity Despawn Time
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 4b54d0ea31062972e68ee8fafe3cfaf68f65a5cd..7a74e06f98dd17b055fa4697635395a8a9fc77ae 100644
index 4b54d0ea31062972e68ee8fafe3cfaf68f65a5cd..a95d2d2b933bce0c5810d386208d67b154f75a9d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -429,6 +429,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@ -30,7 +30,7 @@ index 4b54d0ea31062972e68ee8fafe3cfaf68f65a5cd..7a74e06f98dd17b055fa4697635395a8
public void tick() {
+ // Paper start - entity despawn time limit
+ if (this.despawnTime >= 0 && this.tickCount >= this.despawnTime) {
+ this.discard();
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN);
+ return;
+ }
+ // Paper end - entity despawn time limit