From 8202fa60af56685695fa2985042580a6b2648365 Mon Sep 17 00:00:00 2001 From: HappyPikachu Date: Tue, 13 Mar 2018 22:57:37 -0400 Subject: [PATCH] Add permission to drop Quests Journal, fixes #332 --- src/main/java/me/blackvein/quests/PlayerListener.java | 7 +++++-- src/main/resources/plugin.yml | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/blackvein/quests/PlayerListener.java b/src/main/java/me/blackvein/quests/PlayerListener.java index 02979b595..07edcf249 100644 --- a/src/main/java/me/blackvein/quests/PlayerListener.java +++ b/src/main/java/me/blackvein/quests/PlayerListener.java @@ -178,8 +178,11 @@ public class PlayerListener implements Listener { @EventHandler public void onPlayerDropItem(PlayerDropItemEvent evt) { - if (ItemUtil.isJournal(evt.getItemDrop().getItemStack())) - evt.setCancelled(true); + if (ItemUtil.isJournal(evt.getItemDrop().getItemStack())) { + if (!evt.getPlayer().hasPermission("quests.admin.drop")) { + evt.setCancelled(true); + } + } } @EventHandler diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 44758dee4..f504f58d9 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -83,6 +83,9 @@ permissions: quests.admin.reload: description: Reload all Quests default: op + quests.admin.drop: + description: Drop Quests Journal + default: op quests.editor.editor: description: Open Quests Editor default: op