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.entity.EntityPlaceEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;

public class PreventEntityPlacementListener implements Listener {
    @EventHandler
    public void preventPlace(EntityPlaceEvent event) {
        EventCanceling.cancelIfInPixelWorld(event, event.getBlock().getWorld());
    }

    @EventHandler
    public void preventProjectile(ProjectileLaunchEvent event) {
        EventCanceling.cancelIfInPixelWorld(event, event.getEntity().getWorld());
    }
}
