package eu.mhsl.minecraft.pixelblocks.listeners;

import eu.mhsl.minecraft.pixelblocks.utils.EventCanceling;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryPickupItemEvent;
import org.bukkit.event.inventory.InventoryType;

public class PreventHopperActionsListener implements Listener {
    @EventHandler
    public void onInventoryPickupItem(InventoryPickupItemEvent event) {
        EventCanceling.shouldCancelInPixelBlock(
            event,
            event.getItem().getWorld(),
            (pixelBlock) -> event.getInventory().getType() == InventoryType.HOPPER
        );
    }
}
