Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onHulk(final PlayerInteractEvent e) {
- final Player p = (Player)e.getPlayer();
- if(Kits.HulkKit.containsKey(p)) {
- if(p.getInventory().getItemInHand().getType() == Material.SUGAR) {
- if((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
- if(Kits.Hulkcd.contains(p)) {
- Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
- public void run() {
- if(Hulkcount != -1) {
- if(Hulkcount != 0) {
- e.setCancelled(true);
- Hulkcount --;
- }else{
- p.sendMessage(prefix + ChatColor.GREEN + "You may now smash again!");
- Kits.Hulkcd.remove(p);
- }
- }
- }
- }, 0, 20L);
- }
- }else if(!(Kits.Hulkcd.contains(p))) {
- p.sendMessage(ChatColor.GREEN + "HULK SMASH!!!!!");
- p.sendMessage(ChatColor.GREEN + "HULK SMASH!!!!!");
- p.sendMessage(ChatColor.GREEN + "HULK SMASH!!!!!");
- p.getWorld().playSound(p.getLocation(), Sound.AMBIENCE_THUNDER, 1, 1);
- p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 60, 5));
- Kits.Hulkcd.add(p);
- }
- }
- }
- }
- @EventHandler
- public void onHulk2(final PlayerInteractEvent e) {
- final Player p = (Player)e.getPlayer();
- if(Kits.HulkKit.containsKey(p)) {
- if(p.getInventory().getItemInHand().getType() == Material.SUGAR) {
- if((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
- if(Kits.Hulkcd.contains(p)) {
- p.sendMessage(prefix + ChatColor.RED + Hulkcount + " Second(s) untill you may smash again!");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement