diff --git a/Changelog.txt b/Changelog.txt index dd2192d8b..f942dfad3 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -87,8 +87,7 @@ Version 1.4.00-dev - Removed Party "master/apprentice" system. Replaced with the new party XP share feature. - Removed unused "healthbar" files from the resources - Removed config options for disabling commands from the config.yml. This should instead be done through permissions. - - Removed Chimaera Wing - - Removed /mcc command. Replaced with /mcmmo [?|help|commands] + - Removed /mcc command. Replaced with /mcmmo [?|help|commands] Version 1.3.14 + Added new Hylian Luck skill to Herbalism. diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index f978c477f..602e9f9c6 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -88,6 +88,11 @@ public class Config extends ConfigLoader { public boolean getBlockModsEnabled() { return config.getBoolean("Mods.Block_Mods_Enabled", false); } public boolean getEntityModsEnabled() { return config.getBoolean("Mods.Entity_Mods_Enabled", false); } + /* Items */ + public int getChimaeraCost() { return config.getInt("Items.Chimaera_Wing.Feather_Cost", 10); } + public int getChimaeraItemId() { return config.getInt("Items.Chimaera_Wing.Item_ID", 288); } + public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); } + /* PARTY SETTINGS */ public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); } public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); } diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 0e7c4882e..3c9c7c6f5 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -43,6 +43,7 @@ import com.gmail.nossr50.skills.utilities.AbilityType; import com.gmail.nossr50.skills.utilities.SkillTools; import com.gmail.nossr50.skills.utilities.SkillType; import com.gmail.nossr50.util.BlockChecks; +import com.gmail.nossr50.util.ChimaeraWing; import com.gmail.nossr50.util.Hardcore; import com.gmail.nossr50.util.ItemChecks; import com.gmail.nossr50.util.Misc; @@ -351,6 +352,8 @@ public class PlayerListener implements Listener { SkillTools.activationCheck(player, SkillType.UNARMED); SkillTools.activationCheck(player, SkillType.WOODCUTTING); } + + ChimaeraWing.activationCheck(player); } /* GREEN THUMB CHECK */ @@ -373,6 +376,9 @@ public class PlayerListener implements Listener { SkillTools.activationCheck(player, SkillType.WOODCUTTING); } + /* ITEM CHECKS */ + ChimaeraWing.activationCheck(player); + break; case LEFT_CLICK_AIR: diff --git a/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java b/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java new file mode 100644 index 000000000..4bff945a1 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java @@ -0,0 +1,62 @@ +package com.gmail.nossr50.util; + +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.datatypes.PlayerProfile; +import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.skills.utilities.SkillTools; + +public final class ChimaeraWing { + private ChimaeraWing() {} + + /** + * Check for item usage. + * + * @param player Player whose item usage to check + */ + public static void activationCheck(Player player) { + ItemStack inHand = player.getItemInHand(); + + if (!Config.getInstance().getChimaeraEnabled() || inHand.getTypeId() != Config.getInstance().getChimaeraItemId()) { + return; + } + + PlayerProfile profile = Users.getPlayer(player).getProfile(); + Block block = player.getLocation().getBlock(); + int amount = inHand.getAmount(); + long recentlyHurt = profile.getRecentlyHurt(); + + if (Permissions.chimaeraWing(player) && inHand.getTypeId() == Config.getInstance().getChimaeraItemId()) { + if (SkillTools.cooldownOver(recentlyHurt, 60, player) && amount >= Config.getInstance().getChimaeraCost()) { + player.setItemInHand(new ItemStack(Config.getInstance().getChimaeraItemId(), amount - Config.getInstance().getChimaeraCost())); + + for (int y = 1; block.getY() + y < player.getWorld().getMaxHeight(); y++) { + if (!(block.getRelative(0, y, 0).getType() == Material.AIR)) { + player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Fail")); + player.teleport(block.getRelative(0, y - 1, 0).getLocation()); + return; + } + } + + if (player.getBedSpawnLocation() != null && player.getBedSpawnLocation().getBlock().getType() == Material.BED_BLOCK) { + player.teleport(player.getBedSpawnLocation()); + } + else { + player.teleport(player.getWorld().getSpawnLocation()); + } + + player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Pass")); + } + else if (!SkillTools.cooldownOver(recentlyHurt, 60, player) && amount >= Config.getInstance().getChimaeraCost()) { + player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", SkillTools.calculateTimeLeft(recentlyHurt, 60, player))); + } + else if (amount <= Config.getInstance().getChimaeraCost()) { + player.sendMessage(LocaleLoader.getString("Skills.NeedMore", StringUtils.getPrettyItemString(Config.getInstance().getChimaeraItemId()))); + } + } + } +} diff --git a/src/main/java/com/gmail/nossr50/util/Permissions.java b/src/main/java/com/gmail/nossr50/util/Permissions.java index eac25fc59..285b5e1c3 100644 --- a/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/src/main/java/com/gmail/nossr50/util/Permissions.java @@ -570,6 +570,14 @@ public final class Permissions { return player.hasPermission("mcmmo.ability.smelting.vanillaxpboost"); } + /* + * MCMMO.ITEM.* + */ + + public static boolean chimaeraWing(Player player) { + return hasPermission(player, "mcmmo.item.chimaerawing"); + } + /* * MCMMO.COMMANDS.* */ diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index e197b2d09..b4363f1b8 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -59,6 +59,15 @@ Mods: Block_Mods_Enabled: false Entity_Mods_Enabled: false +# +# Settings for mcMMO items +### +Items: + Chimaera_Wing: + Enabled: true + Feather_Cost: 10 + Item_ID: 288 + # # Settings for Parties ### diff --git a/src/main/resources/locale/locale_cs_CZ.properties b/src/main/resources/locale/locale_cs_CZ.properties index 5fc4580c2..8425df775 100644 --- a/src/main/resources/locale/locale_cs_CZ.properties +++ b/src/main/resources/locale/locale_cs_CZ.properties @@ -386,6 +386,8 @@ Inspect.Offline=[[RED]]Nem\u00e1\u0161 pr\u00e1va kontrolovat hr\u00e1\u010de co Inspect.OfflineStats=mcMMO Statistiky pro offline hrace [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Statistiky pro [[YELLOW]]{0} Inspect.TooFar=[[RED]]Jsi moc daleko pro prozkoum\u00e1n\u00ed tohoto hr\u00e1\u010de. +Item.ChimaeraWing.Fail=**K\u0158\u00cdDLO CHIM\u00c9RY SELHALO!** +Item.ChimaeraWing.Pass=**KRIDLO CHIMERY** Item.Injured.Wait=Predchvili jsi byl zranen a musis pockat az budes moci pouzit tuto schopnost. [[YELLOW]]({0}s) Skills.Disarmed=[[DARK_RED]]Byl jsi odzbrojen! Skills.Header=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- diff --git a/src/main/resources/locale/locale_cy.properties b/src/main/resources/locale/locale_cy.properties index d7b5aab80..14179b01e 100644 --- a/src/main/resources/locale/locale_cy.properties +++ b/src/main/resources/locale/locale_cy.properties @@ -459,6 +459,8 @@ Inspect.Offline=[[RED]]You do not have permission to inspect offline players! Inspect.OfflineStats=mcMMO Stats for Offline Player [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Stats for [[YELLOW]]{0} Inspect.TooFar=[[RED]]You are too far away to inspect that player! +Item.ChimaeraWing.Fail=**CHIMAERA WING FAILED!** +Item.ChimaeraWing.Pass=**CHIMAERA ADAIN** Item.Injured.Wait=You were injured recently and must wait to use this. [[YELLOW]]({0}s) Skills.Disarmed=[[DARK_RED]] Rydych wedi cael eich diarfogi! Skills.Header=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- diff --git a/src/main/resources/locale/locale_da.properties b/src/main/resources/locale/locale_da.properties index 56be9ebee..01134479c 100644 --- a/src/main/resources/locale/locale_da.properties +++ b/src/main/resources/locale/locale_da.properties @@ -461,6 +461,8 @@ Inspect.Offline=[[RED]] Du har ikke tilladelse til at inspicere offline spillere Inspect.OfflineStats=mcMMO Stats for Offline Spillere [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO F\u00e6rdigheder for [[YELLOW]]{0} Inspect.TooFar=[[RED]]Du er for langt v\u00e6k til at inspicere denne spiller! +Item.ChimaeraWing.Fail=**KIM\u00c6RE VINGE FEJLEDE!** +Item.ChimaeraWing.Pass=**KIM\u00c6RE VINGE** Item.Injured.Wait=Du var for nylig skadet og m\u00e5 derfor vente med at bruge dette. [[YELLOW]]({0}s) Skills.Disarmed=[[DARK_RED]]Du er blevet afv\u00e6bnet! Skills.Header=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- diff --git a/src/main/resources/locale/locale_de.properties b/src/main/resources/locale/locale_de.properties index 38e109af8..329e7401f 100644 --- a/src/main/resources/locale/locale_de.properties +++ b/src/main/resources/locale/locale_de.properties @@ -470,6 +470,8 @@ Inspect.Offline=[[RED]]Du hast keine Rechte um ausgeloggte Spieler zu inspiziere Inspect.OfflineStats=mcMMO Werte f\u00fcr ausgeloggte Spieler [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Werte f\u00fcr [[YELLOW]]{0} Inspect.TooFar=[[RED]]Du bist zu weit entfernt um diesen Spieler zu inspizieren! +Item.ChimaeraWing.Fail=**CHIMAERA FL\u00dcGEL Fehlgeschlagen!** +Item.ChimaeraWing.Pass=**CHIMAERA FL\u00dcGEL** Item.Injured.Wait=[[WHITE]]Du wurdest k\u00fcrzlich verletzt und musst [[YELLOW]]({0}s) [[WHITE]]warten bis du dies wieder nutzen kannst. Skills.Disarmed=[[DARK_RED]]Du wurdest entwaffnet! Skills.Header=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 7d532cff1..70816dc1f 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -616,6 +616,8 @@ Inspect.Stats=[[GREEN]]mcMMO Stats for [[YELLOW]]{0} Inspect.TooFar=[[RED]]You are too far away to inspect that player! #ITEMS +Item.ChimaeraWing.Fail=**CHIMAERA WING FAILED!** +Item.ChimaeraWing.Pass=**CHIMAERA WING** Item.Injured.Wait=You were injured recently and must wait to use this. [[YELLOW]]({0}s) #SKILLS @@ -722,4 +724,4 @@ Commands.Description.Skill=Display detailed mcMMO skill info for {0} Commands.Description.skillreset=Reset mcMMO levels for a user Commands.Description.vampirism=Modify the mcMMO vampirism percentage or toggle vampirism mode on/off Commands.Description.xplock=Lock your mcMMO XP bar to a specific mcMMO skill -Commands.Description.xprate=Modify the mcMMO XP rate or start an mcMMO XP event \ No newline at end of file +Commands.Description.xprate=Modify the mcMMO XP rate or start an mcMMO XP event diff --git a/src/main/resources/locale/locale_es.properties b/src/main/resources/locale/locale_es.properties index 15954ff1c..80a5e1242 100644 --- a/src/main/resources/locale/locale_es.properties +++ b/src/main/resources/locale/locale_es.properties @@ -382,6 +382,8 @@ Inspect.Offline=[[RED]]\u00a1No tienen permiso para inspeccionar jugadores fuera Inspect.OfflineStats=Estad\u00edsticas de mcMMO para el Jugador Desconectado [[YELLOW]]{0} Inspect.Stats=[[GREEN]]Estad\u00edsticas de mcMMO para [[YELLOW]]{0} Inspect.TooFar=[[RED]]\u00a1Est\u00e1s demasiado lejos como para inspeccionar a ese jugador! +Item.ChimaeraWing.Fail=**\u00a1LAS ALAS DE QUIMERA FALLARON!** +Item.ChimaeraWing.Pass=**\u00a1ALAS DE QUIMERA!** Item.Injured.Wait=Te lesionaste recientemente y ten\u00e9s que esperar para usar esto. [[YELLOW]]({0}seg) Skills.Disarmed=[[DARK_RED]]\u00a1Has sido desarmado! Skills.Header=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- diff --git a/src/main/resources/locale/locale_fr.properties b/src/main/resources/locale/locale_fr.properties index 01ca39c41..43a06123c 100644 --- a/src/main/resources/locale/locale_fr.properties +++ b/src/main/resources/locale/locale_fr.properties @@ -373,6 +373,8 @@ Inspect.Offline=[[RED]]Tu n\'as pas la permission d\'inspecter un joueur hors li Inspect.OfflineStats=mcMMO Stats for Offline Player [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Stats for [[YELLOW]]{0} Inspect.TooFar=[[RED]]Vous \u00eates trop \u00e9loign\u00e9 de ce joueur pour l\'inspecter ! +Item.ChimaeraWing.Fail=**\u00c9CHEC D\'AILE DE CHIM\u00c8RE !** +Item.ChimaeraWing.Pass=**AILE DE CHIM\u00c8RE** Item.Injured.Wait=Vous avez \u00e9t\u00e9 bless\u00e9 r\u00e9cemment et devez attendre pour utiliser cela. [[YELLOW]]({0}s) Skills.Disarmed=[[DARK_RED]]Vous avez \u00e9t\u00e9 d\u00e9sarm\u00e9 ! Skills.Header=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- diff --git a/src/main/resources/locale/locale_it.properties b/src/main/resources/locale/locale_it.properties index 51e9d0446..5e01f5cf5 100644 --- a/src/main/resources/locale/locale_it.properties +++ b/src/main/resources/locale/locale_it.properties @@ -548,6 +548,8 @@ Inspect.Offline=[[RED]]Non hai il permesso di esaminare giocatori disconnessi! Inspect.OfflineStats=Statistiche mcMMO del Giocatore Disconnesso [[YELLOW]]{0} Inspect.Stats=[[GREEN]]Statistiche mcMMO di [[YELLOW]]{0} Inspect.TooFar=[[RED]]Sei troppo lontano da quel giocatore per esaminarlo! +Item.ChimaeraWing.Fail=**ALA CHIMERA FALLITA!** +Item.ChimaeraWing.Pass=**ALA CHIMERA** Item.Injured.Wait=Sei stato ferito di recente e devi aspettare per usarla. [[YELLOW]]({0}s) Skills.Disarmed=[[DARK_RED]]Sei stato disarmato!! Skills.Header=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- diff --git a/src/main/resources/locale/locale_pl.properties b/src/main/resources/locale/locale_pl.properties index 8a5d8a7e6..091b71c43 100644 --- a/src/main/resources/locale/locale_pl.properties +++ b/src/main/resources/locale/locale_pl.properties @@ -134,6 +134,8 @@ Guides.Smelting=Wkrotce... Inspect.OfflineStats=mcMMO Stats for Offline Player [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Stats for [[YELLOW]]{0} Inspect.TooFar=[[RED]]You are too far away to inspect that player! +Item.ChimaeraWing.Fail=**CHIMAERA WING FAILED!** +Item.ChimaeraWing.Pass=**SKRZYD\u0141O CHIMERY** Skills.Disarmed=[[DARK_RED]]Zostales rozbrojony! Skills.NeedMore=[[DARK_RED]]Potrzebujesz wiecej Skills.TooTired=[[RED]]Musisz odpoczac zanim ponownie uzyjesz tej umiejetnosci. diff --git a/src/main/resources/locale/locale_ru.properties b/src/main/resources/locale/locale_ru.properties index 93cf47e2d..e60515ad3 100644 --- a/src/main/resources/locale/locale_ru.properties +++ b/src/main/resources/locale/locale_ru.properties @@ -526,6 +526,8 @@ Inspect.Offline=[[RED]]\u0423 \u0412\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440 Inspect.OfflineStats=mcMMO \u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0434\u043b\u044f \u041e\u0444\u0444\u043b\u0430\u0439\u043d \u0418\u0433\u0440\u043e\u043a\u043e\u0432 [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO \u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0434\u043b\u044f [[YELLOW]]{0} Inspect.TooFar=[[RED]]\u0412\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u0430\u043b\u0435\u043a\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430! +Item.ChimaeraWing.Fail=**\u041a\u0420\u042b\u041b\u042c\u042f \u0425\u0418\u041c\u0415\u0420\u042b \u041d\u0415 \u0421\u041c\u041e\u0413\u041b\u0418 \u0423\u041d\u0415\u0421\u0422\u0418 \u0412\u0410\u0421!** +Item.ChimaeraWing.Pass=**\u041a\u0420\u042b\u041b\u042c\u042f \u0425\u0418\u041c\u0415\u0420\u042b \u0423\u041d\u0415\u0421\u041b\u0418 \u0412\u0410\u0421!** Item.Injured.Wait=\u0412\u044b \u0431\u044b\u043b\u0438 \u0440\u0430\u043d\u0435\u043d\u044b \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e. [[YELLOW]]({0}s) Skills.Disarmed=[[DARK_RED]]\u0412\u044b \u043e\u0431\u0435\u0437\u043e\u0440\u0443\u0436\u0435\u043d\u044b! Skills.Header=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- diff --git a/src/main/resources/locale/locale_zh_CN.properties b/src/main/resources/locale/locale_zh_CN.properties index 53faabaea..823156da5 100644 --- a/src/main/resources/locale/locale_zh_CN.properties +++ b/src/main/resources/locale/locale_zh_CN.properties @@ -428,6 +428,8 @@ Inspect.Offline=[[RED]]\u4f60\u6ca1\u6709\u67e5\u8be2\u4e0d\u5728\u7ebf\u73a9\u5 Inspect.OfflineStats=\u4e0d\u5728\u7ebf\u73a9\u5bb6\u7684mcmmo\u7edf\u8ba1\u4fe1\u606f [[YELLOW]]{0} Inspect.Stats=[[YELLOW]]{0} \u7684 [[GREEN]]mcMMO \u7edf\u8ba1\u4fe1\u606f Inspect.TooFar=[[RED]]\u4f60\u65e0\u6cd5\u68c0\u67e5\u90a3\u4e2a\u73a9\u5bb6\u56e0\u4e3a\u4f60\u4eec\u8ddd\u79bb\u592a\u8fdc\u4e86! +Item.ChimaeraWing.Fail=**\u5947\u7f8e\u62c9\u4e4b\u7ffc\u5931\u8d25\u4e86!** +Item.ChimaeraWing.Pass=**\u5947\u7f8e\u62c9\u4e4b\u7ffc** Item.Injured.Wait=\u4f60\u6700\u8fd1\u53d7\u4f24\u4e86\u6240\u4ee5\u4f60\u5fc5\u987b\u7b49\u4e00\u6bb5\u65f6\u95f4\u624d\u80fd\u4f7f\u7528\u8fd9\u4e2a. [[YELLOW]]({0}s) Skills.Disarmed=[[DARK_RED]]\u4f60\u88ab\u7f34\u68b0\u4e86! Skills.Header=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 6218b6ffe..a85154e5c 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -403,7 +403,7 @@ permissions: mcmmo.ability.smelting.secondsmelt: description: Allows access to the Second Smelt ability mcmmo.ability.smelting.vanillaxpboost: - description: Allows vanilla XP boost from Smelting + description: Allows vanilla XP boost from Smelting mcmmo.ability.swords.*: default: false description: Allows access to all Swords abilities @@ -544,7 +544,19 @@ permissions: mcmmo.chat.adminchat: description: Allows participation in admin chat mcmmo.chat.partychat: - description: Allows participation in party chat + description: Allows participation in party chat + mcmmo.item.*: + description: Implies all mcmmo.item permissions + children: + mcmmo.item.all: true + mcmmo.item.all: + description: Implies all mcmmo.item permissions + children: + mcmmo.item.chimaerawing: true + mcmmo.item.chimaerawing: + description: Allows use of Chimaera Wing item + mcmmo.motd: + description: Allows access to the motd mcmmo.commands.*: default: false description: Implies all mcmmo.commands permissions.