mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Entity#isTicking (#4612)
This commit is contained in:
parent
5cd73bbd5a
commit
331d1ed71c
2 changed files with 55 additions and 0 deletions
21
Spigot-API-Patches/Entity-isTicking.patch
Normal file
21
Spigot-API-Patches/Entity-isTicking.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 3 Oct 2020 21:39:07 -0500
|
||||
Subject: [PATCH] Entity#isTicking
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
* Check if entity is in lava
|
||||
*/
|
||||
public boolean isInLava();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if entity is inside a ticking chunk
|
||||
+ */
|
||||
+ public boolean isTicking();
|
||||
// Paper end
|
||||
}
|
34
Spigot-Server-Patches/Entity-isTicking.patch
Normal file
34
Spigot-Server-Patches/Entity-isTicking.patch
Normal file
|
@ -0,0 +1,34 @@
|
|||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
public boolean isInLava() {
|
||||
return getHandle().isInLava();
|
||||
}
|
||||
+
|
||||
+ public boolean isTicking() {
|
||||
+ return getHandle().isTicking();
|
||||
+ }
|
||||
// Paper end
|
||||
}
|
Loading…
Reference in a new issue