From f3c1c6791a1dfb317d0eb72054b10cc01cf0fc4d Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Wed, 15 Jul 2015 23:47:42 +0200 Subject: [PATCH] Replaced Material IDs in many cases to fix deprecation warnings --- src/com/dre/dungeonsxl/DGSign.java | 19 ++++++++++--------- src/com/dre/dungeonsxl/DPlayer.java | 18 +++++++++++------- src/com/dre/dungeonsxl/DPortal.java | 17 ++++++++++------- src/com/dre/dungeonsxl/LeaveSign.java | 3 ++- .../dre/dungeonsxl/commands/CMDPortal.java | 3 ++- .../dungeonsxl/listener/BlockListener.java | 7 ++++--- .../dungeonsxl/listener/EntityListener.java | 7 ++++--- .../dungeonsxl/listener/PlayerListener.java | 4 ++-- .../dre/dungeonsxl/signs/SIGNCheckpoint.java | 4 +++- src/com/dre/dungeonsxl/signs/SIGNChest.java | 9 +++++---- .../dungeonsxl/signs/SIGNChunkUpdater.java | 4 +++- src/com/dre/dungeonsxl/signs/SIGNClasses.java | 5 +++-- src/com/dre/dungeonsxl/signs/SIGNEnd.java | 3 ++- src/com/dre/dungeonsxl/signs/SIGNLeave.java | 3 ++- src/com/dre/dungeonsxl/signs/SIGNLobby.java | 4 +++- src/com/dre/dungeonsxl/signs/SIGNMob.java | 2 +- src/com/dre/dungeonsxl/signs/SIGNMsg.java | 4 +++- src/com/dre/dungeonsxl/signs/SIGNPlace.java | 3 ++- src/com/dre/dungeonsxl/signs/SIGNReady.java | 3 ++- .../dre/dungeonsxl/signs/SIGNRedstone.java | 7 ++++--- .../dre/dungeonsxl/signs/SIGNSoundMsg.java | 4 ++-- src/com/dre/dungeonsxl/signs/SIGNStart.java | 4 +++- src/com/dre/dungeonsxl/signs/SIGNTrigger.java | 3 ++- src/plugin.yml | 2 +- 24 files changed, 86 insertions(+), 56 deletions(-) diff --git a/src/com/dre/dungeonsxl/DGSign.java b/src/com/dre/dungeonsxl/DGSign.java index 50218c21..134c71e5 100644 --- a/src/com/dre/dungeonsxl/DGSign.java +++ b/src/com/dre/dungeonsxl/DGSign.java @@ -4,6 +4,7 @@ import java.io.File; import java.util.concurrent.CopyOnWriteArrayList; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.Sign; @@ -117,10 +118,10 @@ public class DGSign { for (yy = y; yy > y - verticalSigns; yy--) { for (xx = x; xx > x - maxGroups; xx--) { Block block = world.getBlockAt(xx, yy, zz); - if (block.getTypeId() != 0 && block.getTypeId() != 68) { + if (block.getType() != Material.AIR && block.getType() != Material.WALL_SIGN) { return null; } - if (block.getRelative(0, 0, 1).getTypeId() == 0) { + if (block.getRelative(0, 0, 1).getType() == Material.AIR) { return null; } changeBlocks.add(block); @@ -133,10 +134,10 @@ public class DGSign { for (xx = x; xx < x + maxGroups; xx++) { Block block = world.getBlockAt(xx, yy, zz); - if (block.getTypeId() != 0 && block.getTypeId() != 68) { + if (block.getType() != Material.AIR && block.getType() != Material.WALL_SIGN) { return null; } - if (block.getRelative(0, 0, -1).getTypeId() == 0) { + if (block.getRelative(0, 0, -1).getType() == Material.AIR) { return null; } changeBlocks.add(block); @@ -148,10 +149,10 @@ public class DGSign { for (yy = y; yy > y - verticalSigns; yy--) { for (zz = z; zz < z + maxGroups; zz++) { Block block = world.getBlockAt(xx, yy, zz); - if (block.getTypeId() != 0 && block.getTypeId() != 68) { + if (block.getType() != Material.AIR && block.getType() != Material.WALL_SIGN) { return null; } - if (block.getRelative(1, 0, 0).getTypeId() == 0) { + if (block.getRelative(1, 0, 0).getType() == Material.AIR) { return null; } changeBlocks.add(block); @@ -163,10 +164,10 @@ public class DGSign { for (yy = y; yy > y - verticalSigns; yy--) { for (zz = z; zz > z - maxGroups; zz--) { Block block = world.getBlockAt(xx, yy, zz); - if (block.getTypeId() != 0 && block.getTypeId() != 68) { + if (block.getType() != Material.AIR && block.getType() != Material.WALL_SIGN) { return null; } - if (block.getRelative(-1, 0, 0).getTypeId() == 0) { + if (block.getRelative(-1, 0, 0).getType() == Material.AIR) { return null; } changeBlocks.add(block); @@ -200,7 +201,7 @@ public class DGSign { } public static DGSign getSign(Block block) { - if (block.getTypeId() == 68) { + if (block.getType() == Material.WALL_SIGN) { int x = block.getX(), y = block.getY(), z = block.getZ(); for (DGSign dgsign : dgsigns) { int sx1 = dgsign.startSign.getX(), sy1 = dgsign.startSign.getY(), sz1 = dgsign.startSign.getZ(); diff --git a/src/com/dre/dungeonsxl/DPlayer.java b/src/com/dre/dungeonsxl/DPlayer.java index 0aacb62e..9f46f036 100644 --- a/src/com/dre/dungeonsxl/DPlayer.java +++ b/src/com/dre/dungeonsxl/DPlayer.java @@ -156,7 +156,7 @@ public class DPlayer { if (gworld.isTutorial) { p.permission.playerAddGroup(this.player, p.mainConfig.tutorialEndGroup); p.permission.playerRemoveGroup(this.player, p.mainConfig.tutorialStartGroup); - p.getServer().dispatchCommand(p.getServer().getConsoleSender(), "pex user "+player.getName()+" group set "+p.mainConfig.tutorialEndGroup); + p.getServer().dispatchCommand(p.getServer().getConsoleSender(), "pex user "+player.getName()+" group set "+p.mainConfig.tutorialEndGroup);//TODO: Use Vault for this! } } } @@ -291,7 +291,7 @@ public class DPlayer { p.msg(player, p.language.get("Player_SignCopied")); } } else { - String info = "" + block.getTypeId(); + String info = "" + block.getType(); if (block.getData() != 0) { info = info + "," + block.getData(); } @@ -327,7 +327,7 @@ public class DPlayer { /* Delete Inventory */ this.player.getInventory().clear(); this.player.getInventory().setArmorContents(null); - player.getInventory().setItemInHand(new ItemStack(0)); + player.getInventory().setItemInHand(new ItemStack(Material.AIR)); // Remove Potion Effects for (PotionEffect effect : this.player.getActivePotionEffects()) { @@ -342,19 +342,23 @@ public class DPlayer { for (ItemStack istack : dclass.items) { // Leggings - if (istack.getTypeId() == 300 || istack.getTypeId() == 304 || istack.getTypeId() == 308 || istack.getTypeId() == 312 || istack.getTypeId() == 316) { + if (istack.getType() == Material.LEATHER_LEGGINGS || istack.getType() == Material.CHAINMAIL_LEGGINGS || istack.getType() == Material.IRON_LEGGINGS + || istack.getType() == Material.DIAMOND_LEGGINGS || istack.getType() == Material.GOLD_LEGGINGS) { this.player.getInventory().setLeggings(istack); } // Helmet - else if (istack.getTypeId() == 298 || istack.getTypeId() == 302 || istack.getTypeId() == 306 || istack.getTypeId() == 310 || istack.getTypeId() == 314) { + else if (istack.getType() == Material.LEATHER_HELMET || istack.getType() == Material.CHAINMAIL_HELMET || istack.getType() == Material.IRON_HELMET + || istack.getType() == Material.DIAMOND_HELMET || istack.getType() == Material.GOLD_HELMET) { this.player.getInventory().setHelmet(istack); } // Chestplate - else if (istack.getTypeId() == 299 || istack.getTypeId() == 303 || istack.getTypeId() == 307 || istack.getTypeId() == 311 || istack.getTypeId() == 315) { + else if (istack.getType() == Material.LEATHER_CHESTPLATE || istack.getType() == Material.CHAINMAIL_CHESTPLATE || istack.getType() == Material.IRON_CHESTPLATE + || istack.getType() == Material.DIAMOND_CHESTPLATE || istack.getType() == Material.GOLD_CHESTPLATE) { this.player.getInventory().setChestplate(istack); } // Boots - else if (istack.getTypeId() == 301 || istack.getTypeId() == 305 || istack.getTypeId() == 309 || istack.getTypeId() == 313 || istack.getTypeId() == 317) { + else if (istack.getType() == Material.LEATHER_BOOTS || istack.getType() == Material.CHAINMAIL_BOOTS || istack.getType() == Material.IRON_BOOTS + || istack.getType() == Material.DIAMOND_BOOTS || istack.getType() == Material.GOLD_BOOTS) { this.player.getInventory().setBoots(istack); } diff --git a/src/com/dre/dungeonsxl/DPortal.java b/src/com/dre/dungeonsxl/DPortal.java index 3daf479e..53ef9b01 100644 --- a/src/com/dre/dungeonsxl/DPortal.java +++ b/src/com/dre/dungeonsxl/DPortal.java @@ -2,6 +2,7 @@ package com.dre.dungeonsxl; import java.util.concurrent.CopyOnWriteArrayList; +import org.bukkit.Material; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; @@ -55,10 +56,12 @@ public class DPortal { do { int zz = z1; do { - int typeId = this.world.getBlockAt(xx, yy, zz).getType().getId(); - if (typeId == 0 || typeId == 8 || typeId == 9 || typeId == 10 || typeId == 11 || typeId == 6 || typeId == 30 || typeId == 31 || typeId == 32 || typeId == 34 || typeId == 37 - || typeId == 38 || typeId == 39 || typeId == 40 || typeId == 50 || typeId == 51 || typeId == 59 || typeId == 55 || typeId == 75 || typeId == 78 || typeId == 76) { - this.world.getBlockAt(xx, yy, zz).setTypeId(90); + Material type = this.world.getBlockAt(xx, yy, zz).getType(); + if (type == Material.AIR || type == Material.WATER || type == Material.STATIONARY_WATER || type == Material.LAVA || type == Material.STATIONARY_LAVA || type == Material.SAPLING + || type == Material.WEB || type == Material.LONG_GRASS || type == Material.DEAD_BUSH || type == Material.PISTON_EXTENSION || type == Material.YELLOW_FLOWER + || type == Material.RED_ROSE || type == Material.BROWN_MUSHROOM || type == Material.RED_MUSHROOM || type == Material.TORCH || type == Material.FIRE + || type == Material.CROPS || type == Material.REDSTONE_WIRE || type == Material.REDSTONE_TORCH_OFF || type == Material.SNOW || type == Material.REDSTONE_TORCH_ON) { + this.world.getBlockAt(xx, yy, zz).setType(Material.PORTAL); } zz = zz + zcount; @@ -117,10 +120,10 @@ public class DPortal { do { int zz = z1; do { - int typeId = this.world.getBlockAt(xx, yy, zz).getType().getId(); + Material type = this.world.getBlockAt(xx, yy, zz).getType(); - if (typeId == 90) { - this.world.getBlockAt(xx, yy, zz).setTypeId(0); + if (type == Material.PORTAL) { + this.world.getBlockAt(xx, yy, zz).setType(Material.AIR); } zz = zz + zcount; diff --git a/src/com/dre/dungeonsxl/LeaveSign.java b/src/com/dre/dungeonsxl/LeaveSign.java index f9503e08..8e8135a0 100644 --- a/src/com/dre/dungeonsxl/LeaveSign.java +++ b/src/com/dre/dungeonsxl/LeaveSign.java @@ -3,6 +3,7 @@ package com.dre.dungeonsxl; import java.util.concurrent.CopyOnWriteArrayList; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.Sign; @@ -67,7 +68,7 @@ public class LeaveSign { } public static LeaveSign getSign(Block block) { - if (block.getTypeId() == 68 || block.getTypeId() == 63) { + if (block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) { for (LeaveSign leavesign : lsigns) { if (block.getWorld() == leavesign.sign.getWorld()) { if (block.getLocation().distance(leavesign.sign.getBlock().getLocation()) < 1) { diff --git a/src/com/dre/dungeonsxl/commands/CMDPortal.java b/src/com/dre/dungeonsxl/commands/CMDPortal.java index 4f0dd61e..0b10f2cb 100644 --- a/src/com/dre/dungeonsxl/commands/CMDPortal.java +++ b/src/com/dre/dungeonsxl/commands/CMDPortal.java @@ -1,5 +1,6 @@ package com.dre.dungeonsxl.commands; +import org.bukkit.Material; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -27,7 +28,7 @@ public class CMDPortal extends DCommand { dportal = new DPortal(false); dportal.player = player; dportal.world = player.getWorld(); - player.getInventory().setItemInHand(new ItemStack(268)); + player.getInventory().setItemInHand(new ItemStack(Material.WOOD_SWORD)); p.msg(player, p.language.get("Player_PortalIntroduction")); } else { DPortal.portals.remove(dportal); diff --git a/src/com/dre/dungeonsxl/listener/BlockListener.java b/src/com/dre/dungeonsxl/listener/BlockListener.java index 47e43525..1ab109c6 100644 --- a/src/com/dre/dungeonsxl/listener/BlockListener.java +++ b/src/com/dre/dungeonsxl/listener/BlockListener.java @@ -4,6 +4,7 @@ import org.bukkit.block.Block; import org.bukkit.block.Sign; import org.bukkit.entity.Player; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -29,7 +30,7 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onBlockPhysics(BlockPhysicsEvent event) { - if (event.getBlock().getTypeId() == 90) { + if (event.getBlock().getType() == Material.PORTAL) { if (DPortal.get(event.getBlock()) != null) { event.setCancelled(true); } @@ -41,7 +42,7 @@ public class BlockListener implements Listener { Block block = event.getBlock(); // Deny DPortal destroying - if (block.getTypeId() == 90) { + if (block.getType() == Material.PORTAL) { if (DPortal.get(event.getBlock()) != null) { event.setCancelled(true); } @@ -172,7 +173,7 @@ public class BlockListener implements Listener { public void onBlockSpread(BlockSpreadEvent event) { Block block = event.getBlock(); // Block the Spread off Vines - if (block.getTypeId() == 106) { + if (block.getType() == Material.VINE) { // Check GameWorlds GameWorld gworld = GameWorld.get(event.getBlock().getWorld()); if (gworld != null) { diff --git a/src/com/dre/dungeonsxl/listener/EntityListener.java b/src/com/dre/dungeonsxl/listener/EntityListener.java index ee4bce97..5d947f7b 100644 --- a/src/com/dre/dungeonsxl/listener/EntityListener.java +++ b/src/com/dre/dungeonsxl/listener/EntityListener.java @@ -2,6 +2,7 @@ package com.dre.dungeonsxl.listener; import java.util.List; +import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.entity.Entity; @@ -36,7 +37,7 @@ public class EntityListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onItemSpawn(ItemSpawnEvent event) { if (GameWorld.get(event.getLocation().getWorld()) != null) { - if (event.getEntity().getItemStack().getTypeId() == 323) { + if (event.getEntity().getItemStack().getType() == Material.SIGN) { event.setCancelled(true); } } @@ -189,7 +190,7 @@ public class EntityListener implements Listener { List blocklist = event.blockList(); for (Block block : blocklist) { // Portals - if (block.getTypeId() == 90) { + if (block.getType() == Material.PORTAL) { if (DPortal.get(block) != null) { event.setCancelled(true); return; @@ -197,7 +198,7 @@ public class EntityListener implements Listener { } // Signs - if (block.getTypeId() == 68 || block.getTypeId() == 63) { + if (block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) { if (DGSign.getSign(block) != null) { event.setCancelled(true); return; diff --git a/src/com/dre/dungeonsxl/listener/PlayerListener.java b/src/com/dre/dungeonsxl/listener/PlayerListener.java index 564c56b2..e941e73b 100644 --- a/src/com/dre/dungeonsxl/listener/PlayerListener.java +++ b/src/com/dre/dungeonsxl/listener/PlayerListener.java @@ -143,7 +143,7 @@ public class PlayerListener implements Listener { // Check Signs if (clickedBlock != null) { - if (clickedBlock.getTypeId() == 68 || clickedBlock.getTypeId() == 63) { + if (clickedBlock.getType() == Material.WALL_SIGN || clickedBlock.getType() == Material.SIGN_POST) { // Check Group Signs if (DGSign.playerInteract(event.getClickedBlock(), player)) { event.setCancelled(true); @@ -386,7 +386,7 @@ public class PlayerListener implements Listener { dplayer.respawnArmor = event.getEntity().getInventory().getArmorContents(); // Delete all drops for (ItemStack istack : event.getDrops()) { - istack.setTypeId(0); + istack.setType(Material.AIR); } } } diff --git a/src/com/dre/dungeonsxl/signs/SIGNCheckpoint.java b/src/com/dre/dungeonsxl/signs/SIGNCheckpoint.java index dc87593b..d77759c1 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNCheckpoint.java +++ b/src/com/dre/dungeonsxl/signs/SIGNCheckpoint.java @@ -1,6 +1,8 @@ package com.dre.dungeonsxl.signs; import java.util.concurrent.CopyOnWriteArrayList; + +import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.entity.Player; @@ -31,7 +33,7 @@ public class SIGNCheckpoint extends DSign { @Override public void onInit() { - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); initialized = true; } diff --git a/src/com/dre/dungeonsxl/signs/SIGNChest.java b/src/com/dre/dungeonsxl/signs/SIGNChest.java index fcae2bd0..aca5a07f 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNChest.java +++ b/src/com/dre/dungeonsxl/signs/SIGNChest.java @@ -1,5 +1,6 @@ package com.dre.dungeonsxl.signs; +import org.bukkit.Material; import org.bukkit.block.Sign; import com.dre.dungeonsxl.game.GameChest; @@ -25,18 +26,18 @@ public class SIGNChest extends DSign { @Override public void onInit() { for (int i = -1; i <= 1; i++) { - if (sign.getBlock().getRelative(i, 0, 0).getTypeId() == 54) { + if (sign.getBlock().getRelative(i, 0, 0).getType() == Material.CHEST) { new GameChest(sign.getBlock().getRelative(i, 0, 0), gworld); } - if (sign.getBlock().getRelative(0, 0, i).getTypeId() == 54) { + if (sign.getBlock().getRelative(0, 0, i).getType() == Material.CHEST) { new GameChest(sign.getBlock().getRelative(0, 0, i), gworld); } - if (sign.getBlock().getRelative(0, i, 0).getTypeId() == 54) { + if (sign.getBlock().getRelative(0, i, 0).getType() == Material.CHEST) { new GameChest(sign.getBlock().getRelative(0, i, 0), gworld); } } - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } @Override diff --git a/src/com/dre/dungeonsxl/signs/SIGNChunkUpdater.java b/src/com/dre/dungeonsxl/signs/SIGNChunkUpdater.java index 290b4bc6..155937d9 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNChunkUpdater.java +++ b/src/com/dre/dungeonsxl/signs/SIGNChunkUpdater.java @@ -1,7 +1,9 @@ package com.dre.dungeonsxl.signs; import org.bukkit.Chunk; +import org.bukkit.Material; import org.bukkit.block.Sign; + import com.dre.dungeonsxl.game.GameWorld; public class SIGNChunkUpdater extends DSign { @@ -38,7 +40,7 @@ public class SIGNChunkUpdater extends DSign { chunk.load(); gworld.loadedChunks.add(chunk); } - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } @Override diff --git a/src/com/dre/dungeonsxl/signs/SIGNClasses.java b/src/com/dre/dungeonsxl/signs/SIGNClasses.java index faa4df00..c9202e08 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNClasses.java +++ b/src/com/dre/dungeonsxl/signs/SIGNClasses.java @@ -1,6 +1,7 @@ package com.dre.dungeonsxl.signs; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Sign; @@ -47,7 +48,7 @@ public class SIGNClasses extends DSign { if (isContinued) { Block classBlock = sign.getBlock().getRelative(xx, 0, zz); - if (classBlock.getData() == sign.getData().getData() && classBlock.getTypeId() == 68 && (classBlock.getState() instanceof Sign)) { + if (classBlock.getData() == sign.getData().getData() && classBlock.getType() == Material.WALL_SIGN && (classBlock.getState() instanceof Sign)) { Sign classSign = (Sign) classBlock.getState(); classSign.setLine(0, ChatColor.DARK_BLUE + "############"); @@ -66,7 +67,7 @@ public class SIGNClasses extends DSign { } } } else { - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } } diff --git a/src/com/dre/dungeonsxl/signs/SIGNEnd.java b/src/com/dre/dungeonsxl/signs/SIGNEnd.java index 28b30384..e5727189 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNEnd.java +++ b/src/com/dre/dungeonsxl/signs/SIGNEnd.java @@ -1,6 +1,7 @@ package com.dre.dungeonsxl.signs; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.entity.Player; @@ -39,7 +40,7 @@ public class SIGNEnd extends DSign { sign.setLine(3, ChatColor.DARK_BLUE + "############"); sign.update(); } else { - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } } diff --git a/src/com/dre/dungeonsxl/signs/SIGNLeave.java b/src/com/dre/dungeonsxl/signs/SIGNLeave.java index 5991d710..60335807 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNLeave.java +++ b/src/com/dre/dungeonsxl/signs/SIGNLeave.java @@ -1,6 +1,7 @@ package com.dre.dungeonsxl.signs; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.entity.Player; @@ -39,7 +40,7 @@ public class SIGNLeave extends DSign { sign.setLine(3, ChatColor.DARK_BLUE + "############"); sign.update(); } else { - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } } diff --git a/src/com/dre/dungeonsxl/signs/SIGNLobby.java b/src/com/dre/dungeonsxl/signs/SIGNLobby.java index 85e9d17a..1d2c4a3f 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNLobby.java +++ b/src/com/dre/dungeonsxl/signs/SIGNLobby.java @@ -1,6 +1,8 @@ package com.dre.dungeonsxl.signs; +import org.bukkit.Material; import org.bukkit.block.Sign; + import com.dre.dungeonsxl.game.GameWorld; public class SIGNLobby extends DSign { @@ -23,7 +25,7 @@ public class SIGNLobby extends DSign { @Override public void onInit() { gworld.locLobby = sign.getLocation(); - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } @Override diff --git a/src/com/dre/dungeonsxl/signs/SIGNMob.java b/src/com/dre/dungeonsxl/signs/SIGNMob.java index 2fd6dc7c..1dd80775 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNMob.java +++ b/src/com/dre/dungeonsxl/signs/SIGNMob.java @@ -62,7 +62,7 @@ public class SIGNMob extends DSign { } } } - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); initialized = true; } diff --git a/src/com/dre/dungeonsxl/signs/SIGNMsg.java b/src/com/dre/dungeonsxl/signs/SIGNMsg.java index 69bfe936..d555a8b9 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNMsg.java +++ b/src/com/dre/dungeonsxl/signs/SIGNMsg.java @@ -2,8 +2,10 @@ package com.dre.dungeonsxl.signs; import java.util.concurrent.CopyOnWriteArrayList; +import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.entity.Player; + import com.dre.dungeonsxl.game.GameWorld; public class SIGNMsg extends DSign { @@ -38,7 +40,7 @@ public class SIGNMsg extends DSign { String msg = gworld.config.getMsg(p.parseInt(lines[1]), true); if (msg != null) { this.msg = msg; - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } } diff --git a/src/com/dre/dungeonsxl/signs/SIGNPlace.java b/src/com/dre/dungeonsxl/signs/SIGNPlace.java index 75f38cd6..36741b9c 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNPlace.java +++ b/src/com/dre/dungeonsxl/signs/SIGNPlace.java @@ -1,5 +1,6 @@ package com.dre.dungeonsxl.signs; +import org.bukkit.Material; import org.bukkit.block.Sign; import com.dre.dungeonsxl.game.GamePlaceableBlock; @@ -24,7 +25,7 @@ public class SIGNPlace extends DSign { public void onInit() { String lines[] = sign.getLines(); gworld.placeableBlocks.add(new GamePlaceableBlock(sign.getBlock(), lines[1], lines[2])); - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } @Override diff --git a/src/com/dre/dungeonsxl/signs/SIGNReady.java b/src/com/dre/dungeonsxl/signs/SIGNReady.java index 1e091448..918cc1c6 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNReady.java +++ b/src/com/dre/dungeonsxl/signs/SIGNReady.java @@ -1,6 +1,7 @@ package com.dre.dungeonsxl.signs; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.entity.Player; @@ -40,7 +41,7 @@ public class SIGNReady extends DSign { sign.setLine(3, ChatColor.DARK_BLUE + "############"); sign.update(); } else { - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } } diff --git a/src/com/dre/dungeonsxl/signs/SIGNRedstone.java b/src/com/dre/dungeonsxl/signs/SIGNRedstone.java index ad226b36..3cade710 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNRedstone.java +++ b/src/com/dre/dungeonsxl/signs/SIGNRedstone.java @@ -1,5 +1,6 @@ package com.dre.dungeonsxl.signs; +import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Sign; @@ -62,7 +63,7 @@ public class SIGNRedstone extends DSign { } this.block = sign.getBlock(); - this.block.setTypeId(0); + this.block.setType(Material.AIR); initialized = true; } @@ -98,11 +99,11 @@ public class SIGNRedstone extends DSign { } public void power() { - block.setTypeId(152); + block.setType(Material.REDSTONE_BLOCK); } public void unpower() { - block.setTypeId(0); + block.setType(Material.AIR); } public void disableTask(int taskId) { diff --git a/src/com/dre/dungeonsxl/signs/SIGNSoundMsg.java b/src/com/dre/dungeonsxl/signs/SIGNSoundMsg.java index 05dfce27..6ba83b9e 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNSoundMsg.java +++ b/src/com/dre/dungeonsxl/signs/SIGNSoundMsg.java @@ -2,10 +2,10 @@ package com.dre.dungeonsxl.signs; import java.util.concurrent.CopyOnWriteArrayList; +import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.entity.Player; -import com.dre.dungeonsxl.P; import com.dre.dungeonsxl.game.GameWorld; public class SIGNSoundMsg extends DSign { @@ -40,7 +40,7 @@ public class SIGNSoundMsg extends DSign { String msg = gworld.config.getMsg(p.parseInt(lines[1]), true); if (msg != null) { this.msg = msg; - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } } diff --git a/src/com/dre/dungeonsxl/signs/SIGNStart.java b/src/com/dre/dungeonsxl/signs/SIGNStart.java index e2e07844..6338fe51 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNStart.java +++ b/src/com/dre/dungeonsxl/signs/SIGNStart.java @@ -1,6 +1,8 @@ package com.dre.dungeonsxl.signs; +import org.bukkit.Material; import org.bukkit.block.Sign; + import com.dre.dungeonsxl.game.GameWorld; public class SIGNStart extends DSign { @@ -23,7 +25,7 @@ public class SIGNStart extends DSign { @Override public void onInit() { gworld.locStart = sign.getLocation(); - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); } @Override diff --git a/src/com/dre/dungeonsxl/signs/SIGNTrigger.java b/src/com/dre/dungeonsxl/signs/SIGNTrigger.java index 0f1140b8..703cbf37 100644 --- a/src/com/dre/dungeonsxl/signs/SIGNTrigger.java +++ b/src/com/dre/dungeonsxl/signs/SIGNTrigger.java @@ -3,6 +3,7 @@ package com.dre.dungeonsxl.signs; import java.util.HashSet; import java.util.Set; +import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.block.Block; @@ -64,7 +65,7 @@ public class SIGNTrigger extends DSign { @Override public void onInit() { triggerId = p.parseInt(sign.getLine(1)); - sign.getBlock().setTypeId(0); + sign.getBlock().setType(Material.AIR); initialized = true; } diff --git a/src/plugin.yml b/src/plugin.yml index 50b9d3f7..2a138712 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: DungeonsXL main: com.dre.dungeonsxl.P -version: 0.9.1 +version: 0.9.2-SNAPSHOT author: Frank Baumann authors: [Frank Baumann, Milan Albrecht, Tobias Schmitz, Daniel Saukel] website: http://www.dre2n.ml