mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-29 06:06:05 +01:00
Return cancelled objective events, part 2
This commit is contained in:
parent
cd4818bfee
commit
5604392814
@ -42,6 +42,9 @@ public class ItemListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onCraftItem(final CraftItemEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (event.getAction().equals(InventoryAction.NOTHING)) {
|
||||
return;
|
||||
}
|
||||
@ -94,6 +97,9 @@ public class ItemListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryClick(final InventoryClickEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (event.getWhoClicked() instanceof Player) {
|
||||
final Player player = (Player) event.getWhoClicked();
|
||||
if (event.getInventory().getType() == InventoryType.FURNACE
|
||||
@ -150,6 +156,9 @@ public class ItemListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onEnchantItem(final EnchantItemEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (plugin.canUseQuests(event.getEnchanter().getUniqueId())) {
|
||||
final ItemStack enchantedItem = event.getItem().clone();
|
||||
enchantedItem.setAmount(1);
|
||||
@ -188,6 +197,9 @@ public class ItemListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onConsumeItem(final PlayerItemConsumeEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (plugin.canUseQuests(event.getPlayer().getUniqueId())) {
|
||||
final ItemStack consumedItem = event.getItem().clone();
|
||||
consumedItem.setAmount(1);
|
||||
|
Loading…
Reference in New Issue
Block a user