From df56d93aaa964cf5d4e954f535677fb1984747e9 Mon Sep 17 00:00:00 2001 From: Daniel Jarski <30324210+QuantumToasted@users.noreply.github.com> Date: Mon, 29 Mar 2021 17:08:40 -0500 Subject: [PATCH] Added Donkeys and Mules to the list of animals that display stats (#4282) ...in Beast Lore. I improperly assumed that donkeys and mules have fixed jump and movement speeds, but ones that are *bred* have variable stats just like horses. --- .../java/com/gmail/nossr50/skills/taming/TamingManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java index eb42b9899..3b7f6315d 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java @@ -249,8 +249,9 @@ public class TamingManager extends SkillManager { message = message.concat(LocaleLoader.getString("Combat.BeastLoreHealth", target.getHealth(), target.getMaxHealth())); - if (beast instanceof Horse) { - Horse horse = (Horse) beast; + // Bred mules & donkeys can actually have horse-like stats, but llamas cannot. + if (beast instanceof AbstractHorse && !(beast instanceof Llama)) { + AbstractHorse horse = (AbstractHorse) beast; double jumpStrength = horse.getAttribute(Attribute.HORSE_JUMP_STRENGTH).getValue(); // Taken from https://minecraft.gamepedia.com/Horse#Jump_strength jumpStrength = -0.1817584952 * Math.pow(jumpStrength, 3) + 3.689713992 * Math.pow(jumpStrength, 2) + 2.128599134 * jumpStrength - 0.343930367;