Enum Class MergePolicy
- All Implemented Interfaces:
Serializable, Comparable<MergePolicy>, Constable
How a command node behaves when several plugins contribute to the same command
tree — e.g. two plugins each adding sub-commands under a shared
/nox
root. It governs ownership of a node's execute action (the handler that
runs when a player stops at that node), not whether sub-commands are added: leaf
sub-commands always accumulate.
The default is CONTRIBUTE, which makes merging safe: a node's execute
is claimed only if still free, so contributions accumulate and no plugin silently
clobbers another's handler regardless of load order.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionClaim this node's execute only if no one has claimed it yet (put-if-absent); never overwrite another plugin's execute.Only add sub-commands under this node; never claim its execute.Take this node's execute for this contributor, replacing any existing one. -
Method Summary
Modifier and TypeMethodDescriptionstatic MergePolicyReturns the enum constant of this class with the specified name.static MergePolicy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONTRIBUTE
Claim this node's execute only if no one has claimed it yet (put-if-absent); never overwrite another plugin's execute. The safe default for contributing into a shared root. -
OVERRIDE
Take this node's execute for this contributor, replacing any existing one. If two contributors both OVERRIDE the same node, the last one wins and a warning naming both is logged. -
EXTEND
Only add sub-commands under this node; never claim its execute. Use when a plugin extends a node another plugin owns (e.g. addingworlds createwithout owning what/nox worldsitself runs).
-
-
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
-