Paper/patches/server/0213-Implement-World.getEntity-UUID-API.patch
Nassim Jahnke 18f0f8d1ca
Updated Upstream (Bukkit/CraftBukkit/Spigot)
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:
312281ea PR-742: Make World implement Keyed

CraftBukkit Changes:
2ac7fa7a SPIGOT-7014: getLootTable API should not persistently update loot table
7fdd7941 PR-1046: Make World implement Keyed
7bc728a6 PR-1045: Revert changes to persistence required checks

Spigot Changes:
b6d12d17 Rebuild patches
2022-05-09 11:03:07 +02:00

27 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 3 Jul 2018 16:08:14 +0200
Subject: [PATCH] Implement World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 567a1f957d668c509efae001242b1808a3a488b2..264bc6a4765109a16cea6413abe9bf9185b7c041 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1040,6 +1040,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return list;
}
+ // Paper start - getEntity by UUID API
+ @Override
+ public Entity getEntity(UUID uuid) {
+ Validate.notNull(uuid, "UUID cannot be null");
+ net.minecraft.world.entity.Entity entity = world.getEntity(uuid);
+ return entity == null ? null : entity.getBukkitEntity();
+ }
+ // Paper end
+
@Override
public void save() {
org.spigotmc.AsyncCatcher.catchOp("world save"); // Spigot