mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 05:32:18 -07:00
Simplify getEntity by UUID patch, misc readme changes
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user