From 5490b99bf394f4c27754070ad2cb4e4037aeb2a1 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Wed, 23 Mar 2016 12:03:39 +0100 Subject: [PATCH] Do not suppress warnings --- .../io/github/dre2n/dungeonsxl/config/WorldConfig.java | 2 -- .../github/dre2n/dungeonsxl/game/GamePlaceableBlock.java | 5 +---- .../java/io/github/dre2n/dungeonsxl/global/GameSign.java | 3 --- .../java/io/github/dre2n/dungeonsxl/global/GroupSign.java | 3 --- .../java/io/github/dre2n/dungeonsxl/global/LeaveSign.java | 1 - .../github/dre2n/dungeonsxl/listener/PlayerListener.java | 1 - src/main/java/io/github/dre2n/dungeonsxl/mob/DMob.java | 1 - src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java | 7 +++---- .../java/io/github/dre2n/dungeonsxl/player/DPlayer.java | 1 - .../java/io/github/dre2n/dungeonsxl/sign/BlockSign.java | 7 ++----- .../java/io/github/dre2n/dungeonsxl/sign/ClassesSign.java | 1 - .../java/io/github/dre2n/dungeonsxl/task/MobSpawnTask.java | 1 - .../github/dre2n/dungeonsxl/trigger/RedstoneTrigger.java | 1 - .../io/github/dre2n/dungeonsxl/trigger/WaveTrigger.java | 2 +- 14 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/main/java/io/github/dre2n/dungeonsxl/config/WorldConfig.java b/src/main/java/io/github/dre2n/dungeonsxl/config/WorldConfig.java index a71b7ad5..e4d1c9a7 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/config/WorldConfig.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/config/WorldConfig.java @@ -111,7 +111,6 @@ public class WorldConfig { } // Load & Save - @SuppressWarnings("deprecation") public void load(ConfigurationSection configFile) { /* Classes */ ConfigurationSection configSectionClasses = configFile.getConfigurationSection("classes"); @@ -354,7 +353,6 @@ public class WorldConfig { } } - @SuppressWarnings("deprecation") public void save() { if (file == null) { return; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/game/GamePlaceableBlock.java b/src/main/java/io/github/dre2n/dungeonsxl/game/GamePlaceableBlock.java index 29ea8d88..7028636a 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/game/GamePlaceableBlock.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/game/GamePlaceableBlock.java @@ -43,10 +43,9 @@ public class GamePlaceableBlock { this.block = block; // Split ids - if (!ids.equals("")) { + if (!ids.isEmpty()) { String[] splittedIds = ids.split(","); for (String id : splittedIds) { - @SuppressWarnings("deprecation") Material material = Material.getMaterial(NumberUtil.parseInt(id)); if (material != null) { materials.add(material); @@ -72,7 +71,6 @@ public class GamePlaceableBlock { } if (block.getType() == Material.WALL_SIGN) { - @SuppressWarnings("deprecation") int data = block.getData(); switch (data) { case 3: @@ -153,7 +151,6 @@ public class GamePlaceableBlock { } } else { - @SuppressWarnings("deprecation") int data = block.getData(); switch (data) { case 0: diff --git a/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java index a2327b89..125e29e1 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java @@ -77,7 +77,6 @@ public class GameSign { this.maxGroupsPerGame = maxGroupsPerGame; verticalSigns = (int) Math.ceil((float) (1 + maxGroupsPerGame) / 4); - @SuppressWarnings("deprecation") int[] direction = getDirection(this.startSign.getData()); directionX = direction[0]; directionZ = direction[1]; @@ -201,7 +200,6 @@ public class GameSign { } // Static - @SuppressWarnings("deprecation") public static GameSign tryToCreate(Block startSign, String mapName, int maxGames, int maxGroupsPerGame, boolean multiFloor) { World world = startSign.getWorld(); int direction = startSign.getData(); @@ -303,7 +301,6 @@ public class GameSign { return sign; } - @SuppressWarnings("deprecation") public static boolean isRelativeSign(Block block, int x, int z) { GameSign gameSign = getSign(block.getRelative(x, 0, z)); if (gameSign == null) { diff --git a/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java index e35d64af..cb98a793 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java @@ -76,7 +76,6 @@ public class GroupSign { this.maxPlayersPerGroup = maxPlayersPerGroup; verticalSigns = (int) Math.ceil((float) (1 + maxPlayersPerGroup) / 4); - @SuppressWarnings("deprecation") int[] direction = getDirection(this.startSign.getData()); directionX = direction[0]; directionZ = direction[1]; @@ -200,7 +199,6 @@ public class GroupSign { } /* Statics */ - @SuppressWarnings("deprecation") public static GroupSign tryToCreate(Block startSign, String mapName, int maxGroups, int maxPlayersPerGroup, boolean multiFloor) { World world = startSign.getWorld(); int direction = startSign.getData(); @@ -302,7 +300,6 @@ public class GroupSign { return sign; } - @SuppressWarnings("deprecation") public static boolean isRelativeSign(Block block, int x, int z) { GroupSign groupSign = getSign(block.getRelative(x, 0, z)); if (groupSign == null) { diff --git a/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java b/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java index 756fa009..db08277a 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java @@ -83,7 +83,6 @@ public class LeaveSign { return false; } - @SuppressWarnings("deprecation") public static boolean isRelativeSign(Block block, int x, int z) { LeaveSign leaveSign = getSign(block.getRelative(x, 0, z)); if (leaveSign == null) { diff --git a/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java b/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java index 65e80100..cba335b2 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java @@ -117,7 +117,6 @@ public class PlayerListener implements Listener { } }.runTaskLater(plugin, 1L); } - } if (dPlayer.getLives() != -1) { diff --git a/src/main/java/io/github/dre2n/dungeonsxl/mob/DMob.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMob.java index f66245d8..984f2bd2 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/mob/DMob.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMob.java @@ -65,7 +65,6 @@ public class DMob { } /* Statics */ - @SuppressWarnings("deprecation") public static void onDeath(EntityDeathEvent event) { if (!(event.getEntity() instanceof LivingEntity)) { return; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java index 056ec4ba..5ff7c74a 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java @@ -68,7 +68,7 @@ public class DMobType { this.type = type; } - public void spawn(GameWorld gWorld, Location loc) { + public void spawn(GameWorld gameWorld, Location loc) { if (type == null) { return; } @@ -77,7 +77,7 @@ public class DMobType { return; } - LivingEntity entity = (LivingEntity) gWorld.getWorld().spawnEntity(loc, type); + LivingEntity entity = (LivingEntity) gameWorld.getWorld().spawnEntity(loc, type); /* Set the Items */ entity.getEquipment().setItemInHand(ItemHand); @@ -112,11 +112,10 @@ public class DMobType { entity.setRemoveWhenFarAway(false); /* Spawn Mob */ - new DMob(entity, gWorld, this); + new DMob(entity, gameWorld, this); } // Load Config - @SuppressWarnings("deprecation") public static Set load(ConfigurationSection configFile) { Set set = new HashSet<>(); diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayer.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayer.java index 21df4d28..4c3e8074 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayer.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayer.java @@ -825,7 +825,6 @@ public class DPlayer { } } - @SuppressWarnings("deprecation") public void poke(Block block) { if (block.getState() instanceof Sign) { Sign sign = (Sign) block.getState(); diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java index 85010f9e..0a5678ff 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/BlockSign.java @@ -36,8 +36,8 @@ public class BlockSign extends DSign { private byte offBlockData = 0x0; private byte onBlockData = 0x0; - public BlockSign(Sign sign, GameWorld gworld) { - super(sign, gworld); + public BlockSign(Sign sign, GameWorld gameWorld) { + super(sign, gameWorld); } @Override @@ -45,7 +45,6 @@ public class BlockSign extends DSign { return true; } - @SuppressWarnings("deprecation") @Override public void onInit() { String lines[] = getSign().getLines(); @@ -82,7 +81,6 @@ public class BlockSign extends DSign { initialized = true; } - @SuppressWarnings("deprecation") @Override public void onTrigger() { if (initialized && !active) { @@ -91,7 +89,6 @@ public class BlockSign extends DSign { } } - @SuppressWarnings("deprecation") @Override public void onDisable() { if (initialized && active) { diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/ClassesSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/ClassesSign.java index 453b6b61..dbef8304 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/ClassesSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/ClassesSign.java @@ -40,7 +40,6 @@ public class ClassesSign extends DSign { return true; } - @SuppressWarnings("deprecation") @Override public void onInit() { if (getGameWorld().getConfig().isLobbyDisabled()) { diff --git a/src/main/java/io/github/dre2n/dungeonsxl/task/MobSpawnTask.java b/src/main/java/io/github/dre2n/dungeonsxl/task/MobSpawnTask.java index 56337845..335c1bcf 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/task/MobSpawnTask.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/task/MobSpawnTask.java @@ -41,7 +41,6 @@ public class MobSpawnTask extends BukkitRunnable { this.sign = sign; } - @SuppressWarnings("deprecation") @Override public void run() { if (sign.getInterval() <= 0) { diff --git a/src/main/java/io/github/dre2n/dungeonsxl/trigger/RedstoneTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/RedstoneTrigger.java index 45b77155..2a122daf 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/trigger/RedstoneTrigger.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/trigger/RedstoneTrigger.java @@ -84,7 +84,6 @@ public class RedstoneTrigger extends Trigger { return type; } - @SuppressWarnings("deprecation") public static RedstoneTrigger getOrCreate(Sign sign, GameWorld gameWorld) { Block rtBlock = null; if (sign.getBlock().getType() == Material.WALL_SIGN) { diff --git a/src/main/java/io/github/dre2n/dungeonsxl/trigger/WaveTrigger.java b/src/main/java/io/github/dre2n/dungeonsxl/trigger/WaveTrigger.java index 5cee1860..a2f7c2bb 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/trigger/WaveTrigger.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/trigger/WaveTrigger.java @@ -27,7 +27,7 @@ import java.util.Map; */ public class WaveTrigger extends Trigger { - private static Map> triggers = new HashMap>(); + private static Map> triggers = new HashMap<>(); private TriggerType type = TriggerTypeDefault.WAVE;