Fixed all listener classes not being final

This commit is contained in:
Intelli 2022-03-01 20:05:13 -07:00
parent 6714ded600
commit 7c7fd200d2
7 changed files with 13 additions and 11 deletions

View File

@ -13,9 +13,10 @@ import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionType;
import net.coreprotect.consumer.Queue;
import net.coreprotect.listener.entity.EntityPickupItemListener;
public class PlayerPickupArrowListener extends EntityPickupItemListener implements Listener {
public final class PlayerPickupArrowListener extends Queue implements Listener {
public static ItemStack getArrowType(AbstractArrow arrow) {
ItemStack itemStack = null;

View File

@ -27,9 +27,9 @@ import net.coreprotect.consumer.Queue;
import net.coreprotect.database.Database;
import net.coreprotect.model.BlockGroup;
public class BlockExplodeListener extends Queue implements Listener {
public final class BlockExplodeListener extends Queue implements Listener {
protected static void processBlockExplode(String user, World world, List<Block> blockList) {
public static void processBlockExplode(String user, World world, List<Block> blockList) {
HashMap<Location, Block> blockMap = new HashMap<>();
for (Block block : blockList) {

View File

@ -25,7 +25,7 @@ import net.coreprotect.model.BlockGroup;
import net.coreprotect.thread.CacheHandler;
import net.coreprotect.utility.Util;
public final class BlockIgniteListener extends ProjectileLaunchListener implements Listener {
public final class BlockIgniteListener extends Queue implements Listener {
@EventHandler(priority = EventPriority.MONITOR)
protected void onBlockIgnite(BlockIgniteEvent event) {
@ -128,7 +128,7 @@ public final class BlockIgniteListener extends ProjectileLaunchListener implemen
}
else {
if (event.getCause() == IgniteCause.FIREBALL) {
playerLaunchProjectile(event.getPlayer().getLocation(), event.getPlayer().getName(), new ItemStack(Material.FIRE_CHARGE), 1, -1, 1, ItemLogger.ITEM_THROW);
ProjectileLaunchListener.playerLaunchProjectile(event.getPlayer().getLocation(), event.getPlayer().getName(), new ItemStack(Material.FIRE_CHARGE), 1, -1, 1, ItemLogger.ITEM_THROW);
}
Player player = event.getPlayer();

View File

@ -16,9 +16,10 @@ import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
import net.coreprotect.config.Config;
import net.coreprotect.consumer.Queue;
import net.coreprotect.listener.block.BlockExplodeListener;
public final class EntityExplodeListener extends BlockExplodeListener implements Listener {
public final class EntityExplodeListener extends Queue implements Listener {
@EventHandler(priority = EventPriority.MONITOR)
protected void onEntityExplode(EntityExplodeEvent event) {

View File

@ -18,9 +18,9 @@ import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.consumer.Queue;
public class EntityPickupItemListener extends Queue implements Listener {
public final class EntityPickupItemListener extends Queue implements Listener {
protected static void onItemPickup(Player player, Location location, ItemStack itemStack) {
public static void onItemPickup(Player player, Location location, ItemStack itemStack) {
if (itemStack == null || location == null || !Config.getConfig(location.getWorld()).ITEM_PICKUPS) {
return;
}

View File

@ -9,7 +9,7 @@ import org.bukkit.event.player.PlayerTakeLecternBookEvent;
import net.coreprotect.config.Config;
import net.coreprotect.consumer.Queue;
public class PlayerTakeLecternBookListener extends Queue implements Listener {
public final class PlayerTakeLecternBookListener extends Queue implements Listener {
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerTakeLecternBook(PlayerTakeLecternBookEvent event) {

View File

@ -30,11 +30,11 @@ import net.coreprotect.database.logger.ItemLogger;
import net.coreprotect.listener.PlayerPickupArrowListener;
import net.coreprotect.utility.Util;
public class ProjectileLaunchListener extends Queue implements Listener {
public final class ProjectileLaunchListener extends Queue implements Listener {
public static Set<Material> BOWS = new HashSet<>(Arrays.asList(Material.BOW, Material.CROSSBOW));
protected static void playerLaunchProjectile(Location location, String user, ItemStack itemStack, int amount, int delay, int offset, int action) {
public static void playerLaunchProjectile(Location location, String user, ItemStack itemStack, int amount, int delay, int offset, int action) {
if (!Config.getConfig(location.getWorld()).ITEM_DROPS || itemStack == null) {
return;
}