mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2025-02-17 16:39:42 +08:00
Fixed all listener classes not being final
This commit is contained in:
parent
6714ded600
commit
7c7fd200d2
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user