mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-28 20:18:32 +01:00
Disallow placing of the Quests Journal within Lecterns
This commit is contained in:
parent
4bc5e989e0
commit
064ef978dc
@ -211,6 +211,13 @@ public class PlayerListener implements Listener {
|
||||
// Do nothing, getHand() not present pre-1.9
|
||||
}
|
||||
if (e == null || e.equals(EquipmentSlot.HAND)) { //If the event is fired by HAND (main hand)
|
||||
if (evt.hasBlock() && evt.getClickedBlock().getType().name().equals("LECTERN")) {
|
||||
if (ItemUtil.isJournal(evt.getPlayer().getItemInHand())) {
|
||||
evt.setCancelled(true);
|
||||
evt.getPlayer().sendMessage(ChatColor.RED + Lang.get(evt.getPlayer(), "journalDenied"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
|
||||
if (evt.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
||||
final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
|
Loading…
Reference in New Issue
Block a user