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
|
2021-12-22 19:02:31 +01:00
|
|
|
index a6cc8d8691f314fe7d5499f525a45b1c2e7f31e5..de984785361221dffece2a86c859ccf95a8b4af8 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
|
2021-11-25 10:19:05 +01:00
|
|
|
@@ -53,6 +53,7 @@ import net.minecraft.resources.ResourceKey;
|
2021-06-14 16:41:34 +02:00
|
|
|
import net.minecraft.resources.ResourceLocation;
|
2021-11-25 10:19:05 +01:00
|
|
|
import net.minecraft.server.MCUtil;
|
2021-06-11 14:02:28 +02: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;
|
2021-12-03 22:28:15 +01:00
|
|
|
@@ -3976,5 +3977,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
2021-06-11 14:02:28 +02:00
|
|
|
public static int nextEntityId() {
|
|
|
|
return ENTITY_COUNTER.incrementAndGet();
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean isTicking() {
|
2021-06-14 17:17:08 +02:00
|
|
|
+ return ((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
|
2022-01-01 04:05:42 +01:00
|
|
|
index d0ad0e6bbb944a33fd67a7d3e36958407a774ede..c2d92e0eb65b2a70fcae12b09e5a105cc820894f 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
|
2022-01-01 04:05:42 +01:00
|
|
|
@@ -1260,5 +1260,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
2021-06-11 14:02:28 +02:00
|
|
|
public boolean isInLava() {
|
|
|
|
return getHandle().isInLava();
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean isTicking() {
|
|
|
|
+ return getHandle().isTicking();
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
}
|