2016-12-20 23:34:27 +01:00
|
|
|
From 8ddafeefaeaf97373c2a76e463716b223bd730fa Mon Sep 17 00:00:00 2001
|
2016-03-30 08:20:36 +02:00
|
|
|
From: DemonWav <demonwav@gmail.com>
|
|
|
|
Date: Wed, 30 Mar 2016 01:20:11 -0500
|
|
|
|
Subject: [PATCH] Add getEntity by UUID API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2016-12-20 23:34:27 +01:00
|
|
|
index 2456e33..fc433f9 100644
|
2016-03-30 08:20:36 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2016-11-17 03:23:38 +01:00
|
|
|
@@ -1521,6 +1521,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
|
|
|
|
this.Z = 0L;
|
2016-03-30 08:20:36 +02:00
|
|
|
}
|
2016-06-10 04:43:32 +02:00
|
|
|
|
|
|
|
+ public Entity getEntity(UUID uuid) { return this.a(uuid); } // Paper - OBFHELPER
|
|
|
|
@Nullable
|
|
|
|
public Entity a(UUID uuid) {
|
|
|
|
WorldServer[] aworldserver = this.worldServer;
|
2016-11-17 03:23:38 +01:00
|
|
|
@@ -1534,7 +1535,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
|
2016-06-10 04:43:32 +02:00
|
|
|
if (worldserver != null) {
|
|
|
|
Entity entity = worldserver.getEntity(uuid);
|
|
|
|
|
|
|
|
- if (entity != null) {
|
2016-08-28 07:46:21 +02:00
|
|
|
+ if (entity != null && !entity.dead) {
|
2016-06-10 04:43:32 +02:00
|
|
|
return entity;
|
|
|
|
}
|
|
|
|
}
|
2016-03-30 08:20:36 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2016-12-20 23:34:27 +01:00
|
|
|
index 4fdb3cc..764b6d7 100644
|
2016-03-30 08:20:36 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2016-08-28 01:41:58 +02:00
|
|
|
@@ -53,6 +53,7 @@ import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
2016-03-30 08:20:36 +02:00
|
|
|
import org.bukkit.conversations.Conversable;
|
|
|
|
import org.bukkit.craftbukkit.boss.CraftBossBar;
|
|
|
|
import org.bukkit.craftbukkit.command.VanillaCommandWrapper;
|
|
|
|
+import org.bukkit.craftbukkit.entity.CraftEntity;
|
|
|
|
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
|
|
|
import org.bukkit.craftbukkit.generator.CraftChunkData;
|
|
|
|
import org.bukkit.craftbukkit.help.SimpleHelpMap;
|
2016-12-20 23:34:27 +01:00
|
|
|
@@ -1838,5 +1839,14 @@ public final class CraftServer implements Server {
|
2016-04-19 23:29:33 +02:00
|
|
|
});
|
|
|
|
}
|
2016-03-30 08:20:36 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public CraftEntity getEntity(UUID uuid) {
|
|
|
|
+ Entity entity = getHandle().getServer().getEntity(uuid);
|
|
|
|
+ if (entity == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ return entity.getBukkitEntity();
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
}
|
|
|
|
--
|
2016-12-11 00:50:31 +01:00
|
|
|
2.9.3
|
2016-03-30 08:20:36 +02:00
|
|
|
|