Commits
BillyGalbreath authored and md_5 committed e1f54099c8d
1 1 | package org.bukkit.entity; |
2 2 | |
3 3 | import java.util.Collection; |
4 4 | import java.util.HashSet; |
5 5 | import java.util.List; |
6 + | import java.util.Set; |
6 7 | |
7 8 | import org.bukkit.Location; |
9 + | import org.bukkit.Material; |
8 10 | import org.bukkit.block.Block; |
9 11 | import org.bukkit.inventory.EntityEquipment; |
10 12 | import org.bukkit.potion.PotionEffect; |
11 13 | import org.bukkit.potion.PotionEffectType; |
12 14 | import org.bukkit.projectiles.ProjectileSource; |
13 15 | |
14 16 | /** |
15 17 | * Represents a living entity, such as a monster or player |
16 18 | */ |
17 19 | public interface LivingEntity extends Entity, Damageable, ProjectileSource { |
49 51 | * null for only air) |
50 52 | * @param maxDistance this is the maximum distance to scan (may be limited |
51 53 | * by server by at least 100 blocks, no less) |
52 54 | * @return list containing all blocks along the living entity's line of |
53 55 | * sight |
54 56 | * @deprecated Magic value |
55 57 | */ |
56 58 | |
57 59 | public List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance); |
58 60 | |
61 + | /** |
62 + | * Gets all blocks along the living entity's line of sight. |
63 + | * <p> |
64 + | * This list contains all blocks from the living entity's eye position to |
65 + | * target inclusive. |
66 + | * |
67 + | * @param transparent HashSet containing all transparent block Materials (set to |
68 + | * null for only air) |
69 + | * @param maxDistance this is the maximum distance to scan (may be limited |
70 + | * by server by at least 100 blocks, no less) |
71 + | * @return list containing all blocks along the living entity's line of |
72 + | * sight |
73 + | */ |
74 + | public List<Block> getLineOfSight(Set<Material> transparent, int maxDistance); |
75 + | |
59 76 | /** |
60 77 | * Gets the block that the living entity has targeted. |
61 78 | * |
62 79 | * @param transparent HashSet containing all transparent block IDs (set to |
63 80 | * null for only air) |
64 81 | * @param maxDistance this is the maximum distance to scan (may be limited |
65 82 | * by server by at least 100 blocks, no less) |
66 83 | * @return block that the living entity has targeted |
67 84 | * @deprecated Magic value |
68 85 | */ |
69 86 | |
70 87 | public Block getTargetBlock(HashSet<Byte> transparent, int maxDistance); |
71 88 | |
89 + | /** |
90 + | * Gets the block that the living entity has targeted. |
91 + | * |
92 + | * @param transparent HashSet containing all transparent block Materials (set to |
93 + | * null for only air) |
94 + | * @param maxDistance this is the maximum distance to scan (may be limited |
95 + | * by server by at least 100 blocks, no less) |
96 + | * @return block that the living entity has targeted |
97 + | */ |
98 + | public Block getTargetBlock(Set<Material> transparent, int maxDistance); |
99 + | |
72 100 | /** |
73 101 | * Gets the last two blocks along the living entity's line of sight. |
74 102 | * <p> |
75 103 | * The target block will be the last block in the list. |
76 104 | * |
77 105 | * @param transparent HashSet containing all transparent block IDs (set to |
78 106 | * null for only air) |
79 107 | * @param maxDistance this is the maximum distance to scan. This may be |
80 108 | * further limited by the server, but never to less than 100 blocks |
81 109 | * @return list containing the last 2 blocks along the living entity's |
82 110 | * line of sight |
83 111 | * @deprecated Magic value |
84 112 | */ |
85 113 | |
86 114 | public List<Block> getLastTwoTargetBlocks(HashSet<Byte> transparent, int maxDistance); |
87 115 | |
116 + | /** |
117 + | * Gets the last two blocks along the living entity's line of sight. |
118 + | * <p> |
119 + | * The target block will be the last block in the list. |
120 + | * |
121 + | * @param transparent HashSet containing all transparent block Materials (set to |
122 + | * null for only air) |
123 + | * @param maxDistance this is the maximum distance to scan. This may be |
124 + | * further limited by the server, but never to less than 100 blocks |
125 + | * @return list containing the last 2 blocks along the living entity's |
126 + | * line of sight |
127 + | */ |
128 + | public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance); |
129 + | |
88 130 | /** |
89 131 | * Throws an egg from the living entity. |
90 132 | * |
91 133 | * @deprecated use launchProjectile(Egg.class) instead |
92 134 | * @return the egg thrown |
93 135 | */ |
94 136 | |
95 137 | public Egg throwEgg(); |
96 138 | |
97 139 | /** |