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-07-09 03:18:32 +02:00
|
|
|
index 14edbf6b2dc7697f9b703aa83d8529dd8ffe73a8..477b6102361f0ae03541402578e1d053572e52d3 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-06-14 16:41:34 +02:00
|
|
|
@@ -52,6 +52,7 @@ import net.minecraft.resources.ResourceKey;
|
|
|
|
import net.minecraft.resources.ResourceLocation;
|
2021-06-11 14:02:28 +02:00
|
|
|
import net.minecraft.server.MCUtil;
|
|
|
|
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-07-09 03:18:32 +02:00
|
|
|
@@ -3937,5 +3938,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
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
|
2021-07-11 09:01:29 +02:00
|
|
|
index 291b59eb9859ebd4e69fef0b54ea911effadf13f..3acb5f8a1f863b5ba47eac4190be8228324fc8e7 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
|
2021-07-11 09:01:29 +02:00
|
|
|
@@ -1220,5 +1220,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
|
|
|
|
}
|