mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-25 20:25:45 +01:00
Cancel hotkeying journal into inventory (#1619)
* Cancel hotkeying journal into inventory Previously, a journal could be moved into another inventory by putting it in a hotkey slot and pressing the corresponding hotkey while hovering over any slot in the target inventory. * syntax fix * forgot the return
This commit is contained in:
parent
e4b8779325
commit
fcad9600cd
@ -94,6 +94,14 @@ public class PlayerListener implements Listener {
|
|||||||
evt.setCancelled(true);
|
evt.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else if (ac.equals(InventoryAction.SWAP_WITH_CURSOR))) {
|
||||||
|
ItemStack item=evt.getWhoClicked().getInventory().getItem(event.getHotbarButton());
|
||||||
|
if (item!=null) {
|
||||||
|
if (ItemUtil.isItem(item) && ItemUtil.isJournal(item)) {
|
||||||
|
evt.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ItemUtil.isItem(evt.getCurrentItem()) && ItemUtil.isJournal(evt.getCurrentItem())
|
if (ItemUtil.isItem(evt.getCurrentItem()) && ItemUtil.isJournal(evt.getCurrentItem())
|
||||||
|| ItemUtil.isItem(evt.getCursor()) && ItemUtil.isJournal(evt.getCursor())) {
|
|| ItemUtil.isItem(evt.getCursor()) && ItemUtil.isJournal(evt.getCursor())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user