use of org.bukkit.craftbukkit.v1_4_6.entity.CraftEntity in project NoCheatPlus by NoCheatPlus.
the class MCAccessCBDev method getHeight.
@Override
public double getHeight(final Entity entity) {
// (entity.getHeight() returns the length field, but we access nms anyway.)
final net.minecraft.server.v1_12_R1.Entity mcEntity = ((CraftEntity) entity).getHandle();
final AxisAlignedBB boundingBox = mcEntity.getBoundingBox();
final double entityHeight = Math.max(mcEntity.length, Math.max(mcEntity.getHeadHeight(), boundingBox.e - boundingBox.b));
if (entity instanceof LivingEntity) {
return Math.max(((LivingEntity) entity).getEyeHeight(), entityHeight);
} else {
return entityHeight;
}
}
Aggregations