Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1.   public void sendFor(OfflinePlayer paramOfflinePlayer) {
  2.     Set<String> keys = this.section.getKeys(false);
  3.     double weight = 0;
  4.     for (String str1 : keys) {
  5.       weight += this.section.getDouble(str1 + ".chance");
  6.     }
  7.     for (String str1 : keys) {
  8.       double d = this.section.getDouble(str1 + ".chance");
  9.       List localList = this.section.getStringList(str1 + ".command");
  10.  
  11.       if (rdm.nextDouble() < (d / weight)) {
  12.         weight = weight - d;
  13.         for (String str2 : localList)
  14.           Bukkit.dispatchCommand(Bukkit.getConsoleSender(), PinataParty.placeholderParser.parse(paramOfflinePlayer, str2));
  15.         break;
  16.       }
  17.     }
  18.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement