Skip to content

Migrating from 0.4.0 to 0.5.0

Daniel Ennis edited this page Jun 3, 2017 · 13 revisions

Change pom/gradle file for new module name

0.5.0 introduced a module style project, where bukkit specific stuff is now in its own artifact.

You must change acf-core to acf-bukkit OR acf-paper (if you will require paper for your plugin) in your pom.xml or build.gradle file.

Example POM:

    <dependencies>
        <dependency>
            <groupId>com.destroystokyo.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.11.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>co.aikar</groupId>
            <artifactId>acf-paper</artifactId>
            <version>0.5.0-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

Add , BukkitCommandExecutionContext to based method based resolvers

If you have a method like

public ContextResolver<MyType> getResolver() {
   return c -> { };
} 

Then you need to adjust the return signature to

public ContextResolver<MyType, BukkitCommandExecutionContext> getResolver() {
   return c -> { };
} 

Usage of @Override preCommand

Add @PreCommand and remove @Override like so:

@PreCommand 
public boolean anything(CommandSender sender, String commandLabel, String[] args) {

}

Same as before, return true to abort.

Usage of @Override help

Same as above, but use @UnknownHandler

@UnknownHandler
public void help(CommandSender sender, String[] args) {
}