Package wtf.choco.locksecurity.api.key
Enum KeyFlag
- All Implemented Interfaces:
Serializable
,Comparable<KeyFlag>
,java.lang.constant.Constable
public enum KeyFlag extends Enum<KeyFlag>
Represents a property (flag) that may be assigned to a smithed key.
- Since:
- 3.0.0
- Author:
- Parker Hawke - Choco
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description BREAK_ON_USE
The key will break on use.HIDE_BLOCK_COORDINATES
The key should hide coordinates in the key's lore.HIDE_FLAG_LORE
The key should hide the lore applied by other key flags.PREVENT_DUPLICATION
The key cannot be duplicated in a crafting table with an unsmithed key.PREVENT_MERGING
The key cannot be merged in a crafting table with another smithed key.PREVENT_RESETTING
The key cannot be reset in a crafting table. -
Field Summary
Fields Modifier and Type Field Description static int
BITMASK
-
Method Summary
Modifier and Type Method Description int
getBit()
Get the internal bit used to represent this flag in persistent storage.String
getLoreEntry()
Get the line of text to be written in the key's lore.static KeyFlag
valueOf(String name)
Returns the enum constant of this type with the specified name.static KeyFlag[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
PREVENT_DUPLICATION
The key cannot be duplicated in a crafting table with an unsmithed key. -
PREVENT_MERGING
The key cannot be merged in a crafting table with another smithed key. -
PREVENT_RESETTING
The key cannot be reset in a crafting table. -
BREAK_ON_USE
The key will break on use. -
HIDE_BLOCK_COORDINATES
The key should hide coordinates in the key's lore. -
HIDE_FLAG_LORE
The key should hide the lore applied by other key flags. Very meta...
-
-
Field Details
-
BITMASK
public static final int BITMASK- See Also:
- Constant Field Values
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getBit
public int getBit()Get the internal bit used to represent this flag in persistent storage.- Returns:
- the internal bit representation
-
getLoreEntry
Get the line of text to be written in the key's lore.- Returns:
- the lore entry. null if none
-