瀏覽代碼

Changed Call of the Wild, newly summoned pet's will have a custom name

Closes #972
TfT_02 12 年之前
父節點
當前提交
e831f0561a

+ 1 - 0
Changelog.txt

@@ -25,6 +25,7 @@ Version 1.4.06-dev
  = Fixed NPE when trying to tab-complete /mctop
  = Fixed Fishing treasures always having the same enchants
  ! Changed Berserk to add items to inventory rather than denying pickup
+ ! Changed Call of the Wild, newly summoned pet's will have a custom name. (added permission node to disable this)
  ! Changed Chimaera Wing's recipe result to use the ingredient Material
  ! Players will no longer pickup items to their hotbar while using Unarmed
  ! ExperienceAPI methods will now throw InvalidSkillException if the skill name passed in is invalid.

+ 5 - 0
src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java

@@ -198,6 +198,11 @@ public class TamingManager extends SkillManager {
             entity.setHealth(entity.getMaxHealth());
         }
 
+        if (Permissions.renamePets(player)) {
+            entity.setCustomName(player.getName() + "\'s " + StringUtils.getPrettyEntityTypeString(entity.getType())); //TODO Localize, perhaps in a different language it makes more sense to switch this around
+            entity.setCustomNameVisible(true);
+        }
+
         player.setItemInHand(new ItemStack(heldItem.getType(), heldItemAmount - summonAmount));
         player.sendMessage(LocaleLoader.getString("Taming.Summon.Complete"));
     }

+ 1 - 0
src/main/java/com/gmail/nossr50/util/Permissions.java

@@ -191,6 +191,7 @@ public final class Permissions {
     /* TAMING */
     public static boolean beastLore(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.beastlore"); }
     public static boolean callOfTheWild(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild"); }
+    public static boolean renamePets(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild_renamepets"); }
     public static boolean environmentallyAware(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.environmentallyaware"); }
     public static boolean fastFoodService(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.fastfoodservice"); }
     public static boolean gore(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.gore"); }

+ 3 - 0
src/main/resources/plugin.yml

@@ -514,6 +514,7 @@ permissions:
         children:
             mcmmo.ability.taming.beastlore: true
             mcmmo.ability.taming.callofthewild: true
+            mcmmo.ability.taming.callofthewild_renamepets: true
             mcmmo.ability.taming.environmentallyaware: true
             mcmmo.ability.taming.fastfoodservice: true
             mcmmo.ability.taming.gore: true
@@ -525,6 +526,8 @@ permissions:
         description: Allows access to the Beast Lore ability
     mcmmo.ability.taming.callofthewild:
         description: Allows access to the Call of the Wild ability
+    mcmmo.ability.taming.callofthewild_renamepets:
+        description: Pets spawned with Call of the Wild will have custom names
     mcmmo.ability.taming.environmentallyaware:
         description: Allows access to the Environmentally Aware ability
     mcmmo.ability.taming.fastfoodservice: