Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
ef0e5a642d
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 9ae3f10f SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API 48c0c547 PR-786: Add methods to get sounds from entities CraftBukkit Changes: 5cc9c022a SPIGOT-7152: Handle hand item changing during air interact event 4ffa1acf6 SPIGOT-7154: Players get kicked when interacting with a conversation 4daa21123 SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API e5d6a9bbf PR-1100: Add methods to get sounds from entities b7e9f1c8b SPIGOT-7146: Reduce use of Material switch in ItemMeta Spigot Changes: 4c157bb4 Rebuild patches
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 71c674d7b8dfdd401f163cc707f2c9746da30c65..902531525c213bd39aaac138f30ee1fc3e7c24a7 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -59,6 +59,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;
|
|
@@ -4093,5 +4094,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
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 40e6cd06f6b0cab2718c165cb38e772e90795917..142e6be6a41500b6e3b49173b7432e63de7ad3da 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
@@ -1295,5 +1295,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|
public boolean isInLava() {
|
|
return getHandle().isInLava();
|
|
}
|
|
+
|
|
+ public boolean isTicking() {
|
|
+ return getHandle().isTicking();
|
|
+ }
|
|
// Paper end
|
|
}
|