Needing help with the getLocation

Hi, my name is Mitchell. You may know me from the posts of me transporting my code from bukkit to sponge. Well, It’s still in bukkit code at the moment, and I’m at a stand still with some code. In this particular set of code, you can right click a dungeon sign and it gives you one dungeon point. I’m trying to make it where you can have multiple signs at a time by just getting the location of the sign (x y, and z) instead of the name in line 1 of the sign. Here’s the code, and see if you know what my problem is.

    // Dungeon Points Code
    	@EventHandler
    	public boolean onBlockClick(PlayerInteractEvent event) {
    
    		if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
    			return false;
    		}
    		Block block = event.getClickedBlock();
    		if ((block.getType() == Material.SIGN)
    				|| (block.getType() == Material.SIGN_POST)
    				|| (block.getType() == Material.WALL_SIGN)) {
    			Sign sign = (Sign) block.getState();
    			if ((sign.getLine(0).equalsIgnoreCase("[Finish]"))
    					&& (!isPlayerHaveDungeonPoint(event.getPlayer().getName(),
    							sign.getLocation()))) {
    
    				event.getPlayer().sendMessage(
    						ChatColor.BOLD + "[ZwRPG] " + ChatColor.GOLD
    								+ "Congratulations, you got " + ChatColor.RED
    								+ "1" + ChatColor.GOLD + " dungeon point!");
    				addDungeonPoint(event.getPlayer().getName(), sign.getLocation());
    			} else {
    				if (isPlayerHaveDungeonPoint(event.getPlayer().getName(),
    						sign.getLocation())) {
    					event.getPlayer().sendMessage(
    							ChatColor.BOLD + "[ZwRPG] " + ChatColor.RED
    									+ "You've already finished this dungeon!");
    				}
    			}
    		}
    		return false;
    	}
// Dungeon Points Code
public int getPlayerDungeonPointsNumber(String playername) {

	File file = new File("plugins/ZeldaWorld/config.yml");
	try {
		getConfig().load(file);
	} catch (FileNotFoundException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	} catch (InvalidConfigurationException e) {
		e.printStackTrace();
	}
	List<String> dungeonPointNames = getConfig().getStringList(playername);
	int amount = 0;
	Iterator<String> iter = dungeonPointNames.iterator();
	while (iter.hasNext()) {
		iter.next();
		amount++;
	}
	return amount;
}

// Dungeon Points Code
public void addDungeonPoint(String playername, Location location) {

	List<String> currentstringlist = getConfig().getStringList(playername);
	currentstringlist.(location); //<--- red lined!
	getConfig().set(playername, currentstringlist);
	File file = new File("plugins/ZeldaWorld/config.yml");
	try {
		getConfig().save(file);
	} catch (IOException e) {
		this.logger.severe("Error saving ZeldaWorld file!");
		e.printStackTrace();
	}
}

// Dungeon Points Code
public boolean isPlayerHaveDungeonPoint(String playername, //I'm pretty sure I got this bit right...
		Location location) {
	File file = new File("plugins/ZeldaWorld/config.yml");
	try {
		getConfig().load(file);
	} catch (FileNotFoundException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	} catch (InvalidConfigurationException e) {
		e.printStackTrace();
	}
	List<String> dungeons = getConfig().getStringList(playername);
	Iterator<String> iter = dungeons.iterator();
	while (iter.hasNext()) {
		if (((String) iter.next()).equals(location)) {
			return true;
		}
	}
	return false;
}

So your trying to get the location of a block (sign)? Not sure but I think you can simply do getx() on the block instance in sponge.

https://github.com/SpongePowered/SpongeAPI/blob/master/src/main/java/org/spongepowered/api/block/BlockLoc.java

Found a fix!

// Dungeon Points Code

// I added "" + sign.getX() + "." + sign.getY() + "." +sign.getZ()))) for getting the coordinates. I find this much simpler!


@EventHandler
public boolean onBlockClick(PlayerInteractEvent event) {

    if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
        return false;
    }
    Block block = event.getClickedBlock();
    if ((block.getType() == Material.SIGN)
            || (block.getType() == Material.SIGN_POST)
            || (block.getType() == Material.WALL_SIGN)) {
        Sign sign = (Sign) block.getState();
        if ((sign.getLine(0).equalsIgnoreCase("[Finish]"))
                && (!isPlayerHaveDungeonPoint(
                        event.getPlayer().getName(),
                        "" + sign.getX() + "." + sign.getY() + "."
                                + sign.getZ()))) {

            event.getPlayer().sendMessage(
                    ChatColor.BOLD + "[ZwRPG] " + ChatColor.GOLD
                            + "Congratulations, you got " + ChatColor.RED
                            + "1" + ChatColor.GOLD + " dungeon point!");
            addDungeonPoint(event.getPlayer().getName(), "" + sign.getX()
                    + "." + sign.getY() + "." + sign.getZ());
        } else {
            if (isPlayerHaveDungeonPoint(event.getPlayer().getName(), ""
                    + sign.getX() + "." + sign.getY() + "." + sign.getZ())) {
                event.getPlayer().sendMessage(
                        ChatColor.BOLD + "[ZwRPG] " + ChatColor.RED
                                + "You've already finished this dungeon!");
            }
        }
    }
    return false;
}