How to set a podium in my minigame

Discussion in 'Spigot Plugin Development' started by luigieai, Jan 12, 2015.

  1. WARNING! You will see a bad english in this thread. Sorry about that :(
    Whats up guys, everything fine?
    Im creating a skywars minigame, and i already know how to pick values from a config and sort it, so, i already have a method to pick the 3 top winners from my minigame database, but i need to make something like this:
    [​IMG]
    The steve heads will represent the top winners, i already have the method to pick the top 3 winners:

    Code (Text):
        ArrayList<String> data = SettingsManager.getWins().getValues();

        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(cmd.getName().equalsIgnoreCase("SetarMelhores")){
                Collections.sort(data, new Comparator<String>() {
                    public int compare(String a, String b) {
                           int aVal = Integer.parseInt(a.split(" ")[0]);
                           int bVal = Integer.parseInt(b.split(" ")[0]);
                         
                           return Integer.compare(aVal, bVal);
                    }
                });
                for (int i = (data.size() > 3 ? 3 : data.size()) - 1; i >= 0; i--) {
                    String line = data.get(i);
                    String player = line.split(" ")[1], bal = line.split(" ")[0];//this will just to pick the 3 top winners
                   
               }
              }
            return false;  
            }
    but i dont have a minimal idea how i will make the podium(image above) setting the players head, what is the better way to do this?
     
  2. I would find it easier just replacing the steve heads in the world.

    Here's the code:

    Code (Text):
    Block block = world.getBlockAt(X,Y,Z);
    block.setTypeId(BLOCK_HERE);
    Do the code above for each head and add the meta for the head to change the texture to the player who won the game head's.

    PS: I am still learning the Bukkit API so this may not be correct.
     
  3. This is a good way to do that, but i think this will need to refresh every second, so im thinking settings the head location in a config file, this is a good way?
     
  4. Setting the head location in a config file will work too.
     
    • Informative Informative x 1
    • Useful Useful x 1