Locations and Worlds

Discussion in 'Plugin Development' started by jordanzilla02, Feb 18, 2014.

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

    jordanzilla02

    I am working on a plugin that has configurable places where a certain place will be but when I assign the Locations to the coordinates it is throwing an error saying that there is no world assigned. I want to know how I would check if a world exist and how I could avoid having to fill the world part of the location setting.

    Another question I have is that I might implement a map voting system. How would I switch the worlds around and scan for the world along with setting the locations. How do you guys do this if you develop minigames.

    Pretty much in the last paragraph I am wondering how you manage your locations and scan through the worlds to get the correct one, as an example there is the hive voting.
     
  2. Offline

    caseif

    1. Check that Bukkit.getWorld(worldName) isn't null. A location can't be created without a World; you'd need to avoid creating the object entirely if the check returns false.
    2. This is off the top of my head, so it might not be the best way of doing it, but you could use a HashMap to keep track of votes. When a player runs a command, add them to the HashMap along with their vote. Have the value be an Integer representing the map's name's position in a List or something. I'm not totally sure what you're asking in the second part.
     
Thread Status:
Not open for further replies.

Share This Page