testserver/patches/unapplied/server/0501-Entity-isTicking.patch

43 lines
1.9 KiB
Diff
Raw Normal View History

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
index c2a17211cc216b9cf83ff393bf69ef49a3e778e8..c5cd18b02e5956fef6779b0b89d33b515bc9d13a 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
@@ -59,6 +59,7 @@ import net.minecraft.resources.ResourceKey;
2021-06-14 14:41:34 +00:00
import net.minecraft.resources.ResourceLocation;
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;
@@ -4082,5 +4083,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
index 148cd01c88600042c557f21558acace8bfdfa1cf..c39b683cbe83618daee0ca00d1107b115af6bf8f 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-06-08 06:06:17 +00:00
@@ -1278,5 +1278,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
}