Do not suppress warnings

This commit is contained in:
Daniel Saukel 2016-03-23 12:03:39 +01:00
parent ec90e59297
commit 5490b99bf3
14 changed files with 7 additions and 29 deletions

View File

@ -111,7 +111,6 @@ public class WorldConfig {
} }
// Load & Save // Load & Save
@SuppressWarnings("deprecation")
public void load(ConfigurationSection configFile) { public void load(ConfigurationSection configFile) {
/* Classes */ /* Classes */
ConfigurationSection configSectionClasses = configFile.getConfigurationSection("classes"); ConfigurationSection configSectionClasses = configFile.getConfigurationSection("classes");
@ -354,7 +353,6 @@ public class WorldConfig {
} }
} }
@SuppressWarnings("deprecation")
public void save() { public void save() {
if (file == null) { if (file == null) {
return; return;

View File

@ -43,10 +43,9 @@ public class GamePlaceableBlock {
this.block = block; this.block = block;
// Split ids // Split ids
if (!ids.equals("")) { if (!ids.isEmpty()) {
String[] splittedIds = ids.split(","); String[] splittedIds = ids.split(",");
for (String id : splittedIds) { for (String id : splittedIds) {
@SuppressWarnings("deprecation")
Material material = Material.getMaterial(NumberUtil.parseInt(id)); Material material = Material.getMaterial(NumberUtil.parseInt(id));
if (material != null) { if (material != null) {
materials.add(material); materials.add(material);
@ -72,7 +71,6 @@ public class GamePlaceableBlock {
} }
if (block.getType() == Material.WALL_SIGN) { if (block.getType() == Material.WALL_SIGN) {
@SuppressWarnings("deprecation")
int data = block.getData(); int data = block.getData();
switch (data) { switch (data) {
case 3: case 3:
@ -153,7 +151,6 @@ public class GamePlaceableBlock {
} }
} else { } else {
@SuppressWarnings("deprecation")
int data = block.getData(); int data = block.getData();
switch (data) { switch (data) {
case 0: case 0:

View File

@ -77,7 +77,6 @@ public class GameSign {
this.maxGroupsPerGame = maxGroupsPerGame; this.maxGroupsPerGame = maxGroupsPerGame;
verticalSigns = (int) Math.ceil((float) (1 + maxGroupsPerGame) / 4); verticalSigns = (int) Math.ceil((float) (1 + maxGroupsPerGame) / 4);
@SuppressWarnings("deprecation")
int[] direction = getDirection(this.startSign.getData()); int[] direction = getDirection(this.startSign.getData());
directionX = direction[0]; directionX = direction[0];
directionZ = direction[1]; directionZ = direction[1];
@ -201,7 +200,6 @@ public class GameSign {
} }
// Static // Static
@SuppressWarnings("deprecation")
public static GameSign tryToCreate(Block startSign, String mapName, int maxGames, int maxGroupsPerGame, boolean multiFloor) { public static GameSign tryToCreate(Block startSign, String mapName, int maxGames, int maxGroupsPerGame, boolean multiFloor) {
World world = startSign.getWorld(); World world = startSign.getWorld();
int direction = startSign.getData(); int direction = startSign.getData();
@ -303,7 +301,6 @@ public class GameSign {
return sign; return sign;
} }
@SuppressWarnings("deprecation")
public static boolean isRelativeSign(Block block, int x, int z) { public static boolean isRelativeSign(Block block, int x, int z) {
GameSign gameSign = getSign(block.getRelative(x, 0, z)); GameSign gameSign = getSign(block.getRelative(x, 0, z));
if (gameSign == null) { if (gameSign == null) {

View File

@ -76,7 +76,6 @@ public class GroupSign {
this.maxPlayersPerGroup = maxPlayersPerGroup; this.maxPlayersPerGroup = maxPlayersPerGroup;
verticalSigns = (int) Math.ceil((float) (1 + maxPlayersPerGroup) / 4); verticalSigns = (int) Math.ceil((float) (1 + maxPlayersPerGroup) / 4);
@SuppressWarnings("deprecation")
int[] direction = getDirection(this.startSign.getData()); int[] direction = getDirection(this.startSign.getData());
directionX = direction[0]; directionX = direction[0];
directionZ = direction[1]; directionZ = direction[1];
@ -200,7 +199,6 @@ public class GroupSign {
} }
/* Statics */ /* Statics */
@SuppressWarnings("deprecation")
public static GroupSign tryToCreate(Block startSign, String mapName, int maxGroups, int maxPlayersPerGroup, boolean multiFloor) { public static GroupSign tryToCreate(Block startSign, String mapName, int maxGroups, int maxPlayersPerGroup, boolean multiFloor) {
World world = startSign.getWorld(); World world = startSign.getWorld();
int direction = startSign.getData(); int direction = startSign.getData();
@ -302,7 +300,6 @@ public class GroupSign {
return sign; return sign;
} }
@SuppressWarnings("deprecation")
public static boolean isRelativeSign(Block block, int x, int z) { public static boolean isRelativeSign(Block block, int x, int z) {
GroupSign groupSign = getSign(block.getRelative(x, 0, z)); GroupSign groupSign = getSign(block.getRelative(x, 0, z));
if (groupSign == null) { if (groupSign == null) {

View File

@ -83,7 +83,6 @@ public class LeaveSign {
return false; return false;
} }
@SuppressWarnings("deprecation")
public static boolean isRelativeSign(Block block, int x, int z) { public static boolean isRelativeSign(Block block, int x, int z) {
LeaveSign leaveSign = getSign(block.getRelative(x, 0, z)); LeaveSign leaveSign = getSign(block.getRelative(x, 0, z));
if (leaveSign == null) { if (leaveSign == null) {

View File

@ -117,7 +117,6 @@ public class PlayerListener implements Listener {
} }
}.runTaskLater(plugin, 1L); }.runTaskLater(plugin, 1L);
} }
} }
if (dPlayer.getLives() != -1) { if (dPlayer.getLives() != -1) {

View File

@ -65,7 +65,6 @@ public class DMob {
} }
/* Statics */ /* Statics */
@SuppressWarnings("deprecation")
public static void onDeath(EntityDeathEvent event) { public static void onDeath(EntityDeathEvent event) {
if (!(event.getEntity() instanceof LivingEntity)) { if (!(event.getEntity() instanceof LivingEntity)) {
return; return;

View File

@ -68,7 +68,7 @@ public class DMobType {
this.type = type; this.type = type;
} }
public void spawn(GameWorld gWorld, Location loc) { public void spawn(GameWorld gameWorld, Location loc) {
if (type == null) { if (type == null) {
return; return;
} }
@ -77,7 +77,7 @@ public class DMobType {
return; return;
} }
LivingEntity entity = (LivingEntity) gWorld.getWorld().spawnEntity(loc, type); LivingEntity entity = (LivingEntity) gameWorld.getWorld().spawnEntity(loc, type);
/* Set the Items */ /* Set the Items */
entity.getEquipment().setItemInHand(ItemHand); entity.getEquipment().setItemInHand(ItemHand);
@ -112,11 +112,10 @@ public class DMobType {
entity.setRemoveWhenFarAway(false); entity.setRemoveWhenFarAway(false);
/* Spawn Mob */ /* Spawn Mob */
new DMob(entity, gWorld, this); new DMob(entity, gameWorld, this);
} }
// Load Config // Load Config
@SuppressWarnings("deprecation")
public static Set<DMobType> load(ConfigurationSection configFile) { public static Set<DMobType> load(ConfigurationSection configFile) {
Set<DMobType> set = new HashSet<>(); Set<DMobType> set = new HashSet<>();

View File

@ -825,7 +825,6 @@ public class DPlayer {
} }
} }
@SuppressWarnings("deprecation")
public void poke(Block block) { public void poke(Block block) {
if (block.getState() instanceof Sign) { if (block.getState() instanceof Sign) {
Sign sign = (Sign) block.getState(); Sign sign = (Sign) block.getState();

View File

@ -36,8 +36,8 @@ public class BlockSign extends DSign {
private byte offBlockData = 0x0; private byte offBlockData = 0x0;
private byte onBlockData = 0x0; private byte onBlockData = 0x0;
public BlockSign(Sign sign, GameWorld gworld) { public BlockSign(Sign sign, GameWorld gameWorld) {
super(sign, gworld); super(sign, gameWorld);
} }
@Override @Override
@ -45,7 +45,6 @@ public class BlockSign extends DSign {
return true; return true;
} }
@SuppressWarnings("deprecation")
@Override @Override
public void onInit() { public void onInit() {
String lines[] = getSign().getLines(); String lines[] = getSign().getLines();
@ -82,7 +81,6 @@ public class BlockSign extends DSign {
initialized = true; initialized = true;
} }
@SuppressWarnings("deprecation")
@Override @Override
public void onTrigger() { public void onTrigger() {
if (initialized && !active) { if (initialized && !active) {
@ -91,7 +89,6 @@ public class BlockSign extends DSign {
} }
} }
@SuppressWarnings("deprecation")
@Override @Override
public void onDisable() { public void onDisable() {
if (initialized && active) { if (initialized && active) {

View File

@ -40,7 +40,6 @@ public class ClassesSign extends DSign {
return true; return true;
} }
@SuppressWarnings("deprecation")
@Override @Override
public void onInit() { public void onInit() {
if (getGameWorld().getConfig().isLobbyDisabled()) { if (getGameWorld().getConfig().isLobbyDisabled()) {

View File

@ -41,7 +41,6 @@ public class MobSpawnTask extends BukkitRunnable {
this.sign = sign; this.sign = sign;
} }
@SuppressWarnings("deprecation")
@Override @Override
public void run() { public void run() {
if (sign.getInterval() <= 0) { if (sign.getInterval() <= 0) {

View File

@ -84,7 +84,6 @@ public class RedstoneTrigger extends Trigger {
return type; return type;
} }
@SuppressWarnings("deprecation")
public static RedstoneTrigger getOrCreate(Sign sign, GameWorld gameWorld) { public static RedstoneTrigger getOrCreate(Sign sign, GameWorld gameWorld) {
Block rtBlock = null; Block rtBlock = null;
if (sign.getBlock().getType() == Material.WALL_SIGN) { if (sign.getBlock().getType() == Material.WALL_SIGN) {

View File

@ -27,7 +27,7 @@ import java.util.Map;
*/ */
public class WaveTrigger extends Trigger { public class WaveTrigger extends Trigger {
private static Map<GameWorld, ArrayList<WaveTrigger>> triggers = new HashMap<GameWorld, ArrayList<WaveTrigger>>(); private static Map<GameWorld, ArrayList<WaveTrigger>> triggers = new HashMap<>();
private TriggerType type = TriggerTypeDefault.WAVE; private TriggerType type = TriggerTypeDefault.WAVE;