Enum Class ItemFlag

java.lang.Object
java.lang.Enum<ItemFlag>
client.inventory.ItemFlag
All Implemented Interfaces:
Serializable, Comparable<ItemFlag>, Constable

public enum ItemFlag extends Enum<ItemFlag>
道具旗標位元欄位的列舉定義,對應用戶端協定中的 flag 短整數。

每個常數持有一個位元遮罩值(i),可透過 check(int) 判斷某旗標是否已設定。 常見旗標包含:

  • LOCK(0x01):道具鎖定,防止意外丟棄或交易
  • UNTRADEABLE(0x08):不可交易
  • KARMA_EQ / KARMA_USE:業力卷軸清除不可交易標記
  • SCROLL_PROTECT(0x4000):卷軸保護,防止卷軸失敗時道具消失

旗標值由 Item 持有,並在 ItemLoader 載入、 tools.packet.InventoryPacket 組裝封包時讀取。

  • Enum Constant Details

    • LOCK

      public static final ItemFlag LOCK
    • SPIKES

      public static final ItemFlag SPIKES
    • COLD

      public static final ItemFlag COLD
    • UNTRADEABLE

      public static final ItemFlag UNTRADEABLE
    • KARMA_EQ

      public static final ItemFlag KARMA_EQ
    • KARMA_USE

      public static final ItemFlag KARMA_USE
    • CHARM_EQUIPPED

      public static final ItemFlag CHARM_EQUIPPED
    • ANDROID_ACTIVATED

      public static final ItemFlag ANDROID_ACTIVATED
    • CRAFTED

      public static final ItemFlag CRAFTED
    • CRAFTED_USE

      public static final ItemFlag CRAFTED_USE
    • SHIELD_WARD

      public static final ItemFlag SHIELD_WARD
    • LUCKS_KEY

      public static final ItemFlag LUCKS_KEY
    • KARMA_ACC_USE

      public static final ItemFlag KARMA_ACC_USE
    • KARMA_ACC

      public static final ItemFlag KARMA_ACC
    • SLOTS_PROTECT

      public static final ItemFlag SLOTS_PROTECT
    • SCROLL_PROTECT

      public static final ItemFlag SCROLL_PROTECT
  • Method Details

    • values

      public static ItemFlag[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ItemFlag valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public final int getValue()
    • check

      public final boolean check(int flag)