Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
43 Zeilen
1.9 KiB
Diff
43 Zeilen
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 dd22f619ace097c5d6ee63ef869d564df0569b5e..51711841c072e0ac59922a45271298d2930e3581 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -56,6 +56,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;
|
|
@@ -4018,5 +4019,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 27c48e853ee93ab8eeb27560666fafc1057585be..ff890a42f1d67e197f4aac5d76a18527bae5b79d 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
@@ -1267,5 +1267,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|
public boolean isInLava() {
|
|
return getHandle().isInLava();
|
|
}
|
|
+
|
|
+ public boolean isTicking() {
|
|
+ return getHandle().isTicking();
|
|
+ }
|
|
// Paper end
|
|
}
|