Add getters for permission and sender type to Command.Builder

This commit is contained in:
jmp 2020-12-14 15:54:48 -08:00 committed by Alexander Söderberg
parent f2f187f58d
commit 79aad9d79a

View file

@ -307,6 +307,30 @@ public class Command<C> {
this.flags = Objects.requireNonNull(flags, "Flags may not be null"); this.flags = Objects.requireNonNull(flags, "Flags may not be null");
} }
/**
* Get the required sender type for this builder
* <p>
* Returns {@code null} when there is not a specific required sender type
*
* @return required sender type
* @since 1.3.0
*/
public @Nullable Class<? extends C> senderType() {
return this.senderType;
}
/**
* Get the required command permission for this builder
* <p>
* Will return {@link Permission#empty()} if there is no required permission
*
* @return required permission
* @since 1.3.0
*/
public @NonNull CommandPermission commandPermission() {
return this.commandPermission;
}
/** /**
* Add command meta to the internal command meta map * Add command meta to the internal command meta map
* *