Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
36 Zeilen
1.5 KiB
Diff
36 Zeilen
1.5 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 93a8ff684cf88ee7693ed308020d02cb18ded06f..13459fec2555049dccc9b0437d42fd28f823dc46 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -4449,5 +4449,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
public static int nextEntityId() {
|
|
return ENTITY_COUNTER.incrementAndGet();
|
|
}
|
|
+
|
|
+ public boolean isTicking() {
|
|
+ return ((net.minecraft.server.level.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 7fb674cea2953b10c26f1a2c3b3369ab7767324b..2b936e32a67c108df9a7f6b335357a25bad6d291 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
@@ -1343,5 +1343,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|
public boolean isInLava() {
|
|
return getHandle().isInLava();
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean isTicking() {
|
|
+ return getHandle().isTicking();
|
|
+ }
|
|
// Paper end
|
|
}
|