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 c78df4fc62a347455f8d7b3aa186344863915ab3..658e47bf5aff1e56462cc3f0a87eeb7349654176 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -4477,5 +4477,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 889b24adb50825a3c4bd83f10c3d253e5cf80a1a..3f2a8efc6ad9e6e2043bf96894c47e578c68e263 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1347,5 +1347,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 }