private void leftAction(Player player) { if (CoolTimeChecker.check(player, 1) && PlayerInventory.checkItem(player, material, stack1)) { Skill.use(player, material, stack1, 1, coolTime1); { CoolTimer.cool0.put(playerName + "1", 7); } } }
public void onPlayerInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); if (PlayerInventory.checkInHandItem(player, Material.BLAZE_ROD)) { switch (EventFilter.sortInteraction(event)) { case 0: case 1: leftAction(player); break; case 2: case 3: rightAction(player); break; } } }
private void rightAction(Player player) { if (CoolTimeChecker.check(player, 2) && PlayerInventory.checkItem(player, material, stack2)) { Skill.use(player, material, stack2, 2, coolTime2); player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 500, 0), true); } }