PaperMC/patches/server/0487-Entity-isTicking.patch
2022-10-11 14:43:10 +02:00

35 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 3 Oct 2020 21:39:16 -0500
Subject: [PATCH] Entity#isTicking
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 23ec6c64579b1e682ec30ea6d4ec196ddb9ed403..37eb939935dc5fbaa22f89f1784bd69c0c37cfcf 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4167,5 +4167,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public static int nextEntityId() {
return ENTITY_COUNTER.incrementAndGet();
}
+
+ public boolean isTicking() {
+ return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
+ }
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 52ccc5cb9c5512b30ce863062de85219adb801ae..0988da3d82b9f13d36ccb73f282d36bf6d1f0284 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1306,5 +1306,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public boolean isInLava() {
return getHandle().isInLava();
}
+
+ @Override
+ public boolean isTicking() {
+ return getHandle().isTicking();
+ }
// Paper end
}