Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-17 03:50:08 +01:00
Skip dead entities in getEntity(UUID) API
Dieser Commit ist enthalten in:
Ursprung
6462bb4e20
Commit
a785a9460e
@ -1,11 +1,11 @@
|
|||||||
From eab823e7ef24a1d4a79f9cdc6efd9f7e169f7b2c Mon Sep 17 00:00:00 2001
|
From 0e1abba6b1186ab06e0ed8ecf5ceb00c1494c2d3 Mon Sep 17 00:00:00 2001
|
||||||
From: DemonWav <demonwav@gmail.com>
|
From: DemonWav <demonwav@gmail.com>
|
||||||
Date: Wed, 30 Mar 2016 01:20:11 -0500
|
Date: Wed, 30 Mar 2016 01:20:11 -0500
|
||||||
Subject: [PATCH] Add getEntity by UUID API
|
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
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index d628a32..d7ca53b 100644
|
index d628a32..a785412 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1622,4 +1622,17 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
|
@@ -1622,4 +1622,17 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
|
||||||
@ -18,7 +18,7 @@ index d628a32..d7ca53b 100644
|
|||||||
+ Entity entity;
|
+ Entity entity;
|
||||||
+ for (WorldServer world : worldServer) {
|
+ for (WorldServer world : worldServer) {
|
||||||
+ entity = world.getEntity(uuid);
|
+ entity = world.getEntity(uuid);
|
||||||
+ if (entity != null) {
|
+ if (entity != null && !entity.dead) {
|
||||||
+ return entity;
|
+ return entity;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren