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.
This commit is contained in:
Daniel Jarski 2021-03-29 17:08:40 -05:00 committed by GitHub
parent 80e9111f78
commit df56d93aaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,8 +249,9 @@ public class TamingManager extends SkillManager {
message = message.concat(LocaleLoader.getString("Combat.BeastLoreHealth", target.getHealth(), target.getMaxHealth())); message = message.concat(LocaleLoader.getString("Combat.BeastLoreHealth", target.getHealth(), target.getMaxHealth()));
if (beast instanceof Horse) { // Bred mules & donkeys can actually have horse-like stats, but llamas cannot.
Horse horse = (Horse) beast; if (beast instanceof AbstractHorse && !(beast instanceof Llama)) {
AbstractHorse horse = (AbstractHorse) beast;
double jumpStrength = horse.getAttribute(Attribute.HORSE_JUMP_STRENGTH).getValue(); double jumpStrength = horse.getAttribute(Attribute.HORSE_JUMP_STRENGTH).getValue();
// Taken from https://minecraft.gamepedia.com/Horse#Jump_strength // 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; jumpStrength = -0.1817584952 * Math.pow(jumpStrength, 3) + 3.689713992 * Math.pow(jumpStrength, 2) + 2.128599134 * jumpStrength - 0.343930367;