Annotation/Reflection Based Bukkit Command API. Containing many features such as help-service, command providers, tab completion, and many more!

Overview

CommandAPI

Annotation/Reflection Based Command API that just does what you want it to do without any problems.

Importing

  • Maven
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository
	<dependency>
	    <groupId>com.github.therealdamt</groupId>
	    <artifactId>commandapi</artifactId>
	    <version>1.4.0</version>
	</dependency>
  • Gradle
  repositories {
	        ...
	        maven { url 'https://jitpack.io' }
	}
  dependencies {
	        implementation 'com.github.therealdamt:commandapi:1.4.0'
	}

How to use

  • Example main class
public class Main extends JavaPlugin {
    @Override
    public void onEnable() { // You also have the default tab completer, and the default help service, new DefaultTabCompleter(); 
        new CommandHandler(this).bind(ItemStack.class, new ItemStackProvider())
                .register(new FlyCommand(), new ItemStackCommand()).helpService(new HelpService())
                .tabComplete(new TabCompleter()).registerCommands();
    }

}
  • Example command class
public class ItemStackCommand {

    @Command(value = "kekw", async = true, usage = "/kekw itemStack", description = "Just makes an itemstack lol")
    @Permission(permission = "kekw.kekew", message = "no perm noob")
    public void itemStackCommand(@Sender Player player, @Name("itemStack") ItemStack itemStack) {
        player.getInventory().addItem(itemStack);
        player.sendMessage(ChatColor.GREEN + "Gave ya your itemstack!");
    }

}
  • Example provider
public class ItemStackProvider implements CommandProvider<ItemStack> {

    @Override
    public ItemStack provide(String s) throws CommandProviderNullException {

	Material material = Material.getMaterial(s.toUpperCase());

        if (material == null)
            throw new CommandProviderNullException(ChatColor.RED + "It seems like you did not provide a valid material.");

        return new ItemStack(material);
    }

}
  • Example Help Service
public class HelpService implements HelpCommandService {

    @Override
    public List<String> get(Command command, List<Command> subCommands) {
        return subCommands
		.stream()
		.map(command1 -> command.getUsage() + ", ")
		.collect(Collectors.toList());
    }

}
  • Example Tab Completer
public class TabCompleter implements TabComplete {

    @Override
    public List<String> get(Command command, List<Command> subCommands, String[] args) {
        return subCommands
		.stream()
		.map(subCommand -> subCommand.getName() + "\n")
		.collect(Collectors.toList());
    }

}

Credits

You have full rights to use this command api within your projects, but if possible to include credits that'd be amazing!

Contact

You might also like...

A simplistic configuration API

Config API This is just a simple configuration API I made a while back because I needed one, code is pretty outdated. Current Supported Data Types We

Nov 21, 2021

Library which allows the use and rendering of Blockbench models and animations in a Minecraft server by using generated resource packs and armorstands

Library which allows the use and rendering of Blockbench models and animations in a Minecraft server by using generated resource packs and armorstands

Hephaestus Engine Hephaestus Engine is a library which allows the visualization of block bench models and animations in a Minecraft server by the use

Dec 21, 2022

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)

Sentinel: The Sentinel of Your Microservices Introduction As distributed systems become increasingly popular, the reliability between services is beco

Dec 31, 2022

ColocationSim: Simulate Colocation Datacenter in a Fine Granularity with Microservices and Interference Modeling

ColocationSim: Simulate Colocation Datacenter in a Fine Granularity with Microservices and Interference Modeling

ColocationSim Introduction 将在线作业和离线作业混合部署在同一集群(简称混部,Colocation)提升数据中心资源利用率的主流方法,如何在保证在线作业性能的前提下最大化集群的资源利用率成为混部相关研究中最主要问题。混部作业调度算法从集群层面解决这一问题,是学术界、企业界的

Jan 4, 2023

Source Code for 'Pro Java Microservices with Quarkus and Kubernetes' by Nebrass Lamouchi

Apress Source Code This repository accompanies Pro Java Microservices with Quarkus and Kubernetes by Nebrass Lamouchi (Apress, 2021). Download the fil

Oct 31, 2022

MixStack lets you connects Flutter smoothly with Native pages, supports things like Multiple Tab Embeded Flutter View, Dynamic tab changing, and more. You can enjoy a smooth transition from legacy native code to Flutter with it.

MixStack lets you connects Flutter smoothly with Native pages, supports things like Multiple Tab Embeded Flutter View, Dynamic tab changing, and more. You can enjoy a smooth transition from legacy native code to Flutter with it.

中文 README MixStack MixStack lets you connects Flutter smoothly with Native pages, supports things like Multiple Tab Embeded Flutter View, Dynamic tab

Dec 19, 2022

