Class PaperCommandGenerator
java.lang.Object
io.github.projectunified.craftcommand.processor.generator.BaseCommandGenerator
io.github.projectunified.craftcommand.processor.paper.PaperCommandGenerator
- All Implemented Interfaces:
CommandGenerator
Generates
*$PaperCommand wrappers with a native Brigadier tree.-
Field Summary
Fields inherited from class io.github.projectunified.craftcommand.processor.generator.BaseCommandGenerator
DEFAULT_PERMISSION_MESSAGE, PERMISSION_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureClass(com.palantir.javapoet.TypeSpec.Builder typeSpec, CommandModel model) Configures the generated class declaration (superclass, interfaces).protected voidgenerateEntryMethods(com.palantir.javapoet.TypeSpec.Builder typeSpec, CommandModel model) Adds the platform entry points (execute,tabComplete,getCommandNode, ...).protected voidgenerateHelpers(com.palantir.javapoet.TypeSpec.Builder typeSpec, CommandModel model) Generates the execution and suggestion routing plus the sender helpers of the whole command tree.protected com.palantir.javapoet.TypeNameTheCommandManagertype, including its sender type argument.protected com.palantir.javapoet.CodeBlockgetSenderExpression(String senderVar) Wraps the raw sender variable in the platform expression that yields the sender object.com.palantir.javapoet.ClassNameThe platform's native sender type.protected StringThe suffix appended to the command class name, for example"$BukkitCommand".protected voidonBeforeExecute(com.palantir.javapoet.MethodSpec.Builder methodSpec, Element element, String returnStatement) Runs before a command method is executed, for example a permission check.Methods inherited from class io.github.projectunified.craftcommand.processor.generator.BaseCommandGenerator
addConstructorStatements, anyMethod, buildAliasesExpression, buildCommandInfo, buildSenderCastHelpers, buildSuggestionRouting, buildTypeSuggestionHelpers, call, firstParamIsSender, firstParamIsSender, generate, generateExecuteMethodBody, generatePlatformHelpers, generateResolverInvocation, generateSenderResolution, generateSubcommandClassExecutors, generateSubcommandFieldsAndConstructors, generateUnknownSubcommandMessage, getBuiltInWidth, getInstanceVarExpression, getLocalResolverMaxWidth, getLocalResolverMinWidth, getParameterSuggestionMethodName, getResolverInstanceExpr, getResolverParamSuggestionMethodName, getResolverSenderExpression, getSubcommandFieldName, getSubcommandNames, i18nKey, isI18nKey, isSenderBaseType, isSenderParam, isSenderType, runParameterAnnotationHandlers, senderTypeRegistry, typeSupport
-
Constructor Details
-
PaperCommandGenerator
-
-
Method Details
-
getWrapperClassSuffix
Description copied from class:BaseCommandGeneratorThe suffix appended to the command class name, for example"$BukkitCommand".- Specified by:
getWrapperClassSuffixin classBaseCommandGenerator
-
configureClass
Description copied from class:BaseCommandGeneratorConfigures the generated class declaration (superclass, interfaces).- Overrides:
configureClassin classBaseCommandGenerator
-
getSenderTypeName
public com.palantir.javapoet.ClassName getSenderTypeName()Description copied from class:BaseCommandGeneratorThe platform's native sender type.- Specified by:
getSenderTypeNamein classBaseCommandGenerator
-
getManagerType
protected com.palantir.javapoet.TypeName getManagerType()Description copied from class:BaseCommandGeneratorTheCommandManagertype, including its sender type argument.- Specified by:
getManagerTypein classBaseCommandGenerator
-
getSenderExpression
Description copied from class:BaseCommandGeneratorWraps the raw sender variable in the platform expression that yields the sender object.- Overrides:
getSenderExpressionin classBaseCommandGenerator
-
generateEntryMethods
protected void generateEntryMethods(com.palantir.javapoet.TypeSpec.Builder typeSpec, CommandModel model) Description copied from class:BaseCommandGeneratorAdds the platform entry points (execute,tabComplete,getCommandNode, ...).- Specified by:
generateEntryMethodsin classBaseCommandGenerator
-
generateHelpers
Description copied from class:BaseCommandGeneratorGenerates the execution and suggestion routing plus the sender helpers of the whole command tree.- Overrides:
generateHelpersin classBaseCommandGenerator
-
onBeforeExecute
protected void onBeforeExecute(com.palantir.javapoet.MethodSpec.Builder methodSpec, Element element, String returnStatement) Description copied from class:BaseCommandGeneratorRuns before a command method is executed, for example a permission check.- Overrides:
onBeforeExecutein classBaseCommandGenerator
-