Broken ternary

This commit is contained in:
EmotionalLove 2019-12-16 15:54:42 -08:00
parent ed9a8d0a1f
commit b1c31f7a07
1 changed files with 4 additions and 4 deletions

View File

@ -21,15 +21,15 @@ public class EntityStatsCommand extends Command {
@Override
public void call(String[] args) {
String maxHealth;
String speed;
if (mc.player.getRidingEntity() != null && mc.player.getRidingEntity() instanceof AbstractHorse) {
String maxHealth;
String speed;
AbstractHorse horse = (AbstractHorse) mc.player.getRidingEntity();
// TODO: Function that resolves UUID's to Minecraft usernames. @bella
Command.sendChatMessage("&6Entity Stats:\n&cMax Health: &b" + horse.getMaxHealth() + " &2HP" + "\n&cSpeed: &b" + round(43.17 * horse.getAIMoveSpeed(), 2) + " &2m/s" + "\n&cJump: &b" + round(-0.1817584952 * Math.pow(horse.getHorseJumpStrength(), 3) + 3.689713992 * Math.pow(horse.getHorseJumpStrength(), 2) + 2.128599134 * horse.getHorseJumpStrength() - 0.343930367, 4) + " &2m" + "\n&cOwner UUID: &b" + horse.getOwnerUniqueId() == null ? "Not tamed." : horse.getOwnerUniqueId().toString());
Command.sendChatMessage("&6Entity Stats:\n&cMax Health: &b" + horse.getMaxHealth() + " &2HP" + "\n&cSpeed: &b" + round(43.17 * horse.getAIMoveSpeed(), 2) + " &2m/s" + "\n&cJump: &b" + round(-0.1817584952 * Math.pow(horse.getHorseJumpStrength(), 3) + 3.689713992 * Math.pow(horse.getHorseJumpStrength(), 2) + 2.128599134 * horse.getHorseJumpStrength() - 0.343930367, 4) + " &2m" + "\n&cOwner UUID: &b" + ((horse.getOwnerUniqueId() == null) ? "Not tamed." : horse.getOwnerUniqueId().toString()));
} else if (mc.player.getRidingEntity() instanceof EntityLivingBase) {
EntityLivingBase entity = (EntityLivingBase) mc.player.getRidingEntity();
Command.sendChatMessage("&6Entity Stats:\n&cMax Health: &b" + entity.getMaxHealth() + " &2HP" + "\n&cSpeed: &b" + round(43.17 * entity.getAIMoveSpeed(), 2) + " &2m/s";);
Command.sendChatMessage("&6Entity Stats:\n&cMax Health: &b" + entity.getMaxHealth() + " &2HP" + "\n&cSpeed: &b" + round(43.17 * entity.getAIMoveSpeed(), 2) + " &2m/s");
} else {
Command.sendChatMessage("&4&lERROR: &cNot riding a compatible entity.");
}