3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/patches/server/0486-Entity-isTicking.patch

36 Zeilen
1.5 KiB
Diff

2021-06-11 14:02:28 +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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
2022-11-03 22:03:31 +01:00
index c99798ea88f7f6dd6db6c80666171e759bf47cc0..9b1ee67e9963f31c107f5bc310f6840d58906477 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
2022-10-11 14:43:10 +02:00
@@ -4167,5 +4167,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
2021-06-11 14:02:28 +02:00
public static int nextEntityId() {
return ENTITY_COUNTER.incrementAndGet();
}
+
+ public boolean isTicking() {
2022-10-11 14:43:10 +02:00
+ return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
2021-06-11 14:02:28 +02: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
2022-10-11 14:43:10 +02:00
index 52ccc5cb9c5512b30ce863062de85219adb801ae..0988da3d82b9f13d36ccb73f282d36bf6d1f0284 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
2022-10-11 14:43:10 +02:00
@@ -1306,5 +1306,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
2021-06-11 14:02:28 +02:00
public boolean isInLava() {
return getHandle().isInLava();
}
+
2022-10-11 14:43:10 +02:00
+ @Override
2021-06-11 14:02:28 +02:00
+ public boolean isTicking() {
+ return getHandle().isTicking();
+ }
// Paper end
}