From 59cc0a983402e9d3f44a717ddc67b77769bf11fa Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Thu, 9 Jun 2016 21:43:32 -0500 Subject: [PATCH] Simplify getEntity by UUID patch, misc readme changes --- README.md | 5 ++- .../Add-getEntity-by-UUID-API.patch | 34 ++++++++----------- ...-possibility-for-getServer-singleton.patch | 2 +- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index f24db2b898..aa471f0555 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,13 @@ High performance Spigot fork that aims to fix gameplay and mechanics inconsisten Documentation ------ -Access the paper docs here: [paper.readthedocs.org](https://paper.readthedocs.org/) +Access the paper docs here: [paper.readthedocs.io](https://paper.readthedocs.io/) How To (Server Admins) ------ Paperclip is a jar file that you can download and run just like a normal jar file. -Download a copy of Paperclip.jar from our buildserver here: -https://ci.destroystokyo.com/job/PaperSpigot/ +Download a copy of paperclip.jar from [our build server, here](https://ci.destroystokyo.com/job/PaperSpigot/). Run the Paperclip jar directly from your server. Just like old times diff --git a/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch b/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch index 78240cdbe8..bf5eab8d36 100644 --- a/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch +++ b/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch @@ -9,26 +9,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs - return (Bukkit.getServer() instanceof CraftServer) ? ((CraftServer) Bukkit.getServer()).getServer() : null; + this.Y = 0L; } - // CraftBukkit end -+ -+ // Paper start -+ public Entity getEntity(UUID uuid) { -+ Entity entity; -+ for (WorldServer world : worldServer) { -+ if (world == null) { -+ continue; -+ } -+ entity = world.getEntity(uuid); -+ if (entity != null && !entity.dead) { -+ return entity; -+ } -+ } -+ return null; -+ } -+ // Paper end - } + ++ public Entity getEntity(UUID uuid) { return this.a(uuid); } // Paper - OBFHELPER + @Nullable + public Entity a(UUID uuid) { + WorldServer[] aworldserver = this.worldServer; +@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + if (worldserver != null) { + Entity entity = worldserver.getEntity(uuid); + +- if (entity != null) { ++ if (entity != null && entity.isAlive()) { + return entity; + } + } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch index daea82d232..f461f3f9d6 100644 --- a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch +++ b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch @@ -33,5 +33,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return SERVER; } // CraftBukkit end - + } -- \ No newline at end of file