Paper/patches/server/0471-Entity-isTicking.patch

36 lines
1.5 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
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 bda94c9c34c7f1f6b56103de5be253c619b576b2..30c955cb8b1cb767e62964fea897870a88b4f310 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
2023-06-09 01:21:20 +02:00
@@ -4449,5 +4449,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
2021-06-11 14:02:28 +02:00
public static int nextEntityId() {
return ENTITY_COUNTER.incrementAndGet();
}
+
+ public boolean isTicking() {
2022-10-11 14:43:10 +02:00
+ return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
2021-06-11 14:02:28 +02:00
+ }
// 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 4002311a4f8a0b137f743a0a1ded52587719765b..702987ef563db2e0819771e8c3be822e4644ee3f 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1336,5 +1336,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
2021-06-11 14:02:28 +02:00
public boolean isInLava() {
return getHandle().isInLava();
}
+
2022-10-11 14:43:10 +02:00
+ @Override
2021-06-11 14:02:28 +02:00
+ public boolean isTicking() {
+ return getHandle().isTicking();
+ }
// Paper end
}