2021-06-11 12:02:28 +00: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
|
2022-03-30 20:28:38 +00:00
|
|
|
index d470f7cbd953af86c57ee83d5f9b149abd270b05..1de52b5e6a7fde4acaf6942edad163ed94d9e0a7 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2022-03-01 05:43:03 +00:00
|
|
|
@@ -56,6 +56,7 @@ import net.minecraft.resources.ResourceKey;
|
2021-06-14 14:41:34 +00:00
|
|
|
import net.minecraft.resources.ResourceLocation;
|
2021-11-25 09:19:05 +00:00
|
|
|
import net.minecraft.server.MCUtil;
|
2021-06-11 12:02:28 +00:00
|
|
|
import net.minecraft.server.MinecraftServer;
|
|
|
|
+import net.minecraft.server.level.ServerChunkCache;
|
|
|
|
import net.minecraft.server.level.ServerLevel;
|
|
|
|
import net.minecraft.server.level.ServerPlayer;
|
|
|
|
import net.minecraft.server.level.TicketType;
|
2022-03-30 20:28:38 +00:00
|
|
|
@@ -3998,5 +3999,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
2021-06-11 12:02:28 +00:00
|
|
|
public static int nextEntityId() {
|
|
|
|
return ENTITY_COUNTER.incrementAndGet();
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean isTicking() {
|
2021-06-14 15:17:08 +00:00
|
|
|
+ return ((ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
|
2021-06-11 12:02:28 +00: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
|
2022-03-01 03:25:13 +00:00
|
|
|
index 8ec7cd4ea41c28c1f730df649b7cf73d57d60b55..c63301472922dceb2873553bb4b0c350b37a23c3 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
2022-02-12 13:20:33 +00:00
|
|
|
@@ -1267,5 +1267,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
2021-06-11 12:02:28 +00:00
|
|
|
public boolean isInLava() {
|
|
|
|
return getHandle().isInLava();
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean isTicking() {
|
|
|
|
+ return getHandle().isTicking();
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
}
|