13
0
geforkt von Mirrors/Paper

Don't iterate twice - Fixes GH-1346

Dieser Commit ist enthalten in:
Zach Brown 2018-08-18 03:58:53 -05:00
Ursprung eb8312e4f9
Commit 9920287a0f

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Send nearby packets from world player list not server list
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index eaaa54ac..44ced604 100644
index eaaa54acd..44ced604a 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList {
@ -46,7 +46,7 @@ index eaaa54ac..44ced604 100644
double d5 = d1 - entityplayer.locY;
double d6 = d2 - entityplayer.locZ;
diff --git a/src/main/java/net/minecraft/server/WorldManager.java b/src/main/java/net/minecraft/server/WorldManager.java
index 2c8fb705..a986e947 100644
index 2c8fb705d..bfe003f60 100644
--- a/src/main/java/net/minecraft/server/WorldManager.java
+++ b/src/main/java/net/minecraft/server/WorldManager.java
@@ -0,0 +0,0 @@ public class WorldManager implements IWorldAccess {
@ -86,14 +86,16 @@ index 2c8fb705..a986e947 100644
+ java.util.List<? extends EntityHuman> list = entity != null ? entity.world.players : this.a.getPlayerList().v();
+ Iterator<? extends EntityHuman> iterator = list.iterator();
while (iterator.hasNext()) {
- EntityPlayer entityplayer = (EntityPlayer) iterator.next();
+ EntityHuman human = iterator.next();
+ if (!(human instanceof EntityPlayer)) continue;
+ EntityPlayer entityplayer = (EntityPlayer) human;
+ // Paper end
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
if (entityplayer != null && entityplayer.world == this.world && entityplayer.getId() != i) {
double d0 = (double) blockposition.getX() - entityplayer.locX;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 9fe5c440..8768b0b8 100644
index a14b5e061..b19942e0f 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@ -117,7 +119,7 @@ index 9fe5c440..8768b0b8 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 210e3bc4..170c937a 100644
index ccff6fd05..567e9acb1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
@ -129,6 +131,4 @@ index 210e3bc4..170c937a 100644
}
public String getGameRuleValue(String rule) {
--
2.18.0.rc2.windows.1
--