From 2276eb899e5308373f5eccf2a27a65cba294361d Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Mon, 3 Oct 2011 15:15:50 -0400 Subject: Revert "Added callback line of sight methods. Thanks xZise!" This reverts commit 1df3a823ba477d68b359e5ac246345a05fe82ebd. --- src/main/java/org/bukkit/entity/LivingEntity.java | 29 ------------------ src/main/java/org/bukkit/util/Callback.java | 19 ------------ .../java/org/bukkit/util/TransparentCallback.java | 34 ---------------------- 3 files changed, 82 deletions(-) delete mode 100644 src/main/java/org/bukkit/util/Callback.java delete mode 100644 src/main/java/org/bukkit/util/TransparentCallback.java (limited to 'src/main/java/org') diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java index e9661e19..2bc90bef 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -5,7 +5,6 @@ import java.util.List; import org.bukkit.Location; import org.bukkit.block.Block; -import org.bukkit.util.Callback; /** * Represents a living entity, such as a monster or player @@ -48,34 +47,6 @@ public interface LivingEntity extends Entity { */ public Location getEyeLocation(); - /** - * Gets all blocks along the player's line of sight - * List iterates from player's position to target inclusive - * - * @param callback Through every iteration it will call {@link Callback#call(Object)}. If set to/returns null only air is considered transparent. - * @param maxDistance This is the maximum distance to scan. This may be further limited by the server, but never to less than 100 blocks. - * @return List containing all blocks along the player's line of sight - */ - public List getLineOfSight(Callback callback, int maxDistance); - - /** - * Gets the block that the player has targeted - * - * @param callback Through every iteration it will call {@link Callback#call(Object)}. If set to/returns null only air is considered transparent. - * @param maxDistance This is the maximum distance to scan. This may be further limited by the server, but never to less than 100 blocks. - * @return Block that the player has targeted - */ - public Block getTargetBlock(Callback callback, int maxDistance); - - /** - * Gets the block that the player has targeted - * - * @param callback Through every iteration it will call {@link Callback#call(Object)}. If set to/returns null only air is considered transparent. - * @param maxDistance This is the maximum distance to scan. This may be further limited by the server, but never to less than 100 blocks. - * @return Block that the player has targeted - */ - public List getLastTwoTargetBlocks(Callback callback, int maxDistance); - /** * Gets all blocks along the player's line of sight * List iterates from player's position to target inclusive diff --git a/src/main/java/org/bukkit/util/Callback.java b/src/main/java/org/bukkit/util/Callback.java deleted file mode 100644 index 89205329..00000000 --- a/src/main/java/org/bukkit/util/Callback.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.bukkit.util; - -/** - * Primitive callback class, to allow specific callback handling. For example to determine if a block in sight is invisible. - * - * @param This is the type it will return. - * @param This is the type it has as parameter. - */ -public interface Callback { - - /** - * This method will be called on each step. - * - * @param parameter The parameter of this step. - * @return The result of the step. - */ - public Result call(Parameter parameter); - -} diff --git a/src/main/java/org/bukkit/util/TransparentCallback.java b/src/main/java/org/bukkit/util/TransparentCallback.java deleted file mode 100644 index 28a8f0c4..00000000 --- a/src/main/java/org/bukkit/util/TransparentCallback.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.bukkit.util; - -import java.util.Set; - -import org.bukkit.block.Block; - -/** - * Default transparent call back. This class as callback acts like the normal - * line of sight methods. - * - * To implement own handler override {@link TransparentCallback#call(Block)} and - * call it via super. - */ -public class TransparentCallback implements Callback { - - private final Set transparent; - - /** - * Creates a new callback class which returns by default for every block in - * the transparent list true. Otherwise false. Could be expanded by override - * the {@link Callback#call(Block)} method. - * - * @param transparent - * The list of transparent blocks. - */ - public TransparentCallback(Set transparent) { - this.transparent = transparent; - } - - public Boolean call(Block parameter) { - return this.transparent.contains((byte) parameter.getTypeId()); - } - -} -- cgit v1.2.3