From c84d51f4588c00329f9e3e1b537590b917ce3a49 Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Sat, 2 Apr 2011 17:56:06 +0200 Subject: [PATCH] Fix chunk.getEntities --- src/main/java/org/bukkit/craftbukkit/CraftChunk.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java index 12c5ad8423..fb85405482 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -79,12 +79,12 @@ public class CraftChunk implements Chunk { for (int i = 0; i < 8; i++) { count += chunk.m[i].size(); } - Entity[] entities = new Entity[count]; + + Entity[] entities = new Entity[count]; for (int i = 0; i < 8; i++) { - for (Object obj : (net.minecraft.server.Entity[])chunk.m[i].toArray()) { - if (!(obj instanceof net.minecraft.server.Entity)) continue; - net.minecraft.server.Entity entity = (net.minecraft.server.Entity) obj; - entities[index++] = entity.getBukkitEntity(); + for (Object obj: chunk.m[i].toArray()) { + if (!(obj instanceof net.minecraft.server.Entity)) continue; + entities[index++] = ((net.minecraft.server.Entity) obj).getBukkitEntity(); } } return entities;