From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath 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 56e4a5316e873c0a6fc3495bbfba6dc503cc9c9c..7609a58979388cb62be7ae94a51cc14774464214 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -4765,5 +4765,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } + + public boolean isTicking() { + return ((net.minecraft.server.level.ServerLevel) this.level).isPositionEntityTicking(this.blockPosition()); + } // Paper end - Expose entity id counter } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 609c768ba4d22e346acbc9422ce41e3b887fadb1..dbb1a52b1e5871bbb1ccbd300b8edb9aa0f56e49 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1058,4 +1058,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return getHandle().isInLava(); } // Paper end - entity liquid API + + // Paper start - isTicking API + @Override + public boolean isTicking() { + return getHandle().isTicking(); + } + // Paper end - isTicking API }