3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 21:10:17 +01:00

Implement LivingEntity.hasLineOfSight. Addresses BUKKIT-1255

Dieser Commit ist enthalten in:
TomyLobo 2012-03-21 16:31:30 +01:00 committet von feildmaster
Ursprung 78acee359e
Commit 412b7eaa12

Datei anzeigen

@ -25,6 +25,7 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.Egg; import org.bukkit.entity.Egg;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.EnderPearl; import org.bukkit.entity.EnderPearl;
@ -292,4 +293,8 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public EntityType getType() { public EntityType getType() {
return EntityType.UNKNOWN; return EntityType.UNKNOWN;
} }
public boolean hasLineOfSight(Entity other) {
return getHandle().am().canSee(((CraftEntity) other).getHandle()); // am should be getEntitySenses
}
} }