From 1cf1c6fab8f56f06a395fb15ec831eadeb0c2a90 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 13 Jan 2019 22:09:54 -0800 Subject: [PATCH] ChimaeraWing now uses the action bar --- Changelog.txt | 1 + .../gmail/nossr50/config/AdvancedConfig.java | 2 +- .../interactions/NotificationType.java | 4 ++- .../com/gmail/nossr50/util/ChimaeraWing.java | 16 +++++---- src/main/resources/advanced.yml | 34 ++++++++++--------- .../resources/locale/locale_en_US.properties | 1 + 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index e868fb4e9..d2fb690e0 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -51,6 +51,7 @@ Version 2.1.0 = (MySQL) You can now inspect offline players = (MySQL) When converting from MySQL to flatfile mcMMO will now properly include all users in the conversion process + (Party) Parties can now have size limits (configurable in config.yml), party size is unlimited by default + ! (Item) Improved some of the messages sent to the player regarding the Chimaera Wing ! (Party) Party member list will only include members of the party that you can see (aren't vanished) ! (Skills) Some skill level rank requirements have changed ! (Skills) Fixed an edge case bug where Blast Mining wouldn't inform the player that it was on cooldown diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index cb601b41b..8a8ac0924 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -699,7 +699,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { /* Interaction Settings */ public boolean doesNotificationUseActionBar(NotificationType notificationType) { - return config.getBoolean("Skills.FeedBack.ActionBarNotifications."+notificationType.toString(), true); + return config.getBoolean("Feedback.ActionBarNotifications."+notificationType.toString(), true); } /* diff --git a/src/main/java/com/gmail/nossr50/datatypes/interactions/NotificationType.java b/src/main/java/com/gmail/nossr50/datatypes/interactions/NotificationType.java index a8a63f712..5abf780fd 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/interactions/NotificationType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/interactions/NotificationType.java @@ -5,18 +5,20 @@ package com.gmail.nossr50.datatypes.interactions; */ public enum NotificationType { XP_GAIN("ExperienceGain"), + NO_PERMISSION("NoPermission"), SUBSKILL_UNLOCKED("SubSkillUnlocked"), LEVEL_UP_MESSAGE("LevelUps"), HOLIDAY("Holiday"), SUBSKILL_MESSAGE("SubSkillInteraction"), SUBSKILL_MESSAGE_FAILURE("SubSkillFailure"), TOOL("ToolReady"), - UNSKILLED("LevelRequirementNotMet"), + REQUIREMENTS_NOT_MET("RequirementsNotMet"), ABILITY_OFF("AbilityOff"), ABILITY_COOLDOWN("AbilityCoolDown"), ABILITY_REFRESHED("AbilityRefreshed"), SUPER_ABILITY("SuperAbilityInteraction"), SUPER_ABILITY_ALERT_OTHERS("SuperAbilityAlertOthers"), + ITEM_MESSAGE("ItemMessage"), PARTY_MESSAGE("PartyMessage"); final String niceName; diff --git a/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java b/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java index 468be7c94..ef94b3e32 100644 --- a/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java +++ b/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java @@ -1,10 +1,12 @@ package com.gmail.nossr50.util; import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.items.ChimaeraWingWarmup; +import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.SkillUtils; @@ -43,7 +45,7 @@ public final class ChimaeraWing { } if (!Permissions.chimaeraWing(player)) { - player.sendMessage(LocaleLoader.getString("mcMMO.NoPermission")); + NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission"); return; } @@ -56,7 +58,7 @@ public final class ChimaeraWing { int amount = inHand.getAmount(); if (amount < Config.getInstance().getChimaeraUseCost()) { - player.sendMessage(LocaleLoader.getString("Skills.NeedMore", LocaleLoader.getString("Item.ChimaeraWing.Name"))); + NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough",String.valueOf(Config.getInstance().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name"); return; } @@ -67,7 +69,7 @@ public final class ChimaeraWing { int timeRemaining = SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, cooldown, player); if (timeRemaining > 0) { - player.sendMessage(LocaleLoader.getString("Item.Generic.Wait", timeRemaining)); + NotificationManager.sendPlayerInformation(player, NotificationType.ABILITY_COOLDOWN, "Item.Generic.Wait", String.valueOf(timeRemaining)); return; } } @@ -79,7 +81,7 @@ public final class ChimaeraWing { int timeRemaining = SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, hurtCooldown, player); if (timeRemaining > 0) { - player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", timeRemaining)); + NotificationManager.sendPlayerInformation(player, NotificationType.ITEM_MESSAGE, "Item.Injured.Wait", String.valueOf(timeRemaining)); return; } } @@ -89,7 +91,7 @@ public final class ChimaeraWing { if (Config.getInstance().getChimaeraPreventUseUnderground()) { if (location.getY() < player.getWorld().getHighestBlockYAt(location)) { player.getInventory().setItemInMainHand(new ItemStack(getChimaeraWing(amount - Config.getInstance().getChimaeraUseCost()))); - player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Fail")); + NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.Fail"); player.updateInventory(); player.setVelocity(new Vector(0, 0.5D, 0)); CombatUtils.dealDamage(player, Misc.getRandom().nextInt((int) (player.getHealth() - 10))); @@ -103,7 +105,7 @@ public final class ChimaeraWing { long warmup = Config.getInstance().getChimaeraWarmup(); if (warmup > 0) { - player.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup)); + NotificationManager.sendPlayerInformation(player, NotificationType.ITEM_MESSAGE, "Teleport.Commencing", String.valueOf(warmup)); new ChimaeraWingWarmup(mcMMOPlayer).runTaskLater(mcMMO.p, 20 * warmup); } else { @@ -136,7 +138,7 @@ public final class ChimaeraWing { SoundManager.sendSound(player, location, SoundType.CHIMAERA_WING); } - player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Pass")); + NotificationManager.sendPlayerInformation(player, NotificationType.ITEM_MESSAGE, "Item.ChimaeraWing.Pass"); } public static ItemStack getChimaeraWing(int amount) { diff --git a/src/main/resources/advanced.yml b/src/main/resources/advanced.yml index 20c45a53e..310b238a9 100644 --- a/src/main/resources/advanced.yml +++ b/src/main/resources/advanced.yml @@ -13,23 +13,25 @@ # # Settings for the Skills ### +Feedback: + # Turning these to false will have them printed in chat instead + ActionBarNotifications: + AbilityOff: true + RequirementsNotMet: true + AbilityCoolDown: true + LevelUps: true + Holiday: true + ToolReady: true + SubSkillInteraction: true + SubSkillFailure: true + SubSkillUnlocked: true + SuperAbilityInteraction: true + SuperAbilityAlertOthers: true + ExperienceGain: true + ItemMessage: true + NoPermission: true + PartyMessage: true Skills: - Feedback: - # Turning these to false will have them printed in chat instead - ActionBarNotifications: - AbilityOff: true - LevelRequirementNotMet: true - AbilityCoolDown: true - LevelUps: true - Holiday: true - ToolReady: true - SubSkillInteraction: true - SubSkillFailure: true - SubSkillUnlocked: true - SuperAbilityInteraction: true - SuperAbilityAlertOthers: true - ExperienceGain: true - PartyMessage: true General: Ability: Length: diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 99dbea269..5813dba35 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -869,6 +869,7 @@ Item.ChimaeraWing.Fail=**CHIMAERA WING FAILED!** Item.ChimaeraWing.Pass=**CHIMAERA WING** Item.ChimaeraWing.Name=Chimaera Wing Item.ChimaeraWing.Lore=[[GRAY]]Teleports you to your bed. +Item.ChimaeraWing.NotEnough=[[RED]]You need [[YELLOW]]{0}[[RED]] more [[GOLD]]{1}[[RED]]! Item.Generic.Wait=[[RED]]You need to wait before you can use this again! [[YELLOW]]({0}s) Item.Injured.Wait=You were injured recently and must wait to use this. [[YELLOW]]({0}s) Item.FluxPickaxe.Name=Flux Pickaxe