Interface Cost


public interface Cost
一项消耗或前置条件。CostPlan 保证只在全部 test(org.bukkit.entity.Player) 通过后才调用 take(org.bukkit.entity.Player)。

所有方法都会访问玩家状态,应在 Bukkit 主线程调用。

  • Method Summary

    Modifier and Type
    Method
    Description
    面向玩家的描述,例如 金币 500。
    me.kzheart.klib.hook.cost.Charge
    take(org.bukkit.entity.Player player)
    执行扣除并返回可退还的结果;只检查不扣除的条件返回 Charge.free()。
    boolean
    test(org.bukkit.entity.Player player)
     
  • Method Details

    • describe

      String describe()
      面向玩家的描述,例如 金币 500。
    • test

      boolean test(org.bukkit.entity.Player player)
    • take

      me.kzheart.klib.hook.cost.Charge take(org.bukkit.entity.Player player)
      执行扣除并返回可退还的结果;只检查不扣除的条件返回 Charge.free()。