From a305036e2ee44e44bf62520524b3a0633565ed4f Mon Sep 17 00:00:00 2001 From: wwrpg Date: Mon, 4 May 2015 11:31:32 -0700 Subject: [PATCH] Update ItemBiomeFinder.java Fixed for-loop range and added missing breaks to improve performance --- src/main/java/biomesoplenty/common/items/ItemBiomeFinder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/biomesoplenty/common/items/ItemBiomeFinder.java b/src/main/java/biomesoplenty/common/items/ItemBiomeFinder.java index a8029dbf5..9e98f6a85 100644 --- a/src/main/java/biomesoplenty/common/items/ItemBiomeFinder.java +++ b/src/main/java/biomesoplenty/common/items/ItemBiomeFinder.java @@ -60,7 +60,7 @@ public class ItemBiomeFinder extends Item int playerX = MathHelper.floor_double(player.posX); int playerZ = MathHelper.floor_double(player.posZ); - for (int x = 10; x <= 10; x++) + for (int x = 10; x >= -10; x--) { for (int z = -10; z <= 10; z++) { @@ -72,6 +72,7 @@ public class ItemBiomeFinder extends Item break; } } + if (finalFoundPosition1 != null) break; } ChunkPosition finalFoundPosition2 = null; @@ -88,6 +89,7 @@ public class ItemBiomeFinder extends Item break; } } + if (finalFoundPosition2 != null) break; } ChunkPosition biomePosition = null;