-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ca084e
commit c04a512
Showing
3 changed files
with
168 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# cloud-bungee | ||
|
||
`cloud-bungee` allows you to write commands for [BungeeCord](https://github.com/SpigotMC/BungeeCord). | ||
|
||
## Links | ||
|
||
<div class="grid cards" markdown> | ||
|
||
- [:fontawesome-brands-github: Source Code](https://github.com/Incendo/cloud-minecraft/tree/master/cloud-bungee) | ||
- [:fontawesome-brands-github: Example Plugin](https://github.com/Incendo/cloud-minecraft/tree/master/examples/example-bungee) | ||
|
||
</div> | ||
|
||
## Installation | ||
|
||
Cloud for BungeeCord is available through [Maven Central](https://central.sonatype.com/artifact/cloud.commandframework/cloud-bungee). | ||
|
||
<!-- prettier-ignore --> | ||
=== "Maven" | ||
|
||
```xml | ||
<dependencies> | ||
<dependency> | ||
<groupId>cloud.commandframework</groupId> | ||
<artifactId>cloud-bungee</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
``` | ||
|
||
=== "Gradle (Kotlin)" | ||
|
||
```kotlin | ||
implementation("cloud.commandframework:cloud-bungee:2.0.0-SNAPSHOT") | ||
``` | ||
|
||
=== "Gradle (Groovy)" | ||
|
||
```groovy | ||
implementation 'cloud.commandframework:cloud-bungee:2.0.0-SNAPSHOT' | ||
``` | ||
|
||
## Usage | ||
|
||
`cloud-bungee` has a command manager implementation called `BungeeCommandManager` that can be created like: | ||
|
||
```{ .java .annotate } | ||
BungeeCommandManager<YourSenderType> commandManager = new BungeeCommandManager<>( | ||
plugin, | ||
executionCoordinator, /* (1) */ | ||
senderMapper /* (2) */ | ||
); | ||
``` | ||
|
||
1. Information about execution coordinators in general can be found | ||
[here](../core/index.md#execution-coordinators). | ||
2. The sender mapper is a two-way mapping between BungeeCord's | ||
[`CommandSender`](https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/net/md_5/bungee/api/CommandSender.html) and your custom sender type. | ||
You may use `SenderMapper.identity()` if using `CommandSender` as the sender type. | ||
|
||
## Parsers | ||
|
||
| Parser | Type | | ||
| ------------ | --------------------------------------------------------------------------------------------------------------------------- | | ||
| PlayerParser | [ProxiedPlayer](https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/net/md_5/bungee/api/connection/ProxiedPlayer.html) | | ||
| ServerParser | [ServerInfo](https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/net/md_5/bungee/api/config/ServerInfo.html) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# cloud-velocity | ||
|
||
`cloud-velocity` allows you to write commands for [Velocity](https://papermc.io/software/velocity). | ||
|
||
## Links | ||
|
||
<div class="grid cards" markdown> | ||
|
||
- [:fontawesome-brands-github: Source Code](https://github.com/Incendo/cloud-minecraft/tree/master/cloud-velocity) | ||
- [:fontawesome-brands-github: Example Plugin](https://github.com/Incendo/cloud-minecraft/tree/master/examples/example-velocity) | ||
|
||
</div> | ||
|
||
## Installation | ||
|
||
Cloud for Velocity is available through [Maven Central](https://central.sonatype.com/artifact/cloud.commandframework/cloud-paper). | ||
|
||
<!-- prettier-ignore --> | ||
=== "Maven" | ||
|
||
```xml | ||
<dependencies> | ||
<dependency> | ||
<groupId>cloud.commandframework</groupId> | ||
<artifactId>cloud-velocity</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
``` | ||
|
||
=== "Gradle (Kotlin)" | ||
|
||
```kotlin | ||
implementation("cloud.commandframework:cloud-velocity:2.0.0-SNAPSHOT") | ||
``` | ||
|
||
=== "Gradle (Groovy)" | ||
|
||
```groovy | ||
implementation 'cloud.commandframework:cloud-velocity:2.0.0-SNAPSHOT' | ||
``` | ||
|
||
## Usage | ||
|
||
`cloud-velocity` has a command manager implementation called `VelocityCommandManager` that can be created in two ways. | ||
|
||
By using a Guice injector: | ||
|
||
```java | ||
// @Inject private Injector injector; | ||
Injector childInjector = injector.createChildInjector( | ||
new CloudInjectionModule<>( | ||
YourSenderType.class, | ||
executionCoordinator, /* 1 */ | ||
senderMapper /* 2 */ | ||
) | ||
); | ||
|
||
VelocityCommandManager<YourSenderType> commandManager = childInjector.getInstance( | ||
Key.get(new TypeLiteral<VelocityCommandManager<YourSenderType>>() {}) | ||
); | ||
``` | ||
|
||
Or, manually creating an instance: | ||
|
||
```java | ||
VelocityCommandManager<YourSenderType> commandManager = new VelocityCommandManager<>( | ||
pluginContainer, | ||
proxyServer, | ||
executionCoordinator, /* 1 */ | ||
senderMapper /* 2 */ | ||
); | ||
``` | ||
|
||
1. Information about execution coordinators in general can be found | ||
[here](../core/index.md#execution-coordinators). | ||
2. The sender mapper is a two-way mapping between Velocity's | ||
[`CommandSource`](https://jd.papermc.io/velocity/3.0.0/com/velocitypowered/api/command/CommandSource.html) and your custom sender type. | ||
You may use `SenderMapper.identity()` if using `CommandSource` as the sender type. | ||
|
||
## Brigadier | ||
|
||
Velocity commands are powered by [Brigadier](https://github.com/mojang/brigadier), which means that you may | ||
use the features from [cloud-brigadier](brigadier.md). | ||
|
||
## Parsers | ||
|
||
| Parser | Type | | ||
| ------------ | ------------------------------------------------------------------------------------------------------------------- | | ||
| PlayerParser | [Player](https://jd.papermc.io/velocity/3.0.0/com/velocitypowered/api/proxy/Player.html) | | ||
| ServerParser | [RegisteredServer](https://jd.papermc.io/velocity/3.0.0/com/velocitypowered/api/proxy/server/RegisteredServer.html) | |