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

36 Zeilen
1.5 KiB
Diff

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 71dc4112cb932c6b1305f0f22e99f069517cac08..cfdc8c37d41473300ca9a8c251e27cb2a07ca4c7 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
@@ -4444,5 +4444,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 2c4704fb85f29a02b7245d36e8e4383534c701f9..cacefccf15d68759ec26548ac1c10ee97e251ac4 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
@@ -1363,5 +1363,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
}