Skip to content
TylerS1066 edited this page Jul 4, 2024 · 14 revisions

Getting started (Paper & Gradle)

Once you have set up your plugin's Gradle build system per Paper's instructions you only need to add a few lines to your build.gradle.kts:

plugins {
    [...]
    id("io.github.0ffz.github-packages") version "1.2.1" // This plugin will allow us to authenticate to GitHub Packages automatically.
}

repositories {
    [...]
    maven { githubPackage("apdevteam/movecraft")(this) } // This line will use the above plugin to automatically authenticate and add our GitHub Packages Repository.
}

dependencies {
    [...]
    compileOnly("net.countercraft:movecraft:+") // Automatically depend on the latest Movecraft
}

Events

Event Description Cancellable
CraftCollisionEvent Called when a craft collides with a solid block No
CraftDetectEvent Called when a craft is detected Yes
CraftPilotEvent Called when a player pilots a craft No
CraftPreTranslateEvent Called prior to a craft's translation algorithm is performed Yes
CraftReleaseEvent Called when a craft is released No
CraftRotateEvent Called when a craft is rotated Yes
CraftSinkEvent Called when a craft sinks Yes
CraftTranslateEvent Called when a craft translates and after algorithm is performed Yes
ItemHarvestEvent Called when a craft harvest blocks defined under 'harvestBlocks' No
SignTranslateEvent Called when a sign on a moving craft is translated No

Advanced builds and continuous integration

Movecraft-CoreProtect is our example plugin of an exemplary build configuration with a number of advanced features:

  1. Gradle automatically embeds the project version in plugin.yml
  2. Gradle includes the license in the jar file
  3. Gradle can publish to GitHub Packages
  4. Gradle can publish to PaperMC's Hangar
  5. GitHub Actions is set up to build a jar on every push, pull request, and workflow dispatch.
  6. GitHub Actions is configured to publish to GitHub Packages on every release.
  7. GitHub Actions is configured to publish to PaperMC's Hangar on every release.
  8. GitHub Actions is configured to add the built jar (with version in the filename) to the release.

Reference our build.gradle.kts and gradle.yml on how to replicate this behavior on your own plugins. For Hangar publishing you will need to follow PaperMC's documentation on to set up a token as a repository secret.

Outdated getting started (Maven instructions)

Movecraft is hosted in GitHub Packages as a maven repository. Unfortunately, GitHub Packages does not yet allow anonymous access, and therefore you will need to setup your maven settings as per these instructions. You will then want to add the following to your pom.xml's dependency and repository sections:

        <dependency>
          <groupId>net.countercraft</groupId>
          <artifactId>movecraft</artifactId>
          <version>LATEST</version>
          <scope>provided</scope>
        </dependency>
        <repository>
            <id>github</id>
            <name>GitHub APDevTeam/Movecraft Apache Maven Packages</name>
            <url>https://maven.pkg.github.com/APDevTeam/Movecraft</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>