Advertisement
Guest User

RandomCommands - Clase principal

a guest
Oct 9th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public class Main extends JavaPlugin {
  2.  
  3. public static ArrayList<String> comandos = new ArrayList<String>();
  4.  
  5. public void onEnable() {
  6. comandos.add("say Marcuri");
  7. comandos.add("say Potaje");
  8. comandos.add("say AfricanoLeproso");
  9. comandos.add("say Pene");
  10. BukkitTask counter = new Hours(this).runTaskTimer(this, 50, 50);
  11. }
  12.  
  13. public void onDisable() {
  14.  
  15. }
  16.  
  17. public static String getAtList() {
  18. Random r = new Random();
  19. int toGet = comandos.size() - 2;
  20. Integer rI = r.nextInt(toGet);
  21. String toReturn = comandos.get(rI);
  22. return toReturn;
  23. }
  24.  
  25. public static void execute(String s) {
  26. Bukkit.getServer().dispatchCommand(s, Bukkit.getServer().getConsoleSender());
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement