Enum Class ItemFlag
- All Implemented Interfaces:
Serializable, Comparable<ItemFlag>, Constable
道具旗標位元欄位的列舉定義,對應用戶端協定中的
flag 短整數。
每個常數持有一個位元遮罩值(i),可透過 check(int) 判斷某旗標是否已設定。
常見旗標包含:
LOCK(0x01):道具鎖定,防止意外丟棄或交易UNTRADEABLE(0x08):不可交易KARMA_EQ/KARMA_USE:業力卷軸清除不可交易標記SCROLL_PROTECT(0x4000):卷軸保護,防止卷軸失敗時道具消失
旗標值由 Item 持有,並在 ItemLoader 載入、
tools.packet.InventoryPacket 組裝封包時讀取。
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
-
Enum Constant Details
-
LOCK
-
SPIKES
-
COLD
-
UNTRADEABLE
-
KARMA_EQ
-
KARMA_USE
-
CHARM_EQUIPPED
-
ANDROID_ACTIVATED
-
CRAFTED
-
CRAFTED_USE
-
SHIELD_WARD
-
LUCKS_KEY
-
KARMA_ACC_USE
-
KARMA_ACC
-
SLOTS_PROTECT
-
SCROLL_PROTECT
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getValue
public final int getValue() -
check
public final boolean check(int flag)
-