diff options
author | BillyGalbreath <BillyGalbreath@Hotmail.com> | 2014-12-17 18:50:18 -0600 |
---|---|---|
committer | md_5 <git@md-5.net> | 2015-02-15 12:15:09 +1100 |
commit | e1f54099c8d6ba708c2895803464a0b89cacd3b9 (patch) | |
tree | cdf61e8f75b8eff7213822afdec775897bb6a584 | |
parent | 0fcdca4beac431786fcbc9a0880ab435de2f5d91 (diff) | |
download | bukkit-e1f54099c8d6ba708c2895803464a0b89cacd3b9.tar bukkit-e1f54099c8d6ba708c2895803464a0b89cacd3b9.tar.gz bukkit-e1f54099c8d6ba708c2895803464a0b89cacd3b9.tar.lz bukkit-e1f54099c8d6ba708c2895803464a0b89cacd3b9.tar.xz bukkit-e1f54099c8d6ba708c2895803464a0b89cacd3b9.zip |
Add alternatives for deprecated methods
-rw-r--r-- | src/main/java/org/bukkit/entity/LivingEntity.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java index a0fefd85..48e25089 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -3,8 +3,10 @@ package org.bukkit.entity; import java.util.Collection; import java.util.HashSet; import java.util.List; +import java.util.Set; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.inventory.EntityEquipment; import org.bukkit.potion.PotionEffect; @@ -57,6 +59,21 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { public List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance); /** + * Gets all blocks along the living entity's line of sight. + * <p> + * This list contains all blocks from the living entity's eye position to + * target inclusive. + * + * @param transparent HashSet containing all transparent block Materials (set to + * null for only air) + * @param maxDistance this is the maximum distance to scan (may be limited + * by server by at least 100 blocks, no less) + * @return list containing all blocks along the living entity's line of + * sight + */ + public List<Block> getLineOfSight(Set<Material> transparent, int maxDistance); + + /** * Gets the block that the living entity has targeted. * * @param transparent HashSet containing all transparent block IDs (set to @@ -70,6 +87,17 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { public Block getTargetBlock(HashSet<Byte> transparent, int maxDistance); /** + * Gets the block that the living entity has targeted. + * + * @param transparent HashSet containing all transparent block Materials (set to + * null for only air) + * @param maxDistance this is the maximum distance to scan (may be limited + * by server by at least 100 blocks, no less) + * @return block that the living entity has targeted + */ + public Block getTargetBlock(Set<Material> transparent, int maxDistance); + + /** * Gets the last two blocks along the living entity's line of sight. * <p> * The target block will be the last block in the list. @@ -86,6 +114,20 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { public List<Block> getLastTwoTargetBlocks(HashSet<Byte> transparent, int maxDistance); /** + * Gets the last two blocks along the living entity's line of sight. + * <p> + * The target block will be the last block in the list. + * + * @param transparent HashSet containing all transparent block Materials (set to + * null for only air) + * @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 the last 2 blocks along the living entity's + * line of sight + */ + public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance); + + /** * Throws an egg from the living entity. * * @deprecated use launchProjectile(Egg.class) instead |