Whats wrong with this? Please help!

Discussion in 'Plugin Development' started by camji555, Jul 19, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    camji555

    @EventHandler
    public void onBlockBreak(BlockBreakEvent event) {

    Sign sign = (Sign) event.getBlock().getState();
    String arenaName = sign.getLine(2);

    World w = Bukkit.getWorld(plugin.getConfig().getString("LobbySign." + arenaName + ".World"));
    int x = plugin.getConfig().getInt("LobbySign." + arenaName + ".x");
    int y = plugin.getConfig().getInt("LobbySign." + arenaName + ".y");
    int z = plugin.getConfig().getInt("LobbySign." + arenaName + ".z");
    if(event.getBlock().getWorld() == w || event.getBlock().getLocation().getBlockX() == x || event.getBlock().getLocation().getBlockY() == y || event.getBlock().getLocation().getBlockZ() == z){
    if(event.getBlock().getType() == Material.WALL_SIGN || event.getBlock().getType() == Material.SIGN_POST){
    plugin.getConfig().set("LobbySign." + arenaName, null);
    plugin.saveConfig();
    }
    }

    }

    Never mind i got it. I just needed to check the material before i casted sign.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
Thread Status:
Not open for further replies.

Share This Page