Advertisement
Lisenochek

Untitled

Oct 7th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. package com.board.api;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.Material;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.inventory.ItemStack;
  7.  
  8. import com.board.scoreboard.ScoreBoard_One;
  9. import com.board.scoreboard.ScoreBoard_Three;
  10. import com.board.scoreboard.ScoreBoard_Two;
  11.  
  12. public class Timer implements Runnable {
  13.  
  14. int timer = 0;
  15.  
  16. @Override
  17. public void run() {
  18.  
  19. for (Player p : Bukkit.getOnlinePlayers()) {
  20.  
  21. if (p.getWorld().getName().equalsIgnoreCase("MiniGame_BedWars")) {
  22. return;
  23. }
  24.  
  25. for (ItemStack stack : p.getInventory().getContents()) {
  26.  
  27. if (stack == null) {
  28. continue;
  29. }
  30.  
  31. if (stack.getType() == Material.DIAMOND && stack.getItemMeta() != null
  32. && stack.getItemMeta().getDisplayName() != null
  33. && stack.getItemMeta().getDisplayName().equalsIgnoreCase("govnocode")) {
  34. return;
  35. }
  36. }
  37.  
  38. if (timer % 50 == 0) {
  39.  
  40. ScoreBoard_One.Board(p);
  41. }
  42.  
  43. if (timer % 100 == 0) {
  44.  
  45. ScoreBoard_Two.Board(p);
  46. }
  47.  
  48. if (timer % 150 == 0) {
  49.  
  50. ScoreBoard_Three.Board(p);
  51. }
  52. }
  53.  
  54. ++timer;
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement