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 9b723b5c429fcb356cc056dc56e1c7be1d20a728..bf7d307c26c52035f3799ca80dccc8e8798d8f89 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -4515,5 +4515,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } + + public boolean isTicking() { + return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this); + } // 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 d5e8c8ed7528cdac203a7594ccf9576db0e5f019..6e302dff4c0b48694d234091b1637ff3b7b4b098 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1058,5 +1058,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 }