Get Greatest integer in config

Discussion in 'Plugin Development' started by Monkeyboystein, Aug 24, 2013.

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

    Monkeyboystein

    Hia im making a king-of-the-warzone plugin and im having an issue thats stressing me out,

    there are different chest levels, and when a faction clicks button 10 more times since they became the king of the warzone the chests get promoted to level 1 again, and when they get 20 more then when they became king the chests get promoted to level 2, so on, and so on, there are bools in the config such as

    ChestLevel[1-5] = true/false

    But i cant figure out how to get the king of the warzone and when they get over thrown by another faction to reset the chests to a level 1

    to get kind you must have the highest button presses of the button
     
  2. Offline

    metalhedd

    why aren't you just storing ChestLevel = [1-5] instead of an individual boolean for each one?
     
  3. Offline

    Monkeyboystein

    because thats how im doing it, not being rude, i want to keep it that way, do you know how to make a list of ints and get the greatest one?
     
  4. Offline

    metalhedd

    sort the list and take the first one.
     
  5. Offline

    Monkeyboystein

    How do i set it with a string name because i need like
    faction1: 14
    faction2: 13
    faction3: 12
    so on so on
     
  6. Offline

    metalhedd

    This has nothing to do with the bukkit api. its a basic java question. google for how to sort a hashmap by value.
     
Thread Status:
Not open for further replies.

Share This Page