Skip to content

Chayanon-Ninyawee/GfmCommandCreator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to install

To install GfmCommandCreator to your local maven repository.

git clone https://github.com/Chayanon-Ninyawee/GfmCommandCreator.git
cd gfmcommandcreator/
mvn clean install

To add GfmCommandCreator as a dependency

<dependency>
	<groupId>me.garfieldcmix</groupId>
	<artifactId>gfmcommandcreator</artifactId>
	<version>0.0.1</version>
</dependency>

To shade to your plugin

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-shade-plugin</artifactId>
	<version>3.4.0</version>
	<executions>
		<execution>
			<phase>package</phase>
			<goals>
				<goal>shade</goal>
            		</goals>
		</execution>
	</executions>
</plugin>   

Usage

To register all GfmHeadCommand you had created

GfmCommandCreator.register(yourJavaPlugin, listOfGfmHeadCommand);

You also need to add the command in the plugin.yml

commands:
  cmd1:
  cmd2:
  cmd3:
  .
  .
  .

To create GfmHeadCommand

(GfmHeadCommand) new GfmHeadCommand.builder()
	// Put any configuration specifically for GfmHeadCommand first
	.setName("yourCommand") // Can't have the same name as other headCommand
	.setGfmCommandHandler((sender, args) -> false) // You can use lambba expression here
	// Other Configuration
	.build()

To create GfmSubCommand

(GfmSubCommand) new GfmSubCommand.builder()
	// Put any configuration specifically for GfmSubCommand first
	.setName("yourSubCommand") // Can't have the same name as other headCommand
	.setGfmCommandHandler((sender, args) -> false) // You can use lambba expression here
	// Other Configuration
	.build()

About

This is command api for spigot plugin.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages