mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-15 07:01:36 +08:00
35 lines
1.8 KiB
Diff
35 lines
1.8 KiB
Diff
From 9972735b263dcf4615b6e27f0b1ca1a18c10ad2b 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 f82ea80..39a4032 100644
|
|
--- a/src/main/java/net/minecraft/server/NavigationListener.java
|
|
+++ b/src/main/java/net/minecraft/server/NavigationListener.java
|
|
@@ -15,12 +15,14 @@ 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();
|
|
--
|
|
2.5.0
|
|
|