Merge pull request #4042 from QuantumToasted/master

Support jump strength stats for horses in Beast Lore
This commit is contained in:
Robert A. C 2019-09-02 15:18:10 -06:00 committed by GitHub
commit 2bc2e5bb32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -256,9 +256,13 @@ public class TamingManager extends SkillManager {
message = message.concat(LocaleLoader.getString("Combat.BeastLoreHealth", target.getHealth(), target.getMaxHealth()));
if (beast instanceof AbstractHorse) {
AbstractHorse horse = (AbstractHorse) beast;
message = message.concat("\n" + LocaleLoader.getString("Combat.BeastLoreHorseSpeed", horse.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getValue() * 43));
if (beast instanceof Horse) {
Horse horse = (Horse) 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;
message = message.concat("\n" + LocaleLoader.getString("Combat.BeastLoreHorseSpeed", horse.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getValue() * 43))
.concat("\n" + LocaleLoader.getString("Combat.BeastLoreHorseJumpStrength", jumpStrength));
}
player.sendMessage(message);

View File

@ -556,6 +556,7 @@ Combat.BeastLore=[[GREEN]]**BEAST LORE**
Combat.BeastLoreHealth=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/{1})
Combat.BeastLoreOwner=[[DARK_AQUA]]Owner ([[RED]]{0}[[DARK_AQUA]])
Combat.BeastLoreHorseSpeed=[[DARK_AQUA]]Horse Movement Speed ([[GREEN]]{0} blocks/s[[DARK_AQUA]])
Combat.BeastLoreHorseJumpStrength=[[DARK_AQUA]]Horse Jump Strength ([[GREEN]]Max {0} blocks[[DARK_AQUA]])
Combat.Gore=[[GREEN]]**GORED**
Combat.StruckByGore=**YOU HAVE BEEN GORED**
Combat.TargetDazed=Target was [[DARK_RED]]Dazed