3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 11:00:06 +01:00
Paper/Spigot-Server-Patches/0576-Entity-isTicking.patch

35 Zeilen
1.5 KiB
Diff

2020-10-04 05:05:33 +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/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 9415588d7df27fb6907381cff802fd8ad983663f..1840d64d1bbb1165981f79dd3deeb19816e6a230 100644
2020-10-04 05:05:33 +02:00
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -3387,5 +3387,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
2020-10-04 05:05:33 +02:00
public static int nextEntityId() {
return entityCount.incrementAndGet();
}
+
+ public boolean isTicking() {
+ return ((ChunkProviderServer) world.getChunkProvider()).isInEntityTickingChunk(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 c519b46c94792082c62acc05cdbec0734776edf5..bb474fbdf44dbc61b4fa0bced4d15bc2d1fb548f 100644
2020-10-04 05:05:33 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1158,5 +1158,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
2020-10-04 05:05:33 +02:00
public boolean isInLava() {
return getHandle().isInLava();
}
+
+ public boolean isTicking() {
+ return getHandle().isTicking();
+ }
// Paper end
}