use of net.minecraft.server.v1_16_R2.RayTrace in project RoseStacker by Rosewood-Development.
the class NMSHandlerImpl method hasLineOfSight.
@Override
public boolean hasLineOfSight(LivingEntity entity1, org.bukkit.entity.Entity entity2) {
EntityLiving nmsEntity1 = ((CraftLivingEntity) entity1).getHandle();
Entity nmsEntity2 = ((CraftEntity) entity2).getHandle();
Vec3D vec3d = new Vec3D(nmsEntity1.locX(), nmsEntity1.getHeadY(), nmsEntity1.locZ());
Vec3D vec3d1 = new Vec3D(nmsEntity2.locX(), nmsEntity2.getHeadY(), nmsEntity2.locZ());
return nmsEntity1.world.rayTrace(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.VISUAL, RayTrace.FluidCollisionOption.NONE, nmsEntity1)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
}
use of net.minecraft.server.v1_16_R2.RayTrace in project RoseStacker by Rosewood-Development.
the class NMSHandlerImpl method hasLineOfSight.
@Override
public boolean hasLineOfSight(LivingEntity entity1, org.bukkit.entity.Entity entity2) {
EntityLiving nmsEntity1 = ((CraftLivingEntity) entity1).getHandle();
Entity nmsEntity2 = ((CraftEntity) entity2).getHandle();
Vec3D vec3d = new Vec3D(nmsEntity1.locX(), nmsEntity1.getHeadY(), nmsEntity1.locZ());
Vec3D vec3d1 = new Vec3D(nmsEntity2.locX(), nmsEntity2.getHeadY(), nmsEntity2.locZ());
return nmsEntity1.world.rayTrace(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.VISUAL, RayTrace.FluidCollisionOption.NONE, nmsEntity1)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
}
Aggregations