Lightweight reflection based tab library supporting 1.7 - 1.17 servers and clients.

Lightweight reflection based tab library supporting 1.7 - 1.17 servers and clients.

Aug 23, 2022

An IDE built specifically for Modding Minecraft Java Edition, containing many useful features that will be helpful for modders.

Modding-IDE An IDE built specifically for Modding Minecraft Java Edition, containing many useful features that will be helpful for modders. Trello: ht

Jul 16, 2022

An IDE built specifically for Modding Minecraft Java Edition, containing many useful features that will be helpful for modders.

Railroad IDE Railroad IDE is an IDE that is made specifically for Minecraft Development including Forge Mods, and Fabric Mods! This IDE is made to hel

Dec 8, 2022

Govern Service is a lightweight, low-cost service registration, service discovery, and configuration service SDK.

Govern Service is a lightweight, low-cost service registration, service discovery, and configuration service SDK.

Govern Service is a lightweight, low-cost service registration, service discovery, and configuration service SDK. By using Redis in the existing infrastructure (I believe you have already deployed Redis), it doesn’t need to bring extra to the operation and maintenance deployment. Cost and burden. With the high performance of Redis, Govern Service provides ultra-high TPS&QPS (10W+/s JMH Benchmark).

Nov 22, 2022

An annotation-based command framework for Bukkit

Blade Blade is an easy-to-use command framework based on annotations. It currently only supports Bukkit, but it can be easily extended to more platfor

Nov 6, 2022

Spring JPA Many To Many example with Hibernate and Spring Boot CRUD Rest API - ManyToMany annotation

Spring JPA Many To Many example with Hibernate and Spring Boot CRUD Rest API - ManyToMany annotation

Dec 28, 2022

Define Java service providers by annotating them directly

Annotated Service Provider Define JVM service providers by annotating the provider class directly. This annotation processor will add to the class-pat

Oct 31, 2021

A platform that links service providers with clients using Angular & Springboot

A platform that links service providers with clients using Angular & Springboot

Bricoly : Engineer Your Life The Way It Should Be... 📘 Description This project's aims to connect people who are able to grant services with clients

May 28, 2022

Code4Me provides automatic intelligent code completion based on large pre-trained language models

Code4Me Code4Me provides automatic intelligent code completion based on large pre-trained language models. Code4Me predicts statement (line) completio

Dec 5, 2022
Owner
damt
Java & Bot Developer
damt
Define Java service providers by annotating them directly

Annotated Service Provider Define JVM service providers by annotating the provider class directly. This annotation processor will add to the class-pat

Emily 5 Oct 31, 2021
CoSky is a lightweight, low-cost service registration, service discovery, and configuration service SDK.

High-performance, low-cost microservice governance platform. Service Discovery and Configuration Service

Ahoo Wang 61 Nov 22, 2022
Drone Service REST API in Spring boot

Drones Service REST API ?? START Introduction There is a major new technology that is destined to be a disruptive force in the field of transportation

Moses-K 1 Feb 4, 2022
AWS Service registry for resilient mid-tier load balancing and failover.

Eureka Eureka is a REST (Representational State Transfer) based service that is primarily used in the AWS cloud for locating services for the purpose

Netflix, Inc. 11.6k Dec 30, 2022
Opinionated libraries for HTTP&JSON-based RPC using Retrofit, Feign, OkHttp as clients and Jetty/Jersey as servers

Conjure Java Runtime (formerly http-remoting) This repository provides an opinionated set of libraries for defining and creating RESTish/RPC servers a

Palantir Technologies 76 Dec 13, 2022
Apache Dubbo is a high-performance, java based, open source RPC framework.

Apache Dubbo Project Apache Dubbo is a high-performance, Java-based open-source RPC framework. Please visit official site for quick start and document

The Apache Software Foundation 38.3k Jan 9, 2023
Microserver is a Java 8 native, zero configuration, standards based, battle hardened library to run Java Rest Microservices via a standard Java main class. Supporting pure Microservice or Micro-monolith styles.

Microserver is a Java 8 native, zero configuration, standards based, battle hardened library to run Java Rest Microservices via a standard Java main class. Supporting pure Microservice or Micro-monolith styles.

AOL 936 Dec 19, 2022
Takin is an Java-based, open-source system designed to measure online or test environmental performance test for full-links, Especially for microservices

Takin is an Java-based, open-source system designed to measure online environmental performance test for full-links, Especially for microservices. Through Takin, middlewares and applications can identify real online traffic and test traffic, ensure that they enter the right databases.

ShulieTech 1.2k Dec 21, 2022
Java client for Consul HTTP API

consul-api Java client for Consul HTTP API (http://consul.io) Supports all API endpoints (http://www.consul.io/docs/agent/http.html), all consistency

Ecwid 402 Jan 6, 2023