aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0433-Entity-isTicking.patch
blob: 205f3da8d50431dc9c8e85545e66e87104d4dce0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 44610d4e3fb69e6cf5629d9e895e93d8dd5e09e9..2c0c41ae455ae5894e6bd85830741143c3d8aaa5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4416,5 +4416,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 c8033bde8976c128da832befe4225238737a992a..103e8707ae9434c8e60059f75dafdd9e0fcc8b39 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1059,5 +1059,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
 }