Add @SuppressWarnings("unused") to listeners.

This commit is contained in:
sauilitired 2018-11-15 00:12:12 +01:00
parent a4a923c23c
commit 4395ca06b4
15 changed files with 20 additions and 8 deletions

View File

@ -32,6 +32,7 @@ import java.util.HashSet;
import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.getRefClass;
@SuppressWarnings("unused")
public class ChunkListener implements Listener {
private RefMethod methodGetHandleChunk;

View File

@ -18,6 +18,7 @@ import org.bukkit.plugin.Plugin;
import java.util.List;
@SuppressWarnings("unused")
public class EntityPortal_1_7_9 implements Listener {
private static boolean ignoreTP = false;

View File

@ -16,6 +16,7 @@ import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.plugin.Plugin;
@SuppressWarnings("unused")
public class EntitySpawnListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void creatureSpawnEvent(EntitySpawnEvent event) {

View File

@ -16,6 +16,7 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
@SuppressWarnings("unused")
public class ForceFieldListener {
private static Set<PlotPlayer> getNearbyPlayers(Player player, Plot plot) {

View File

@ -56,6 +56,7 @@ import java.util.regex.Pattern;
/**
* Player Events involving plots.
*/
@SuppressWarnings("unused")
public class PlayerEvents extends PlotListener implements Listener {
private boolean pistonBlocks = true;

View File

@ -14,7 +14,9 @@ import org.bukkit.event.block.BlockExplodeEvent;
import java.util.Iterator;
@SuppressWarnings("unused")
public class PlayerEvents183 implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBigBoom(BlockExplodeEvent event) {
Block block = event.getBlock();
@ -38,12 +40,7 @@ public class PlayerEvents183 implements Listener {
if (plot == null || !plot.getFlag(Flags.EXPLOSION).or(false)) {
event.setCancelled(true);
}
Iterator<Block> iterator = event.blockList().iterator();
while (iterator.hasNext()) {
Block b = iterator.next();
if (!plot.equals(area.getOwnedPlot(BukkitUtil.getLocation(b.getLocation())))) {
iterator.remove();
}
}
event.blockList().removeIf(
b -> !plot.equals(area.getOwnedPlot(BukkitUtil.getLocation(b.getLocation()))));
}
}

View File

@ -32,6 +32,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.UUID;
@SuppressWarnings("unused")
public class PlayerEvents_1_8 extends PlotListener implements Listener {
@SuppressWarnings("deprecation")

View File

@ -9,6 +9,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.LingeringPotionSplashEvent;
@SuppressWarnings("unused")
public class PlayerEvents_1_9 implements Listener {
private final PlayerEvents parent;

View File

@ -28,6 +28,7 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.UUID;
@SuppressWarnings("unused")
public class PlotPlusListener extends PlotListener implements Listener {
private static final HashMap<String, Interval> feedRunnable = new HashMap<>();

View File

@ -12,7 +12,9 @@ import org.bukkit.event.entity.EntityPickupItemEvent;
import java.util.UUID;
@SuppressWarnings("unused")
public class PlotPlusListener_1_12 implements Listener {
@EventHandler public void onItemPickup(EntityPickupItemEvent event) {
LivingEntity ent = event.getEntity();
if (ent instanceof Player) {

View File

@ -11,7 +11,9 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
import java.util.UUID;
@SuppressWarnings("unused")
public class PlotPlusListener_Legacy implements Listener {
@EventHandler public void onItemPickup(PlayerPickupItemEvent event) {
Player player = event.getPlayer();
PlotPlayer pp = BukkitUtil.getPlayer(player);

View File

@ -19,6 +19,7 @@ import java.lang.reflect.Method;
import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.getRefClass;
@SuppressWarnings("unused")
public class SingleWorldListener implements Listener {
private Method methodGetHandleChunk;

View File

@ -12,7 +12,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.generator.ChunkGenerator;
public class WorldEvents implements Listener {
@SuppressWarnings("unused") public class WorldEvents implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {

View File

@ -36,6 +36,7 @@ import java.util.*;
import java.util.Map.Entry;
import java.util.regex.Pattern;
@SuppressWarnings("unused")
public class PlayerEvents extends PlotListener implements Listener {
private boolean pistonBlocks = true;

View File

@ -14,6 +14,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotArea;
import java.util.HashMap;
@SuppressWarnings("unused")
public class WorldEvents implements Listener {
public WorldEvents() {