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
|
2024-05-17 23:37:16 +02:00
|
|
|
index 81ff696c34afffe6b1ee76347984b0d8cb5723e7..905d740814b7c911e8449fc53d6e5de7e77ecaf9 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
|
2024-05-17 23:37:16 +02:00
|
|
|
@@ -4450,5 +4450,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
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
|
|
|
+ }
|
2024-01-20 12:50:16 +01:00
|
|
|
// Paper end - Expose entity id counter
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
2024-04-24 15:46:45 +02:00
|
|
|
index 3da47cf8968c1917e2f216a410eece51a693dfb2..2080733ebae1af51b7b4d3cd2fbd1a4a2703a920 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
|
2024-04-24 15:46:45 +02:00
|
|
|
@@ -1045,4 +1045,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
2021-06-11 14:02:28 +02:00
|
|
|
return getHandle().isInLava();
|
|
|
|
}
|
2024-04-06 22:38:37 +02:00
|
|
|
// Paper end - entity liquid API
|
2021-06-11 14:02:28 +02:00
|
|
|
+
|
2024-04-06 22:38:37 +02:00
|
|
|
+ // Paper start - isTicking API
|
2022-10-11 14:43:10 +02:00
|
|
|
+ @Override
|
2021-06-11 14:02:28 +02:00
|
|
|
+ public boolean isTicking() {
|
|
|
|
+ return getHandle().isTicking();
|
|
|
|
+ }
|
2024-04-06 22:38:37 +02:00
|
|
|
+ // Paper end - isTicking API
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|