/** * Constructs the BlockIterator. * * @param entity Information from the entity is used to set up the trace * @param maxDistance This is the maximum distance in blocks for the * trace. Setting this value above 140 may lead to problems with * unloaded chunks. A value of 0 indicates no limit */ public BlockIterator(LivingEntity entity, int maxDistance) { this(entity.getLocation(), entity.getEyeHeight(), maxDistance); }
/** * Gets the height of the living entity's eyes above its Location. * * @return height of the living entity's eyes above its location */ public double getEyeHeight() { return entity.getEyeHeight(); }
/** * Gets the height of the living entity's eyes above its Location. * * @param ignoreSneaking * if set to true, the effects of sneaking will be ignored * @return height of the living entity's eyes above its location */ public double getEyeHeight(boolean ignoreSneaking) { return entity.getEyeHeight(ignoreSneaking); }
@Override public double getEyeHeight() { return le.getEyeHeight(); }
@Override public double getEyeHeight(boolean ignoreSneaking) { return le.getEyeHeight(ignoreSneaking); }
/** * Constructs the BlockIterator. * * @param entity Information from the entity is used to set up the trace * @param maxDistance This is the maximum distance in blocks for the * trace. Setting this value above 140 may lead to problems with * unloaded chunks. A value of 0 indicates no limit */ public BlockIterator(LivingEntity entity, int maxDistance) { this(entity.getLocation(), entity.getEyeHeight(), maxDistance); }
@Override public double getHeight(final Entity entity) { double entityHeight; if (bukkitHasGetHeightAndGetWidth) { entityHeight = entity.getHeight(); } else { entityHeight = 1.0; } if (entity instanceof LivingEntity) { return Math.max(((LivingEntity) entity).getEyeHeight(), entityHeight); } else { return entityHeight; } }
isLiving = true; final LivingEntity living = (LivingEntity) entity; eyeHeight = living.getEyeHeight(); fullHeight = Math.max(Math.max(fullHeight, eyeHeight), living.getEyeHeight(true));
public static Object armorstandCreation(Location location, Entity entity, ServerMob serverMob) { try { Object armorstand = entity.getWorld().spawnEntity(entity.getLocation().clone().add(0, ((LivingEntity) entity).getEyeHeight() - (entity instanceof Wither ? 0.15 : 0.3), 0), EntityType.valueOf("ARMOR_STAND")); armorstand.getClass().getMethod("setVisible", boolean.class).invoke(armorstand, false); armorstand.getClass().getMethod("setCustomNameVisible", boolean.class).invoke(armorstand, true); armorstand.getClass().getMethod("setGravity", boolean.class).invoke(armorstand, false); armorstand.getClass().getMethod("setBasePlate", boolean.class).invoke(armorstand, false); armorstand.getClass().getMethod("setSmall", boolean.class).invoke(armorstand, true); armorstand.getClass().getMethod("setCanPickupItems", boolean.class).invoke(armorstand, false); return armorstand; } catch (Exception ex) { ex.printStackTrace(); } return null; } }
/** * Rotates an NPC to face a target location. */ public void faceLocation(Location l) { npc.faceLocation(l.clone().subtract(0, getLivingEntity().getEyeHeight(), 0)); }
height = Math.max(height, ((LivingEntity) entity).getEyeHeight());
final double distanceMin = (distanceLimit - DYNAMIC_RANGE) / distanceLimit; final double height = damagedIsFake ? (damaged instanceof LivingEntity ? ((LivingEntity) damaged).getEyeHeight() : 1.75) : mcAccess.getHandle().getHeight(damaged);
case BAT: if (entity instanceof LivingEntity) return yMod + ((LivingEntity) entity).getEyeHeight(); case MINECART: case MINECART_COMMAND:
if (distancePercent <= 1.0D) { double distanceX = livingEntity.getLocation().getX() - posX; double distanceY = livingEntity.getLocation().getX() + livingEntity.getEyeHeight() - posY; double distanceZ = livingEntity.getLocation().getX() - posZ; double distance = Math.sqrt(distanceX * distanceX + distanceY * distanceY + distanceZ * distanceZ);
final double height = damagedIsFake ? (damaged instanceof LivingEntity ? ((LivingEntity) damaged).getEyeHeight() : 1.75) : mcAccess.getHeight(damaged);