diff --git a/src/nl/Steffion/BlockHunt/ArenaHandler.java b/src/nl/Steffion/BlockHunt/ArenaHandler.java index b694d4e..ed7c6b0 100644 --- a/src/nl/Steffion/BlockHunt/ArenaHandler.java +++ b/src/nl/Steffion/BlockHunt/ArenaHandler.java @@ -126,8 +126,8 @@ public class ArenaHandler { player.getName() + ".blockchooser") != null) { ItemStack shopBlockChooser = new ItemStack( - Material.getMaterial((Integer) W.config - .get(ConfigC.shop_blockChooserID)), + Material.getMaterial((String) W.config + .get(ConfigC.shop_blockChooserIDname)), 1); ItemMeta shopBlockChooser_IM = shopBlockChooser .getItemMeta(); diff --git a/src/nl/Steffion/BlockHunt/Commands/CMDwand.java b/src/nl/Steffion/BlockHunt/Commands/CMDwand.java index 43ce2a6..28d3f4c 100644 --- a/src/nl/Steffion/BlockHunt/Commands/CMDwand.java +++ b/src/nl/Steffion/BlockHunt/Commands/CMDwand.java @@ -21,7 +21,8 @@ public class CMDwand extends DefaultCMD { String[] args) { if (player != null) { ItemStack wand = new ItemStack( - Material.getMaterial((Integer) W.config.get(ConfigC.wandID))); + Material.getMaterial((String) W.config + .get(ConfigC.wandIDname))); ItemMeta im = wand.getItemMeta(); im.setDisplayName(MessageM.replaceAll((String) W.config .get(ConfigC.wandName))); diff --git a/src/nl/Steffion/BlockHunt/ConfigC.java b/src/nl/Steffion/BlockHunt/ConfigC.java index a8ab7fd..e4f602d 100644 --- a/src/nl/Steffion/BlockHunt/ConfigC.java +++ b/src/nl/Steffion/BlockHunt/ConfigC.java @@ -41,7 +41,7 @@ public enum ConfigC { autoUpdateCheck (true, W.config), autoDownloadUpdate (false, W.config), - wandID (280, W.config), + wandIDname ("STICK", W.config), wandName ("%A&l" + BlockHunt.pdfFile.getName() + "%N's selection wand", W.config), wandDescription (new String[] { @@ -54,7 +54,7 @@ public enum ConfigC { shop_title ("%H&lBlockHunt %NShop", W.config), shop_price ("%NPrice: %A%amount% %Ntokens.", W.config), shop_blockChooserEnabled (true, W.config), - shop_blockChooserID (340, W.config), + shop_blockChooserIDname ("BOOK", W.config), shop_blockChooserPrice (3000, W.config), shop_blockChooserName ("%H&lBlock Chooser", W.config), shop_blockChooserDescription (new String[] { @@ -62,7 +62,7 @@ public enum ConfigC { "%ARight-Click%N in the lobby and choose", "%Nthe block you want to be!", "&6Unlimited uses." }, W.config), shop_BlockHuntPassEnabled (true, W.config), - shop_BlockHuntPassID (421, W.config), + shop_BlockHuntPassIDname ("NAME_TAG", W.config), shop_BlockHuntPassPrice (150, W.config), shop_BlockHuntPassName ("%H&lBlockHunt Pass", W.config), shop_BlockHuntPassDescription (new String[] { diff --git a/src/nl/Steffion/BlockHunt/InventoryHandler.java b/src/nl/Steffion/BlockHunt/InventoryHandler.java index e619e8b..24bcfbb 100644 --- a/src/nl/Steffion/BlockHunt/InventoryHandler.java +++ b/src/nl/Steffion/BlockHunt/InventoryHandler.java @@ -267,8 +267,8 @@ public class InventoryHandler { shopTokens.setItemMeta(shopTokens_IM); ItemStack shopBlockChooser = new ItemStack( - Material.getMaterial((Integer) W.config - .get(ConfigC.shop_blockChooserID)), 1); + Material.getMaterial((String) W.config + .get(ConfigC.shop_blockChooserIDname)), 1); ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta(); shopBlockChooser_IM.setDisplayName(MessageM .replaceAll((String) W.config @@ -288,8 +288,8 @@ public class InventoryHandler { shopBlockChooser.setItemMeta(shopBlockChooser_IM); ItemStack shopBlockHuntPass = new ItemStack( - Material.getMaterial((Integer) W.config - .get(ConfigC.shop_BlockHuntPassID)), 1); + Material.getMaterial((String) W.config + .get(ConfigC.shop_BlockHuntPassIDname)), 1); ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta(); shopBlockHuntPass_IM.setDisplayName(MessageM .replaceAll((String) W.config diff --git a/src/nl/Steffion/BlockHunt/Listeners/OnPlayerMoveEvent.java b/src/nl/Steffion/BlockHunt/Listeners/OnPlayerMoveEvent.java index 6035934..a3cac72 100644 --- a/src/nl/Steffion/BlockHunt/Listeners/OnPlayerMoveEvent.java +++ b/src/nl/Steffion/BlockHunt/Listeners/OnPlayerMoveEvent.java @@ -39,32 +39,32 @@ public class OnPlayerMoveEvent implements Listener { Location loc = player.getLocation(); if (loc.getBlockX() > maxX) { event.setCancelled(true); - player.playEffect(loc, Effect.ENDER_SIGNAL, 0); + player.playEffect(loc, Effect.ENDER_SIGNAL, null); player.playSound(loc, Sound.GHAST_FIREBALL, 1, 1); player.teleport(arena.hidersWarp); } else if (loc.getBlockX() < minX) { event.setCancelled(true); - player.playEffect(loc, Effect.ENDER_SIGNAL, 0); + player.playEffect(loc, Effect.ENDER_SIGNAL, null); player.playSound(loc, Sound.GHAST_FIREBALL, 1, 1); player.teleport(arena.hidersWarp); } else if (loc.getBlockZ() > maxZ) { event.setCancelled(true); - player.playEffect(loc, Effect.ENDER_SIGNAL, 0); + player.playEffect(loc, Effect.ENDER_SIGNAL, null); player.playSound(loc, Sound.GHAST_FIREBALL, 1, 1); player.teleport(arena.hidersWarp); } else if (loc.getBlockZ() < minZ) { event.setCancelled(true); - player.playEffect(loc, Effect.ENDER_SIGNAL, 0); + player.playEffect(loc, Effect.ENDER_SIGNAL, null); player.playSound(loc, Sound.GHAST_FIREBALL, 1, 1); player.teleport(arena.hidersWarp); } else if (loc.getBlockY() > maxY) { event.setCancelled(true); - player.playEffect(loc, Effect.ENDER_SIGNAL, 0); + player.playEffect(loc, Effect.ENDER_SIGNAL, null); player.playSound(loc, Sound.GHAST_FIREBALL, 1, 1); player.teleport(arena.hidersWarp); } else if (loc.getBlockY() < minY) { event.setCancelled(true); - player.playEffect(loc, Effect.ENDER_SIGNAL, 0); + player.playEffect(loc, Effect.ENDER_SIGNAL, null); player.playSound(loc, Sound.GHAST_FIREBALL, 1, 1); player.teleport(arena.hidersWarp); } diff --git a/src/nl/Steffion/BlockHunt/SolidBlockHandler.java b/src/nl/Steffion/BlockHunt/SolidBlockHandler.java index 6050332..a5a2d4a 100644 --- a/src/nl/Steffion/BlockHunt/SolidBlockHandler.java +++ b/src/nl/Steffion/BlockHunt/SolidBlockHandler.java @@ -14,6 +14,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; public class SolidBlockHandler { + @SuppressWarnings("deprecation") public static void makePlayerUnsolid(Player player) { ItemStack block = player.getInventory().getItem(8); Block pBlock = player.getLocation().getBlock(); @@ -48,6 +49,7 @@ public class SolidBlockHandler { for (Player playerShow : Bukkit.getOnlinePlayers()) { playerShow.showPlayer(player); } + MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getTypeId(), block.getDurability()); DisguiseAPI.disguiseToAll(player, disguise);