2016-07-17 01:10:43 +00:00
|
|
|
From 7cf0e711c6c80eb556adeb298480439f15a9405f Mon Sep 17 00:00:00 2001
|
2016-03-30 06:20:36 +00: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-07-15 22:36:53 +00:00
|
|
|
index 453e600..11770ad 100644
|
2016-03-30 06:20:36 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2016-07-15 22:36:53 +00:00
|
|
|
@@ -1508,6 +1508,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
|
2016-06-10 02:43:32 +00:00
|
|
|
this.Y = 0L;
|
2016-03-30 06:20:36 +00:00
|
|
|
}
|
2016-06-10 02:43:32 +00:00
|
|
|
|
|
|
|
+ public Entity getEntity(UUID uuid) { return this.a(uuid); } // Paper - OBFHELPER
|
|
|
|
@Nullable
|
|
|
|
public Entity a(UUID uuid) {
|
|
|
|
WorldServer[] aworldserver = this.worldServer;
|
2016-07-15 22:36:53 +00:00
|
|
|
@@ -1521,7 +1522,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
|
2016-06-10 02:43:32 +00:00
|
|
|
if (worldserver != null) {
|
|
|
|
Entity entity = worldserver.getEntity(uuid);
|
|
|
|
|
|
|
|
- if (entity != null) {
|
|
|
|
+ if (entity != null && entity.isAlive()) {
|
|
|
|
return entity;
|
|
|
|
}
|
|
|
|
}
|
2016-03-30 06:20:36 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2016-06-30 05:23:30 +00:00
|
|
|
index 8f08fa5..91d00dc 100644
|
2016-03-30 06:20:36 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
@@ -46,6 +46,7 @@ import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
|
|
|
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-05-20 22:32:50 +00:00
|
|
|
@@ -1865,5 +1866,14 @@ public final class CraftServer implements Server {
|
2016-04-19 21:29:33 +00:00
|
|
|
});
|
|
|
|
}
|
2016-03-30 06:20:36 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public CraftEntity getEntity(UUID uuid) {
|
|
|
|
+ Entity entity = getHandle().getServer().getEntity(uuid);
|
|
|
|
+ if (entity == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ return entity.getBukkitEntity();
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
}
|
|
|
|
--
|
2016-07-17 01:10:43 +00:00
|
|
|
2.9.0
|
2016-03-30 06:20:36 +00:00
|
|
|
|