Ver Fonte

Update to Beast Lore

Removed movement speed information for llamas, and added jump strength info for horses. Also added another locale string to display this information.
Daniel Jarski há 6 anos atrás
pai
commit
98f8e049f3

+ 7 - 3
src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java

@@ -256,9 +256,13 @@ 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 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);
         player.sendMessage(message);

+ 1 - 0
src/main/resources/locale/locale_en_US.properties

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