コード例 #1
0
 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);
     }
   }
 }
コード例 #2
0
  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;
      }
    }
  }
コード例 #3
0
 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);
   }
 }