Class PaperExecutionSource

java.lang.Object
io.github.projectunified.craftcommand.processor.paper.PaperExecutionSource
All Implemented Interfaces:
ExecutionSource

public class PaperExecutionSource extends Object implements ExecutionSource
Brigadier-based implementation of ExecutionSource for Paper command execution.
  • Method Details

    • generateSenderResolution

      public void generateSenderResolution(com.palantir.javapoet.MethodSpec.Builder methodSpec, CommandModel classModel, MethodModel method, CommandModel rootModel, String senderVarName, ParameterModel senderParam, com.palantir.javapoet.TypeName senderParamTypeName)
      Description copied from interface: ExecutionSource
      Generates code to resolve and cast the command sender.
      Specified by:
      generateSenderResolution in interface ExecutionSource
      Parameters:
      methodSpec - the target method builder
      classModel - the command class model
      method - the command method model
      rootModel - the root command model
      senderVarName - the variable name to assign the sender to
      senderParam - the sender parameter model
      senderParamTypeName - the JavaPoet TypeName of the sender
    • generateExecutionSetup

      public void generateExecutionSetup(com.palantir.javapoet.MethodSpec.Builder methodSpec, CommandModel classModel, MethodModel method, CommandModel rootModel)
      Description copied from interface: ExecutionSource
      Generates code for platform-specific execution setup or static checks (e.g. checking command length).
      Specified by:
      generateExecutionSetup in interface ExecutionSource
      Parameters:
      methodSpec - the target method builder
      classModel - the command class model
      method - the command method model
      rootModel - the root command model
    • generateParameterResolution

      public void generateParameterResolution(com.palantir.javapoet.MethodSpec.Builder methodSpec, CommandModel classModel, MethodModel method, CommandModel rootModel, ParameterModel pm, String varName, String senderVarName, int paramIndex)
      Description copied from interface: ExecutionSource
      Generates code to parse and resolve a specific command parameter.
      Specified by:
      generateParameterResolution in interface ExecutionSource
      Parameters:
      methodSpec - the target method builder
      classModel - the command class model
      method - the command method model
      rootModel - the root command model
      pm - the parameter model to resolve
      varName - the variable name to assign the resolved parameter to
      senderVarName - the variable name of the resolved sender
      paramIndex - the index of the parameter in the command method (excluding sender)