From 67dc1dfe88445a5a666a62238a47730e98035e10 Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Mon, 11 Apr 2022 13:38:23 -0400 Subject: [PATCH] Send Silk Touch message to action bar --- .../java/me/blackvein/quests/listeners/BlockListener.java | 5 +++-- .../java/me/blackvein/quests/quests/BukkitQuestFactory.java | 2 +- core/src/main/resources/strings.yml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/me/blackvein/quests/listeners/BlockListener.java b/core/src/main/java/me/blackvein/quests/listeners/BlockListener.java index 4bb440897..c4d6dbc19 100644 --- a/core/src/main/java/me/blackvein/quests/listeners/BlockListener.java +++ b/core/src/main/java/me/blackvein/quests/listeners/BlockListener.java @@ -13,6 +13,7 @@ package me.blackvein.quests.listeners; import me.blackvein.quests.Quester; +import me.blackvein.quests.nms.ActionBarProvider; import me.blackvein.quests.quests.IQuest; import me.blackvein.quests.player.IQuester; import me.blackvein.quests.Quests; @@ -78,8 +79,8 @@ public class BlockListener implements Listener { if (currentStage.containsObjective(breakType)) { if (quest.getOptions().canIgnoreSilkTouch() && player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) { - Lang.send(player, ChatColor.RED + Lang.get(player, "optionSilkTouchFail") - .replace("", quest.getName())); + ActionBarProvider.sendActionBar(player, ChatColor.RED + Lang + .get(player, "optionSilkTouchFail").replace("", quest.getName())); } else { quester.breakBlock(quest, blockItemStack); diff --git a/core/src/main/java/me/blackvein/quests/quests/BukkitQuestFactory.java b/core/src/main/java/me/blackvein/quests/quests/BukkitQuestFactory.java index 071a372fa..7fbb02b37 100644 --- a/core/src/main/java/me/blackvein/quests/quests/BukkitQuestFactory.java +++ b/core/src/main/java/me/blackvein/quests/quests/BukkitQuestFactory.java @@ -149,7 +149,7 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi context.setSessionData(CK.Q_NAME, q.getName()); context.setSessionData(CK.Q_ASK_MESSAGE, q.getDescription()); context.setSessionData(CK.Q_FINISH_MESSAGE, q.getFinished()); - if(plugin.getDependencies().getCitizens() != null) { + if (plugin.getDependencies().getCitizens() != null) { if (q.getNpcStart() != null) { context.setSessionData(CK.Q_START_NPC, q.getNpcStart().getId()); } diff --git a/core/src/main/resources/strings.yml b/core/src/main/resources/strings.yml index 3d33b3417..579b22468 100644 --- a/core/src/main/resources/strings.yml +++ b/core/src/main/resources/strings.yml @@ -794,7 +794,7 @@ requirements: "Requirements" requirementsItemFail: "Unable to collect required item. Is it in your off-hand?" conditionFailQuit: "Condition failed. You have quit ." conditionFailRetry: "Condition not yet met for this stage of ." -optionSilkTouchFail: "Unable to progress with the Silk Touch enchantment." +optionSilkTouchFail: "Cannot progress with the Silk Touch enchantment." with: "with" to: "to" blocksWithin: "within blocks of"