From 9177c205b40cc3f8c24b3ed8085c2eb6c151eb0c Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Mon, 3 Oct 2011 15:17:34 -0400 Subject: [PATCH] Revert "Added callback line of sight methods. Thanks xZise!" This reverts commit 49cf586f969626bdb59632bb2fd5adfe79d38057. --- .../craftbukkit/entity/CraftLivingEntity.java | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 6d5558d1fc..63e1d1b959 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -18,7 +18,6 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Snowball; import org.bukkit.entity.Vehicle; import org.bukkit.util.BlockIterator; -import org.bukkit.util.Callback; import java.util.List; import java.util.HashSet; @@ -87,45 +86,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return getEyeHeight(); } - private List getLineOfSight(Callback callback, int maxDistance, int maxLength) { - if (maxDistance > 120) { - maxDistance = 120; - } - ArrayList blocks = new ArrayList(maxLength == 0 ? 10 : maxLength); - Iterator itr = new BlockIterator(this, maxDistance); - while (itr.hasNext()) { - Block block = itr.next(); - if (maxLength != 0 && blocks.size() + 1 > maxLength) { - blocks.remove(0); - } - blocks.add(block); - if (callback == null) { - if (block.getTypeId() != 0) { - break; - } - } else { - Boolean result = callback.call(block); - if (result != null && !result) { - break; - } - } - } - return blocks; - } - - public List getLineOfSight(Callback callback, int maxDistance) { - return getLineOfSight(callback, maxDistance, 0); - } - - public Block getTargetBlock(Callback callback, int maxDistance) { - List blocks = getLineOfSight(callback, maxDistance, 1); - return blocks.get(0); - } - - public List getLastTwoTargetBlocks(Callback callback, int maxDistance) { - return getLineOfSight(callback, maxDistance, 2); - } - private List getLineOfSight(HashSet transparent, int maxDistance, int maxLength) { if (maxDistance > 120) { maxDistance = 120;