mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 10:36:09 +01:00
Ignore inconsequential inventory clicks, fixes #1718
This commit is contained in:
parent
ea8b8fe24b
commit
1644f18549
@ -191,7 +191,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
final int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyRew + " "
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA
|
||||
+ plugin.getDependencies().getVaultEconomy().format(moneyRew) + ChatColor.GRAY + ")";
|
||||
}
|
||||
} else {
|
||||
@ -496,7 +496,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
||||
String text = getQueryText(context);
|
||||
if (plugin.getDependencies().getVaultEconomy() != null) {
|
||||
text = text.replace("<money>", ChatColor.AQUA
|
||||
+ (plugin.getDependencies().getVaultEconomy().currencyNamePlural() + ChatColor.YELLOW));
|
||||
+ plugin.getDependencies().getVaultEconomy().currencyNamePlural() + ChatColor.YELLOW);
|
||||
}
|
||||
return ChatColor.YELLOW + text;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.enchantment.EnchantItemEvent;
|
||||
import org.bukkit.event.inventory.CraftItemEvent;
|
||||
import org.bukkit.event.inventory.InventoryAction;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.inventory.InventoryType.SlotType;
|
||||
@ -42,6 +43,9 @@ public class ItemListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onCraftItem(final CraftItemEvent evt) {
|
||||
if (evt.getAction().equals(InventoryAction.NOTHING)) {
|
||||
return;
|
||||
}
|
||||
if (evt.getWhoClicked() instanceof Player) {
|
||||
final Player player = (Player) evt.getWhoClicked();
|
||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||
|
@ -84,6 +84,9 @@ public class PlayerListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onInventoryClickEvent(final InventoryClickEvent evt) {
|
||||
final InventoryAction ac = evt.getAction();
|
||||
if (ac.equals(InventoryAction.NOTHING)) {
|
||||
return;
|
||||
}
|
||||
if (ItemUtil.isItem(evt.getCurrentItem()) && ItemUtil.isJournal(evt.getCurrentItem())) {
|
||||
if (ac.equals(InventoryAction.MOVE_TO_OTHER_INVENTORY) || ac.equals(InventoryAction.DROP_ALL_SLOT)
|
||||
|| ac.equals(InventoryAction.DROP_ONE_SLOT)) {
|
||||
|
Loading…
Reference in New Issue
Block a user