PaperMC/CraftBukkit-Patches/0150-Don-t-copy-NavigationListener-Map-on-Iteration.patch

32 lines
No EOL
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 18 Mar 2016 14:41:20 +1100
Subject: [PATCH] Don't copy NavigationListener Map on Iteration.
diff --git a/src/main/java/net/minecraft/server/NavigationListener.java b/src/main/java/net/minecraft/server/NavigationListener.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/NavigationListener.java
+++ b/src/main/java/net/minecraft/server/NavigationListener.java
@@ -0,0 +0,0 @@ public class NavigationListener implements IWorldAccess {
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, int i) {
if (this.a(world, blockposition, iblockdata, iblockdata1)) {
- NavigationAbstract[] anavigationabstract = (NavigationAbstract[]) this.b.keySet().toArray(new NavigationAbstract[0]);
- NavigationAbstract[] anavigationabstract1 = anavigationabstract;
- int j = anavigationabstract.length;
-
- for (int k = 0; k < j; ++k) {
- NavigationAbstract navigationabstract = anavigationabstract1[k];
+ // Spigot start
+ // NavigationAbstract[] anavigationabstract = (NavigationAbstract[]) this.b.keySet().toArray(new NavigationAbstract[0]);
+ // NavigationAbstract[] anavigationabstract1 = anavigationabstract;
+ // int j = anavigationabstract.length;
+
+ for (NavigationAbstract navigationabstract : this.b.keySet()) {
+ // NavigationAbstract navigationabstract = anavigationabstract1[k];
+ // Spigot end
if (navigationabstract != null && !navigationabstract.i()) {
PathEntity pathentity = navigationabstract.k();
--