Advertisement
Guest User

Untitled

a guest
Oct 10th, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. @EventHandler
  2. public void onHulk(final PlayerInteractEvent e) {
  3. final Player p = (Player)e.getPlayer();
  4. if(Kits.HulkKit.containsKey(p)) {
  5. if(p.getInventory().getItemInHand().getType() == Material.SUGAR) {
  6. if((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
  7. if(Kits.Hulkcd.contains(p)) {
  8. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
  9. public void run() {
  10. if(Hulkcount != -1) {
  11. if(Hulkcount != 0) {
  12. e.setCancelled(true);
  13. Hulkcount --;
  14. }else{
  15. p.sendMessage(prefix + ChatColor.GREEN + "You may now smash again!");
  16. Kits.Hulkcd.remove(p);
  17. }
  18. }
  19. }
  20. }, 0, 20L);
  21. }
  22. }else if(!(Kits.Hulkcd.contains(p))) {
  23. p.sendMessage(ChatColor.GREEN + "HULK SMASH!!!!!");
  24. p.sendMessage(ChatColor.GREEN + "HULK SMASH!!!!!");
  25. p.sendMessage(ChatColor.GREEN + "HULK SMASH!!!!!");
  26. p.getWorld().playSound(p.getLocation(), Sound.AMBIENCE_THUNDER, 1, 1);
  27. p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 60, 5));
  28. Kits.Hulkcd.add(p);
  29. }
  30. }
  31. }
  32. }
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39. @EventHandler
  40. public void onHulk2(final PlayerInteractEvent e) {
  41. final Player p = (Player)e.getPlayer();
  42. if(Kits.HulkKit.containsKey(p)) {
  43. if(p.getInventory().getItemInHand().getType() == Material.SUGAR) {
  44. if((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
  45. if(Kits.Hulkcd.contains(p)) {
  46. p.sendMessage(prefix + ChatColor.RED + Hulkcount + " Second(s) untill you may smash again!");
  47. }
  48. }
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement