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; import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.getRefClass;
@SuppressWarnings("unused")
public class ChunkListener implements Listener { public class ChunkListener implements Listener {
private RefMethod methodGetHandleChunk; private RefMethod methodGetHandleChunk;

View File

@ -18,6 +18,7 @@ import org.bukkit.plugin.Plugin;
import java.util.List; import java.util.List;
@SuppressWarnings("unused")
public class EntityPortal_1_7_9 implements Listener { public class EntityPortal_1_7_9 implements Listener {
private static boolean ignoreTP = false; 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.metadata.FixedMetadataValue;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
@SuppressWarnings("unused")
public class EntitySpawnListener implements Listener { public class EntitySpawnListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void creatureSpawnEvent(EntitySpawnEvent event) { public void creatureSpawnEvent(EntitySpawnEvent event) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -28,6 +28,7 @@ import java.util.Iterator;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.UUID; import java.util.UUID;
@SuppressWarnings("unused")
public class PlotPlusListener extends PlotListener implements Listener { public class PlotPlusListener extends PlotListener implements Listener {
private static final HashMap<String, Interval> feedRunnable = new HashMap<>(); 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; import java.util.UUID;
@SuppressWarnings("unused")
public class PlotPlusListener_1_12 implements Listener { public class PlotPlusListener_1_12 implements Listener {
@EventHandler public void onItemPickup(EntityPickupItemEvent event) { @EventHandler public void onItemPickup(EntityPickupItemEvent event) {
LivingEntity ent = event.getEntity(); LivingEntity ent = event.getEntity();
if (ent instanceof Player) { if (ent instanceof Player) {

View File

@ -11,7 +11,9 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
import java.util.UUID; import java.util.UUID;
@SuppressWarnings("unused")
public class PlotPlusListener_Legacy implements Listener { public class PlotPlusListener_Legacy implements Listener {
@EventHandler public void onItemPickup(PlayerPickupItemEvent event) { @EventHandler public void onItemPickup(PlayerPickupItemEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
PlotPlayer pp = BukkitUtil.getPlayer(player); 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; import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.getRefClass;
@SuppressWarnings("unused")
public class SingleWorldListener implements Listener { public class SingleWorldListener implements Listener {
private Method methodGetHandleChunk; private Method methodGetHandleChunk;

View File

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

View File

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

View File

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