mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
add acf-example to project, switch to paper
This commit is contained in:
Generated
+2
-1
@@ -40,8 +40,9 @@
|
||||
<module name="acf-core" options="-parameters" />
|
||||
<module name="acf-jda" options="-parameters" />
|
||||
<module name="acf-paper" options="-parameters" />
|
||||
<module name="acf-parent" options="-parameters" />
|
||||
<module name="acf-parent" options="" />
|
||||
<module name="acf-sponge" options="-parameters" />
|
||||
<module name="example-plugin" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
+4
-2
@@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="ACF (Core + Bukkit + Example)" type="MavenRunConfiguration" factoryName="Maven" singleton="true">
|
||||
<configuration default="false" name="ACF (Core + Paper + Example)" type="MavenRunConfiguration" factoryName="Maven" singleton="true">
|
||||
<MavenSettings>
|
||||
<option name="myGeneralSettings" />
|
||||
<option name="myRunnerSettings" />
|
||||
@@ -14,6 +14,7 @@
|
||||
<option value="package" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="pomFileName" />
|
||||
<option name="profilesMap">
|
||||
<map />
|
||||
</option>
|
||||
@@ -22,9 +23,10 @@
|
||||
</MavenRunnerParameters>
|
||||
</option>
|
||||
</MavenSettings>
|
||||
<method>
|
||||
<method v="2">
|
||||
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/core/pom.xml" goal="clean install" />
|
||||
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/bukkit/pom.xml" goal="clean install" />
|
||||
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/paper/pom.xml" goal="clean install" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
+4
-4
@@ -93,8 +93,8 @@
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>destroystokyo-repo</id>
|
||||
<url>https://repo.destroystokyo.com/repository/maven-public/</url>
|
||||
<id>papermc</id>
|
||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype</id>
|
||||
@@ -106,12 +106,12 @@
|
||||
<dependency>
|
||||
<groupId>com.destroystokyo.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.11.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>co.aikar</groupId>
|
||||
<artifactId>acf-bukkit</artifactId>
|
||||
<artifactId>acf-paper</artifactId>
|
||||
<version><!--VERSION-->0.5.0-SNAPSHOT<!--VERSION--></version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
package co.aikar.acfexample;
|
||||
|
||||
import co.aikar.commands.BukkitCommandManager;
|
||||
import co.aikar.commands.PaperCommandManager;
|
||||
import co.aikar.commands.ConditionFailedException;
|
||||
import co.aikar.commands.MessageKeys;
|
||||
import co.aikar.commands.MessageType;
|
||||
@@ -34,7 +34,7 @@ import java.util.Arrays;
|
||||
public final class ACFExample extends JavaPlugin {
|
||||
|
||||
private static ACFExample plugin;
|
||||
private static BukkitCommandManager commandManager;
|
||||
private static PaperCommandManager commandManager;
|
||||
@Override
|
||||
public void onEnable() {
|
||||
plugin = this;
|
||||
@@ -43,7 +43,7 @@ public final class ACFExample extends JavaPlugin {
|
||||
|
||||
private void registerCommands() {
|
||||
// 1: Create Command Manager for your respective platform
|
||||
commandManager = new BukkitCommandManager(this);
|
||||
commandManager = new PaperCommandManager(this);
|
||||
|
||||
// optional: enable unstable api to use help
|
||||
commandManager.enableUnstableAPI("help");
|
||||
@@ -65,8 +65,8 @@ public final class ACFExample extends JavaPlugin {
|
||||
SomeObject.getContextResolver());
|
||||
|
||||
// 4: Register Command Completions - this will be accessible with @CommandCompletion("@test")
|
||||
commandManager.getCommandCompletions().registerAsyncCompletion("test", c ->
|
||||
Arrays.asList("foo", "bar", "baz")
|
||||
commandManager.getCommandCompletions().registerAsyncCompletion("test", c ->
|
||||
Arrays.asList("foo123", "bar123", "baz123")
|
||||
);
|
||||
|
||||
// 5: Register Command Conditions
|
||||
@@ -115,7 +115,7 @@ public final class ACFExample extends JavaPlugin {
|
||||
}
|
||||
|
||||
// A way to access your command manager from other files if you do not use a Dependency Injection approach
|
||||
public static BukkitCommandManager getCommandManager() {
|
||||
public static PaperCommandManager getCommandManager() {
|
||||
return commandManager;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public class SomeCommand extends BaseCommand {
|
||||
|
||||
// This sub command requires that `/acf testsub test1` be typed to be executed, or /Foo
|
||||
@Subcommand("testsub test1")
|
||||
@CommandCompletion("Foo")
|
||||
@CommandCompletion("@test")
|
||||
public void onTestSub1(CommandSender sender, String hi) {
|
||||
sender.sendMessage(hi);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user