From e831f0561aceee5093caab0ef5a35a8a22569057 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Thu, 18 Apr 2013 23:04:27 +0200 Subject: [PATCH] Changed Call of the Wild, newly summoned pet's will have a custom name Closes #972 --- Changelog.txt | 1 + .../java/com/gmail/nossr50/skills/taming/TamingManager.java | 5 +++++ src/main/java/com/gmail/nossr50/util/Permissions.java | 1 + src/main/resources/plugin.yml | 3 +++ 4 files changed, 10 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index dda6ee9d5..aabfd1b71 100644 --- a/Changelog.txt +++ b/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. 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 db3e967e7..095dac600 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/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")); } diff --git a/src/main/java/com/gmail/nossr50/util/Permissions.java b/src/main/java/com/gmail/nossr50/util/Permissions.java index 3111ddaef..3b366e7ae 100644 --- a/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/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"); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index f889c4e80..ef1720d54 100644 --- a/src/main/resources/plugin.yml +++ b/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: