Add permission to drop Quests Journal, fixes #332

This commit is contained in:
HappyPikachu 2018-03-13 22:57:37 -04:00
parent c8df950280
commit 8202fa60af
2 changed files with 8 additions and 2 deletions

View File

@ -178,9 +178,12 @@ public class PlayerListener implements Listener {
@EventHandler
public void onPlayerDropItem(PlayerDropItemEvent evt) {
if (ItemUtil.isJournal(evt.getItemDrop().getItemStack()))
if (ItemUtil.isJournal(evt.getItemDrop().getItemStack())) {
if (!evt.getPlayer().hasPermission("quests.admin.drop")) {
evt.setCancelled(true);
}
}
}
@EventHandler
public void onPlayerInteract(PlayerInteractEvent evt) {

View File

@ -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