oblak/cloud-minecraft
2020-10-05 23:40:32 +01:00
..
cloud-brigadier Fix annotation order 2020-10-05 17:56:12 +02:00
cloud-bukkit Fix annotation order 2020-10-05 17:56:12 +02:00
cloud-bungee Improve Bukkit conflict management 2020-10-04 18:32:34 +02:00
cloud-cloudburst 🎨 @Annotation final -> final @Annotation 2020-10-03 21:40:07 +02:00
cloud-minecraft-extras Respect permissions in help queries 2020-10-05 22:44:37 +01:00
cloud-paper Get rid of some annoying warnings 2020-10-05 16:27:26 +02:00
cloud-velocity Switch to gradle 2020-09-30 10:40:44 +02:00
README.md Update README's 2020-10-05 23:40:32 +01:00

cloud-minecraft

This directory hosts Minecraft specific implementations of cloud. Their features are summarized in the table below:

Module Platform Minecraft Version Brigadier Support?
cloud-bukkit Bukkit, Spigot, Paper 1.8+ Via commodore for MC 1.13+
cloud-paper Bukkit, Spigot, Paper 1.8+ Via Paper for MC 1.15+, Via commodore for MC 1.13+
cloud-bungee BungeeCord 1.8+ No
cloud-velocity Velocity 1.1.0 1.7+ Yes
cloud-cloudburst CloudBurst 1.0.0 Bedrock 1.16.20+ No

There is also a cloud-minecraft-extras module that contains a few extra minecraft related features

cloud-bukkit

Bukkit mappings for cloud. If commodore is present on the classpath and the server is running at least version 1.13+, Brigadier mappings will be available.

dependency

maven:

<dependency>
    <groupId>cloud.commandframework</groupId>
    <artifactId>cloud-bukkit</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

gradle:

dependencies {
    implementation 'cloud.commandframework:cloud-bukkit:1.0.0-SNAPSHOT'
}

setup

Simply do:

final BukkitCommandManager<YourSender> bukkitCommandManager = new BukkitCommandManager<>(
  yourPlugin, yourExecutionCoordinator, forwardMapper, backwardsMapper);

The forwardMapper is a function that maps your chosen sender type to Bukkit's CommandSender, and the backwardsMapperdoes the opposite. In the case that you don't need a custom sender type, you can simply use CommandSenderas the generic type and pass Function.identity() as the forward and backward mappers.

commodore

To use commodore, include it as a dependency:

maven:

<dependency>
    <groupId>me.lucko</groupId>
    <artifactId>commodore</artifactId>
    <version>1.9</version>
</dependency>

gradle:

dependencies {
    implementation 'me.lucko:commodore:1.9'
}

Then initialize the commodore mappings using:

try {
  bukkitCommandManager.registerBrigadier();
} catch (final Exception e) {
  plugin.getLogger().warning("Failed to initialize Brigadier support: " + e.getMessage());
}

The mappings will then be created and registered automatically whenever a new command is registered.

Note: The mapper must be initialized before any commands are registered.

You can check whether or not the running server supports Brigadier, by using bukkitCommandManager.queryCapability(...).

cloud-paper

cloud-paperworks on all Bukkit derivatives and has graceful fallbacks for cases where Paper specific features are missing. It is initialized the same way as the Bukkit manager, except PaperCommandManageris used instead. When using Paper 1.15+ Brigadier mappings are available even without commodore present.

dependency

maven:

<dependency>
    <groupId>cloud.commandframework</groupId>
    <artifactId>cloud-paper</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

gradle:

dependencies {
    implementation 'cloud.commandframework:cloud-paper:1.0.0-SNAPSHOT'
}

asynchronous completions

cloud-papersupports asynchronous completions when running on Paper. First check if the capability is present, by using paperCommandManager.queryCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION) and then initialize the asynchronous completion listener by using paperCommandManager.registerAsynchronousCompletions().

cloud-bungee

BungeeCord mappings for cloud.

dependency

maven:

<dependency>
    <groupId>cloud.commandframework</groupId>
    <artifactId>cloud-bungee</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

gradle:

dependencies {
    implementation 'cloud.commandframework:cloud-bungee:1.0.0-SNAPSHOT'
}

setup

Simply do:

final BungeeCommandManager<YourSender> bungeeCommandManager = new BungeeCommandManager<>(
  yourPlugin, yourExecutionCoordinator, forwardMapper, backwardsMapper);

The forwardMapper is a function that maps your chosen sender type to Bungee's CommandSender, and the backwardsMapperdoes the opposite. In the case that you don't need a custom sender type, you can simply use CommandSenderas the generic type and pass Function.identity() as the forward and backward mappers.

cloud-velocity

cloud mappings for Velocity 1.1.0-SNAPSHOT.

dependency

maven:

<dependency>
    <groupId>cloud.commandframework</groupId>
    <artifactId>cloud-velocity</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

gradle:

dependencies {
    implementation 'cloud.commandframework:cloud-velocity:1.0.0-SNAPSHOT'
}

Simply do:

final VelocityCommandManager<YourSender> velocityCommandManager = new VelocityCommandManager<>(
  proxyServer, yourExecutionCoordinator, forwardMapper, backwardsMapper);

The forwardMapper is a function that maps your chosen sender type to Velocity's CommandSource, and the backwardsMapperdoes the opposite. In the case that you don't need a custom sender type, you can simply use CommandSourceas the generic type and pass Function.identity() as the forward and backward mappers.

cloud-cloudburst

cloud mappings for CloudBurst 1.0.0-SNAPSHOT.

dependency

maven:

<dependency>
    <groupId>cloud.commandframework</groupId>
    <artifactId>cloud-cloudburst</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

gradle:

dependencies {
    implementation 'cloud.commandframework:cloud-velocity:1.0.0-SNAPSHOT'
}

Simply do:

final CloudburstCommandManager<YourSender> cloudburstCommandManager = new CloudburstCommandManager<>(
  yourPlugin, yourExecutionCoordinator, forwardMapper, backwardsMapper);

The forwardMapper is a function that maps your chosen sender type to Cloudbursts's CommandSender, and the backwardsMapperdoes the opposite. In the case that you don't need a custom sender type, you can simply use CommandSourceas the generic type and pass Function.identity() as the forward and backward mappers.