mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 04:31:58 +01:00
42 lines
1.9 KiB
Diff
42 lines
1.9 KiB
Diff
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 2eb56ba2ecf49754e3b6229a798f837a4aa099da..2c68dbfc38e9d9b7bb6cecb790d4d72fc2015a7f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -53,6 +53,7 @@ import net.minecraft.resources.ResourceKey;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
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;
|
|
@@ -3991,5 +3992,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
|
public static int nextEntityId() {
|
|
return ENTITY_COUNTER.incrementAndGet();
|
|
}
|
|
+
|
|
+ public boolean isTicking() {
|
|
+ return ((ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
|
|
+ }
|
|
// 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 d0ad0e6bbb944a33fd67a7d3e36958407a774ede..c2d92e0eb65b2a70fcae12b09e5a105cc820894f 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
@@ -1260,5 +1260,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|
public boolean isInLava() {
|
|
return getHandle().isInLava();
|
|
}
|
|
+
|
|
+ public boolean isTicking() {
|
|
+ return getHandle().isTicking();
|
|
+ }
|
|
// Paper end
|
|
}
|