diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 875a9d68f..000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/java/.devcontainer/base.Dockerfile - -# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster -ARG VARIANT="17-bullseye" -FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT} - -# [Option] Install Maven -ARG INSTALL_MAVEN="false" -ARG MAVEN_VERSION="" -# [Option] Install Gradle -ARG INSTALL_GRADLE="false" -ARG GRADLE_VERSION="" -RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \ - && if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi - -# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 -ARG NODE_VERSION="none" -RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends - -# [Optional] Uncomment this line to install global node packages. -# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 8c96cc35c..000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,50 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/java -{ - "name": "Java", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update the VARIANT arg to pick a Java version: 11, 17 - // Append -bullseye or -buster to pin to an OS version. - // Use the -bullseye variants on local arm64/Apple Silicon. - "VARIANT": "17", - // Options - "INSTALL_MAVEN": "true", - "INSTALL_GRADLE": "false", - "NODE_VERSION": "lts/*" - } - }, - - // Configure tool-specific properties. - "customizations": { - // Configure properties specific to VS Code. - "vscode": { - // Set *default* container specific settings.json values on container create. - "settings": { - "java.home": "/docker-java-home" - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "vscjava.vscode-java-pack", - "eamodio.gitlens", - "SonarSource.sonarlint-vscode", - "redhat.vscode-xml", - "redhat.fabric8-analytics" - ] - } - }, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "java -version", - - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - "features": { - "github-cli": "latest" - } -} diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 000000000..2ecdc6eb6 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,41 @@ +name: Java CI + +on: + workflow_dispatch: + push: + pull_request: + schedule: + - cron: '22 13 * * 6' + +jobs: + # Build Movecraft + build: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout Movecraft + uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + build-scan-publish: true + build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" + build-scan-terms-of-use-agree: "yes" + + - name: Build with Gradle + run: ./gradlew clean shadowJar + + - name: Stage jar + run: mkdir staging && cp Movecraft/build/libs/Movecraft.jar staging && mv staging/Movecraft.jar staging/Movecraft_$GITHUB_SHA.jar + - name: Upload jar + uses: actions/upload-artifact@v4 + with: + name: Movecraft_Dev-Build + path: staging/Movecraft_*.jar diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index ddf6498c9..000000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,193 +0,0 @@ -name: Java CI - -on: - workflow_dispatch: - push: - pull_request: - schedule: - - cron: '22 13 * * 6' - -jobs: - # Build 1.18.2 NMS - v1_18: - runs-on: ubuntu-latest - steps: - - name: Set up JDK 17 # 1.18.2 can only be built with Java 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - - name: Cache 1.18.2 Maven package - id: cacheCaves - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository/org/spigotmc/spigot/1.18.2-R0.1-SNAPSHOT/ - ~/.m2/repository/org/spigotmc/spigot-parent/ - ~/.m2/repository/org/spigotmc/minecraft-server/ - key: ${{ runner.os }}-v1_18 - restore-keys: ${{ runner.os }}-v1_18 - - name: Cache Maven packages - id: cacheMain - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-v1_18 - restore-keys: ${{ runner.os }}-m2-v1_18 - - - name: Setup BuildTools - run: mkdir BuildTools && wget -O BuildTools/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar - - name: Check 1.18.2 Spigot - id: caves - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.18.2-R0.1-SNAPSHOT/spigot-1.18.2-R0.1-SNAPSHOT.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Check 1.18.2 Spigot (Mojang) - id: cavesMojang - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.18.2-R0.1-SNAPSHOT/spigot-1.18.2-R0.1-SNAPSHOT-remapped-mojang.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Check 1.18.2 Spigot (Obf) - id: cavesObf - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.18.2-R0.1-SNAPSHOT/spigot-1.18.2-R0.1-SNAPSHOT-remapped-obf.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Build 1.18.2 - if: steps.caves.outputs.sucess != 'true' || steps.cavesMojang.outputs.sucess != 'true' || steps.cavesObf.outputs.sucess != 'true' - run: cd BuildTools && java -jar BuildTools.jar --rev 1.18.2 --remapped - - # Build 1.19.4 NMS - v1_19: - runs-on: ubuntu-latest - steps: - - name: Set up JDK 17 # 1.19.4 can only be built with Java 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - - name: Cache 1.19.4 Maven package - id: cacheWild_r2 - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/ - ~/.m2/repository/org/spigotmc/spigot-parent/ - ~/.m2/repository/org/spigotmc/minecraft-server/ - key: ${{ runner.os }}-v1_19 - restore-keys: ${{ runner.os }}-v1_19 - - name: Cache Maven packages - id: cacheMain - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-v1_19 - restore-keys: ${{ runner.os }}-m2-v1_19 - - - name: Setup BuildTools - run: mkdir BuildTools && wget -O BuildTools/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar - - name: Check 1.19.4 Spigot - id: wild - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/spigot-1.19.4-R0.1-SNAPSHOT.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Check 1.19.4 Spigot (Mojang) - id: wildMojang - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/spigot-1.19.4-R0.1-SNAPSHOT-remapped-mojang.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Check 1.19.4 Spigot (Obf) - id: wildObf - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/spigot-1.19.4-R0.1-SNAPSHOT-remapped-obf.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Build 1.19.4 - if: steps.wild.outputs.sucess != 'true' || steps.wildMojang.outputs.sucess != 'true' || steps.wildObf.outputs.sucess != 'true' - run: cd BuildTools && java -jar BuildTools.jar --rev 1.19.4 --remapped - - # Build 1.20.6 NMS - v1_20: - runs-on: ubuntu-latest - steps: - - name: Set up JDK 21 # 1.20.6 can only be built with Java 21 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '21' - - name: Cache 1.20.6 Maven package - id: cacheWild_r2 - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/ - ~/.m2/repository/org/spigotmc/spigot-parent/ - ~/.m2/repository/org/spigotmc/minecraft-server/ - key: ${{ runner.os }}-v1_20 - restore-keys: ${{ runner.os }}-v1_20 - - name: Cache Maven packages - id: cacheMain - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-v1_20 - restore-keys: ${{ runner.os }}-m2-v1_20 - - - name: Setup BuildTools - run: mkdir BuildTools && wget -O BuildTools/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar - - name: Check 1.20.6 Spigot - id: wild - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Check 1.20.6 Spigot (Mojang) - id: wildMojang - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT-remapped-mojang.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Check 1.20.6 Spigot (Obf) - id: wildObf - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT-remapped-obf.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Build 1.20.6 - if: steps.wild.outputs.sucess != 'true' || steps.wildMojang.outputs.sucess != 'true' || steps.wildObf.outputs.sucess != 'true' - run: cd BuildTools && java -jar BuildTools.jar --rev 1.20.6 --remapped - - # Build Movecraft - build: - runs-on: ubuntu-latest - needs: [v1_18, v1_19, v1_20] - - steps: - - name: Checkout Movecraft - uses: actions/checkout@v1 - - name: Set up JDK 21 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '21' - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2 - restore-keys: ${{ runner.os }}-m2 - - name: Cache 1.18.2 Maven package - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository/org/spigotmc/spigot/1.18.2-R0.1-SNAPSHOT/ - ~/.m2/repository/org/spigotmc/spigot-parent/ - ~/.m2/repository/org/spigotmc/minecraft-server/ - key: ${{ runner.os }}-v1_18 - restore-keys: ${{ runner.os }}-v1_18 - - name: Cache 1.19.4 Maven package - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/ - ~/.m2/repository/org/spigotmc/spigot-parent/ - ~/.m2/repository/org/spigotmc/minecraft-server/ - key: ${{ runner.os }}-v1_19 - restore-keys: ${{ runner.os }}-v1_19 - - name: Cache 1.20.6 Maven package - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/ - ~/.m2/repository/org/spigotmc/spigot-parent/ - ~/.m2/repository/org/spigotmc/minecraft-server/ - key: ${{ runner.os }}-v1_20 - restore-keys: ${{ runner.os }}-v1_20 - - - name: Build with Maven - run: mvn -T 1C -B package --file pom.xml - - - name: Stage jar - run: mkdir staging && cp target/Movecraft.jar staging && mv staging/Movecraft.jar staging/Movecraft_$GITHUB_SHA.jar - - name: Upload jar - uses: actions/upload-artifact@v3 - with: - name: Movecraft_Dev-Build - path: staging/Movecraft_*.jar diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 85bd962f0..ec9a36f50 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,48 +48,6 @@ jobs: if: steps.caves.outputs.sucess != 'true' || steps.cavesMojang.outputs.sucess != 'true' || steps.cavesObf.outputs.sucess != 'true' run: cd BuildTools && java -jar BuildTools.jar --rev 1.18.2 --remapped - # Build 1.19.4 NMS - v1_19: - runs-on: ubuntu-latest - steps: - - name: Set up JDK 17 # 1.19.4 can only be built with Java 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - - name: Cache 1.19.4 Maven package - id: cacheWild_r2 - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/ - ~/.m2/repository/org/spigotmc/spigot-parent/ - ~/.m2/repository/org/spigotmc/minecraft-server/ - key: ${{ runner.os }}-v1_19 - restore-keys: ${{ runner.os }}-v1_19 - - name: Cache Maven packages - id: cacheMain - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-v1_19 - restore-keys: ${{ runner.os }}-m2-v1_19 - - - name: Setup BuildTools - run: mkdir BuildTools && wget -O BuildTools/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar - - name: Check 1.19.4 Spigot - id: wild - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/spigot-1.19.4-R0.1-SNAPSHOT.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Check 1.19.4 Spigot (Mojang) - id: wildMojang - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/spigot-1.19.4-R0.1-SNAPSHOT-remapped-mojang.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Check 1.19.4 Spigot (Obf) - id: wildObf - run: test -f ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/spigot-1.19.4-R0.1-SNAPSHOT-remapped-obf.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT - - name: Build 1.19.4 - if: steps.wild.outputs.sucess != 'true' || steps.wildMojang.outputs.sucess != 'true' || steps.wildObf.outputs.sucess != 'true' - run: cd BuildTools && java -jar BuildTools.jar --rev 1.19.4 --remapped - # Build 1.20.6 NMS v1_20: runs-on: ubuntu-latest @@ -135,7 +93,7 @@ jobs: # Build Movecraft build: runs-on: ubuntu-latest - needs: [v1_18, v1_19, v1_20] + needs: [v1_18, v1_20] steps: - name: Checkout Movecraft @@ -160,15 +118,6 @@ jobs: ~/.m2/repository/org/spigotmc/minecraft-server/ key: ${{ runner.os }}-v1_18 restore-keys: ${{ runner.os }}-v1_18 - - name: Cache 1.19.4 Maven package - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/ - ~/.m2/repository/org/spigotmc/spigot-parent/ - ~/.m2/repository/org/spigotmc/minecraft-server/ - key: ${{ runner.os }}-v1_19 - restore-keys: ${{ runner.os }}-v1_19 - name: Cache 1.20.6 Maven package uses: actions/cache@v3 with: diff --git a/.gitignore b/.gitignore index 20c410455..07c6b4640 100644 --- a/.gitignore +++ b/.gitignore @@ -169,6 +169,29 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +### GitHub example for gradle +.gradle +**/build/ +!src/**/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Avoid ignore Gradle wrappper properties +!gradle-wrapper.properties + +# Cache of project +.gradletasknamecache + +# Eclipse Gradle plugin generated files +# Eclipse Core +.project +# JDT-specific (Eclipse Java Development Tools) +.classpath + # dependency reduced POMs *dependency-reduced-pom.xml diff --git a/Movecraft/build.gradle.kts b/Movecraft/build.gradle.kts new file mode 100644 index 000000000..a6232319d --- /dev/null +++ b/Movecraft/build.gradle.kts @@ -0,0 +1,36 @@ +plugins { + id("buildlogic.java-conventions") + id("io.github.goooler.shadow") version "8.1.7" +} + +java.toolchain.languageVersion = JavaLanguageVersion.of(17) + +dependencies { + runtimeOnly(project(":movecraft-v1_18", "reobf")) + runtimeOnly(project(":movecraft-v1_20", "reobf")) + implementation(project(":movecraft-api")) + compileOnly("org.yaml:snakeyaml:2.0") +} + +tasks.shadowJar { + archiveBaseName.set("Movecraft") + archiveClassifier.set("") + archiveVersion.set("") + + dependencies { + include(project(":movecraft-api")) + include(project(":movecraft-v1_18")) + include(project(":movecraft-v1_20")) + } +} + +tasks.processResources { + from(rootProject.file("LICENSE.md")) + from(project(":movecraft-datapack").file("build/zip/movecraft-data.zip")) + dependsOn(project(":movecraft-datapack").tasks.build) + filesMatching("*.yml") { + expand(mapOf("projectVersion" to project.version)) + } +} + +description = "Movecraft" diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/Movecraft.java b/Movecraft/src/main/java/net/countercraft/movecraft/Movecraft.java similarity index 87% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/Movecraft.java rename to Movecraft/src/main/java/net/countercraft/movecraft/Movecraft.java index 96c7957ab..03a2bb74e 100644 --- a/modules/Movecraft/src/main/java/net/countercraft/movecraft/Movecraft.java +++ b/Movecraft/src/main/java/net/countercraft/movecraft/Movecraft.java @@ -18,17 +18,7 @@ package net.countercraft.movecraft; import net.countercraft.movecraft.async.AsyncManager; -import net.countercraft.movecraft.commands.ContactsCommand; -import net.countercraft.movecraft.commands.CraftInfoCommand; -import net.countercraft.movecraft.commands.CraftReportCommand; -import net.countercraft.movecraft.commands.CraftTypeCommand; -import net.countercraft.movecraft.commands.CruiseCommand; -import net.countercraft.movecraft.commands.ManOverboardCommand; -import net.countercraft.movecraft.commands.MovecraftCommand; -import net.countercraft.movecraft.commands.PilotCommand; -import net.countercraft.movecraft.commands.ReleaseCommand; -import net.countercraft.movecraft.commands.RotateCommand; -import net.countercraft.movecraft.commands.ScuttleCommand; +import net.countercraft.movecraft.commands.*; import net.countercraft.movecraft.config.Settings; import net.countercraft.movecraft.craft.ChunkManager; import net.countercraft.movecraft.craft.CraftManager; @@ -38,35 +28,16 @@ import net.countercraft.movecraft.localisation.I18nSupport; import net.countercraft.movecraft.mapUpdater.MapUpdateManager; import net.countercraft.movecraft.processing.WorldManager; -import net.countercraft.movecraft.sign.AscendSign; -import net.countercraft.movecraft.sign.ContactsSign; -import net.countercraft.movecraft.sign.CraftSign; -import net.countercraft.movecraft.sign.CruiseSign; -import net.countercraft.movecraft.sign.DescendSign; -import net.countercraft.movecraft.sign.HelmSign; -import net.countercraft.movecraft.sign.MoveSign; -import net.countercraft.movecraft.sign.NameSign; -import net.countercraft.movecraft.sign.PilotSign; -import net.countercraft.movecraft.sign.RelativeMoveSign; -import net.countercraft.movecraft.sign.ReleaseSign; -import net.countercraft.movecraft.sign.RemoteSign; -import net.countercraft.movecraft.sign.ScuttleSign; -import net.countercraft.movecraft.sign.SpeedSign; -import net.countercraft.movecraft.sign.StatusSign; -import net.countercraft.movecraft.sign.SubcraftRotateSign; -import net.countercraft.movecraft.sign.TeleportSign; +import net.countercraft.movecraft.sign.*; import net.countercraft.movecraft.util.BukkitTeleport; import net.countercraft.movecraft.util.Tags; -import net.kyori.adventure.platform.bukkit.BukkitAudiences; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.plugin.java.JavaPlugin; -import org.jetbrains.annotations.NotNull; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import java.util.EnumSet; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -74,7 +45,6 @@ public class Movecraft extends JavaPlugin { private static Movecraft instance; - private static BukkitAudiences adventure = null; private Logger logger; private boolean shuttingDown; @@ -86,21 +56,9 @@ public static synchronized Movecraft getInstance() { return instance; } - @NotNull - public static BukkitAudiences getAdventure() { - if (adventure == null) - throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!"); - - return adventure; - } - @Override public void onDisable() { shuttingDown = true; - if (adventure != null) { - adventure.close(); - adventure = null; - } } @Override @@ -211,8 +169,6 @@ public void onEnable() { Settings.ForbiddenRemoteSigns.add(s.toLowerCase()); } - adventure = BukkitAudiences.create(this); - if(shuttingDown && Settings.IGNORE_RESET) { logger.severe("Movecraft is incompatible with the reload command. Movecraft has shut down and will restart when the server is restarted."); logger.severe("If you wish to use the reload command and Movecraft, you may disable this check inside the config.yml by setting 'safeReload: false'"); diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/async/AsyncManager.java b/Movecraft/src/main/java/net/countercraft/movecraft/async/AsyncManager.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/async/AsyncManager.java rename to Movecraft/src/main/java/net/countercraft/movecraft/async/AsyncManager.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/async/AsyncTask.java b/Movecraft/src/main/java/net/countercraft/movecraft/async/AsyncTask.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/async/AsyncTask.java rename to Movecraft/src/main/java/net/countercraft/movecraft/async/AsyncTask.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/async/rotation/RotationTask.java b/Movecraft/src/main/java/net/countercraft/movecraft/async/rotation/RotationTask.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/async/rotation/RotationTask.java rename to Movecraft/src/main/java/net/countercraft/movecraft/async/rotation/RotationTask.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/async/translation/TranslationTask.java b/Movecraft/src/main/java/net/countercraft/movecraft/async/translation/TranslationTask.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/async/translation/TranslationTask.java rename to Movecraft/src/main/java/net/countercraft/movecraft/async/translation/TranslationTask.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/ContactsCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/ContactsCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/ContactsCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/ContactsCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftInfoCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftInfoCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftInfoCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftInfoCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftReportCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftReportCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftReportCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftReportCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftTypeCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftTypeCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftTypeCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/CraftTypeCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/CruiseCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/CruiseCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/CruiseCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/CruiseCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/ManOverboardCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/ManOverboardCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/ManOverboardCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/ManOverboardCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/MovecraftCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/MovecraftCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/MovecraftCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/MovecraftCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/PilotCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/PilotCommand.java similarity index 87% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/PilotCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/PilotCommand.java index 4cd299043..2f0d67747 100644 --- a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/PilotCommand.java +++ b/Movecraft/src/main/java/net/countercraft/movecraft/commands/PilotCommand.java @@ -1,35 +1,24 @@ package net.countercraft.movecraft.commands; -import net.countercraft.movecraft.Movecraft; import net.countercraft.movecraft.MovecraftLocation; import net.countercraft.movecraft.craft.Craft; import net.countercraft.movecraft.craft.CraftManager; -import net.countercraft.movecraft.craft.CruiseOnPilotCraft; -import net.countercraft.movecraft.craft.CruiseOnPilotSubCraft; -import net.countercraft.movecraft.craft.type.CraftType; import net.countercraft.movecraft.craft.PlayerCraftImpl; -import net.countercraft.movecraft.events.CraftPilotEvent; +import net.countercraft.movecraft.craft.type.CraftType; import net.countercraft.movecraft.events.CraftReleaseEvent; import net.countercraft.movecraft.localisation.I18nSupport; -import net.countercraft.movecraft.processing.effects.Effect; -import net.countercraft.movecraft.processing.functions.CraftSupplier; import net.countercraft.movecraft.processing.functions.Result; import net.countercraft.movecraft.util.MathUtils; import net.countercraft.movecraft.util.Pair; -import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.TabExecutor; import org.bukkit.entity.Player; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Set; -import java.util.function.Function; import static net.countercraft.movecraft.util.ChatUtils.MOVECRAFT_COMMAND_PREFIX; @@ -75,8 +64,7 @@ public boolean onCommand(CommandSender commandSender, Command command, String s, return new Pair<>(Result.succeed(), new PlayerCraftImpl(type, w, p)); }, - world, player, - Movecraft.getAdventure().player(player), + world, player, player, craft -> () -> { // Release old craft if it exists Craft oldCraft = CraftManager.getInstance().getCraftByPlayer(player); diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/ReleaseCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/ReleaseCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/ReleaseCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/ReleaseCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/RotateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/RotateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/RotateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/RotateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/ScuttleCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/commands/ScuttleCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/commands/ScuttleCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/commands/ScuttleCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/BaseCraft.java b/Movecraft/src/main/java/net/countercraft/movecraft/craft/BaseCraft.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/BaseCraft.java rename to Movecraft/src/main/java/net/countercraft/movecraft/craft/BaseCraft.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/ChunkManager.java b/Movecraft/src/main/java/net/countercraft/movecraft/craft/ChunkManager.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/ChunkManager.java rename to Movecraft/src/main/java/net/countercraft/movecraft/craft/ChunkManager.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/CraftManager.java b/Movecraft/src/main/java/net/countercraft/movecraft/craft/CraftManager.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/CraftManager.java rename to Movecraft/src/main/java/net/countercraft/movecraft/craft/CraftManager.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/CruiseOnPilotCraft.java b/Movecraft/src/main/java/net/countercraft/movecraft/craft/CruiseOnPilotCraft.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/CruiseOnPilotCraft.java rename to Movecraft/src/main/java/net/countercraft/movecraft/craft/CruiseOnPilotCraft.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/CruiseOnPilotSubCraft.java b/Movecraft/src/main/java/net/countercraft/movecraft/craft/CruiseOnPilotSubCraft.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/CruiseOnPilotSubCraft.java rename to Movecraft/src/main/java/net/countercraft/movecraft/craft/CruiseOnPilotSubCraft.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/PlayerCraftImpl.java b/Movecraft/src/main/java/net/countercraft/movecraft/craft/PlayerCraftImpl.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/PlayerCraftImpl.java rename to Movecraft/src/main/java/net/countercraft/movecraft/craft/PlayerCraftImpl.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/SinkingCraftImpl.java b/Movecraft/src/main/java/net/countercraft/movecraft/craft/SinkingCraftImpl.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/SinkingCraftImpl.java rename to Movecraft/src/main/java/net/countercraft/movecraft/craft/SinkingCraftImpl.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/SubCraftImpl.java b/Movecraft/src/main/java/net/countercraft/movecraft/craft/SubCraftImpl.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/SubCraftImpl.java rename to Movecraft/src/main/java/net/countercraft/movecraft/craft/SubCraftImpl.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/SubcraftRotateCraft.java b/Movecraft/src/main/java/net/countercraft/movecraft/craft/SubcraftRotateCraft.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/craft/SubcraftRotateCraft.java rename to Movecraft/src/main/java/net/countercraft/movecraft/craft/SubcraftRotateCraft.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/listener/BlockListener.java b/Movecraft/src/main/java/net/countercraft/movecraft/listener/BlockListener.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/listener/BlockListener.java rename to Movecraft/src/main/java/net/countercraft/movecraft/listener/BlockListener.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/listener/InteractListener.java b/Movecraft/src/main/java/net/countercraft/movecraft/listener/InteractListener.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/listener/InteractListener.java rename to Movecraft/src/main/java/net/countercraft/movecraft/listener/InteractListener.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/listener/PlayerListener.java b/Movecraft/src/main/java/net/countercraft/movecraft/listener/PlayerListener.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/listener/PlayerListener.java rename to Movecraft/src/main/java/net/countercraft/movecraft/listener/PlayerListener.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/localisation/I18nSupport.java b/Movecraft/src/main/java/net/countercraft/movecraft/localisation/I18nSupport.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/localisation/I18nSupport.java rename to Movecraft/src/main/java/net/countercraft/movecraft/localisation/I18nSupport.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/MapUpdateManager.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/MapUpdateManager.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/MapUpdateManager.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/MapUpdateManager.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/AccessLocationUpdateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/AccessLocationUpdateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/AccessLocationUpdateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/AccessLocationUpdateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/BlockCreateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/BlockCreateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/BlockCreateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/BlockCreateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/CraftRotateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/CraftRotateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/CraftRotateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/CraftRotateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/CraftTranslateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/CraftTranslateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/CraftTranslateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/CraftTranslateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/EntityUpdateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/EntityUpdateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/EntityUpdateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/EntityUpdateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ExplosionUpdateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ExplosionUpdateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ExplosionUpdateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ExplosionUpdateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ItemDropUpdateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ItemDropUpdateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ItemDropUpdateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ItemDropUpdateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ParticleUpdateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ParticleUpdateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ParticleUpdateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/ParticleUpdateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/UpdateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/UpdateCommand.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/UpdateCommand.java rename to Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/UpdateCommand.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/effects/SetBlockEffect.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/effects/SetBlockEffect.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/effects/SetBlockEffect.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/effects/SetBlockEffect.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/CraftSupplier.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/CraftSupplier.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/CraftSupplier.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/CraftSupplier.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/DetectionPredicate.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/DetectionPredicate.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/DetectionPredicate.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/DetectionPredicate.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/DyadicPredicate.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/DyadicPredicate.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/DyadicPredicate.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/DyadicPredicate.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/MonadicPredicate.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/MonadicPredicate.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/MonadicPredicate.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/MonadicPredicate.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/Result.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/Result.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/Result.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/Result.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/TetradicPredicate.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/TetradicPredicate.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/TetradicPredicate.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/TetradicPredicate.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/TriadicPredicate.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/TriadicPredicate.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/TriadicPredicate.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/functions/TriadicPredicate.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/DetectionTask.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/DetectionTask.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/DetectionTask.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/DetectionTask.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/AllowedBlockValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/AllowedBlockValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/AllowedBlockValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/AllowedBlockValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/DetectionBlockValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/DetectionBlockValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/DetectionBlockValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/DetectionBlockValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/FlyBlockValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/FlyBlockValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/FlyBlockValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/FlyBlockValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/ForbiddenBlockValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/ForbiddenBlockValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/ForbiddenBlockValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/ForbiddenBlockValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/ForbiddenSignStringValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/ForbiddenSignStringValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/ForbiddenSignStringValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/ForbiddenSignStringValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/NameSignValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/NameSignValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/NameSignValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/NameSignValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/PilotSignValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/PilotSignValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/PilotSignValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/PilotSignValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/SizeValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/SizeValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/SizeValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/SizeValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/WaterContactValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/WaterContactValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/WaterContactValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/detection/validators/WaterContactValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/TranslationTask.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/TranslationTask.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/TranslationTask.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/TranslationTask.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/effects/TeleportationEffect.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/effects/TeleportationEffect.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/effects/TeleportationEffect.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/effects/TeleportationEffect.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/HoverValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/HoverValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/HoverValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/HoverValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/MaxHeightValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/MaxHeightValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/MaxHeightValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/MaxHeightValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/MinHeightValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/MinHeightValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/MinHeightValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/MinHeightValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/WorldBorderValidator.java b/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/WorldBorderValidator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/WorldBorderValidator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/processing/tasks/translation/validators/WorldBorderValidator.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/AscendSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/AscendSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/AscendSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/AscendSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/ContactsSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/ContactsSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/ContactsSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/ContactsSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/CraftSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/CraftSign.java similarity index 98% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/CraftSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/CraftSign.java index b6021ac0e..ec5a977c5 100644 --- a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/CraftSign.java +++ b/Movecraft/src/main/java/net/countercraft/movecraft/sign/CraftSign.java @@ -110,9 +110,7 @@ public void onSignClick(@NotNull PlayerInteractEvent event) { new PlayerCraftImpl(type, w, p)); } }, - world, - player, - Movecraft.getAdventure().player(player), + world, player, player, craft -> () -> { Bukkit.getServer().getPluginManager().callEvent(new CraftPilotEvent(craft, CraftPilotEvent.Reason.PLAYER)); if (craft instanceof SubCraft) { // Subtract craft from the parent diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/CruiseSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/CruiseSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/CruiseSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/CruiseSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/DescendSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/DescendSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/DescendSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/DescendSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/HelmSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/HelmSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/HelmSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/HelmSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/MoveSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/MoveSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/MoveSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/MoveSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/NameSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/NameSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/NameSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/NameSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/PilotSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/PilotSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/PilotSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/PilotSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/RelativeMoveSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/RelativeMoveSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/RelativeMoveSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/RelativeMoveSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/ReleaseSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/ReleaseSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/ReleaseSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/ReleaseSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/RemoteSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/RemoteSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/RemoteSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/RemoteSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/ScuttleSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/ScuttleSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/ScuttleSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/ScuttleSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/SpeedSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/SpeedSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/SpeedSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/SpeedSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/StatusSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/StatusSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/StatusSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/StatusSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/SubcraftRotateSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/SubcraftRotateSign.java similarity index 93% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/SubcraftRotateSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/SubcraftRotateSign.java index 54fd9df18..c8469fa38 100644 --- a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/SubcraftRotateSign.java +++ b/Movecraft/src/main/java/net/countercraft/movecraft/sign/SubcraftRotateSign.java @@ -3,18 +3,13 @@ import net.countercraft.movecraft.Movecraft; import net.countercraft.movecraft.MovecraftLocation; import net.countercraft.movecraft.MovecraftRotation; -import net.countercraft.movecraft.craft.Craft; -import net.countercraft.movecraft.craft.CraftManager; -import net.countercraft.movecraft.craft.SubCraft; -import net.countercraft.movecraft.craft.SubCraftImpl; -import net.countercraft.movecraft.craft.SubcraftRotateCraft; +import net.countercraft.movecraft.craft.*; import net.countercraft.movecraft.craft.type.CraftType; import net.countercraft.movecraft.events.CraftPilotEvent; import net.countercraft.movecraft.events.CraftReleaseEvent; import net.countercraft.movecraft.localisation.I18nSupport; import net.countercraft.movecraft.processing.functions.Result; import net.countercraft.movecraft.util.Pair; -import net.countercraft.movecraft.util.hitboxes.MutableHitBox; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; @@ -111,8 +106,7 @@ public void run() { Craft parent = parents.iterator().next(); return new Pair<>(Result.succeed(), new SubCraftImpl(type, w, parent)); }, - world, player, - Movecraft.getAdventure().player(player), + world, player, player, craft -> () -> { Bukkit.getServer().getPluginManager().callEvent(new CraftPilotEvent(craft, CraftPilotEvent.Reason.SUB_CRAFT)); if (craft instanceof SubCraft) { // Subtract craft from the parent diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/TeleportSign.java b/Movecraft/src/main/java/net/countercraft/movecraft/sign/TeleportSign.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/sign/TeleportSign.java rename to Movecraft/src/main/java/net/countercraft/movecraft/sign/TeleportSign.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/util/BlockUtils.java b/Movecraft/src/main/java/net/countercraft/movecraft/util/BlockUtils.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/util/BlockUtils.java rename to Movecraft/src/main/java/net/countercraft/movecraft/util/BlockUtils.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/util/ChatUtils.java b/Movecraft/src/main/java/net/countercraft/movecraft/util/ChatUtils.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/util/ChatUtils.java rename to Movecraft/src/main/java/net/countercraft/movecraft/util/ChatUtils.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/util/SignUtils.java b/Movecraft/src/main/java/net/countercraft/movecraft/util/SignUtils.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/util/SignUtils.java rename to Movecraft/src/main/java/net/countercraft/movecraft/util/SignUtils.java diff --git a/modules/Movecraft/src/main/java/net/countercraft/movecraft/util/TopicPaginator.java b/Movecraft/src/main/java/net/countercraft/movecraft/util/TopicPaginator.java similarity index 100% rename from modules/Movecraft/src/main/java/net/countercraft/movecraft/util/TopicPaginator.java rename to Movecraft/src/main/java/net/countercraft/movecraft/util/TopicPaginator.java diff --git a/modules/Movecraft/src/main/resources/config.yml b/Movecraft/src/main/resources/config.yml similarity index 100% rename from modules/Movecraft/src/main/resources/config.yml rename to Movecraft/src/main/resources/config.yml diff --git a/modules/Movecraft/src/main/resources/localisation/movecraftlang_cz.properties b/Movecraft/src/main/resources/localisation/movecraftlang_cz.properties similarity index 100% rename from modules/Movecraft/src/main/resources/localisation/movecraftlang_cz.properties rename to Movecraft/src/main/resources/localisation/movecraftlang_cz.properties diff --git a/modules/Movecraft/src/main/resources/localisation/movecraftlang_en.properties b/Movecraft/src/main/resources/localisation/movecraftlang_en.properties similarity index 100% rename from modules/Movecraft/src/main/resources/localisation/movecraftlang_en.properties rename to Movecraft/src/main/resources/localisation/movecraftlang_en.properties diff --git a/modules/Movecraft/src/main/resources/localisation/movecraftlang_fr.properties b/Movecraft/src/main/resources/localisation/movecraftlang_fr.properties similarity index 100% rename from modules/Movecraft/src/main/resources/localisation/movecraftlang_fr.properties rename to Movecraft/src/main/resources/localisation/movecraftlang_fr.properties diff --git a/modules/Movecraft/src/main/resources/localisation/movecraftlang_nl.properties b/Movecraft/src/main/resources/localisation/movecraftlang_nl.properties similarity index 100% rename from modules/Movecraft/src/main/resources/localisation/movecraftlang_nl.properties rename to Movecraft/src/main/resources/localisation/movecraftlang_nl.properties diff --git a/modules/Movecraft/src/main/resources/localisation/movecraftlang_no.properties b/Movecraft/src/main/resources/localisation/movecraftlang_no.properties similarity index 100% rename from modules/Movecraft/src/main/resources/localisation/movecraftlang_no.properties rename to Movecraft/src/main/resources/localisation/movecraftlang_no.properties diff --git a/modules/Movecraft/src/main/resources/plugin.yml b/Movecraft/src/main/resources/plugin.yml similarity index 91% rename from modules/Movecraft/src/main/resources/plugin.yml rename to Movecraft/src/main/resources/plugin.yml index c51443948..02b88a40d 100644 --- a/modules/Movecraft/src/main/resources/plugin.yml +++ b/Movecraft/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: Movecraft -version: ${project.version} +version: ${projectVersion} api-version: 1.16 description: The original flight and movement plugin for minecraft. authors: [cccm5, BaccaYarro, TylerS1066, eirik1996, drfiveminusmint, HumorousFool] @@ -39,4 +39,6 @@ commands: usage: /crafttype [type] [page] craftinfo: description: Get information on a piloted craft - usage: /craftinfo [player] [page] \ No newline at end of file + usage: /craftinfo [player] [page] +libraries: + - org.roaringbitmap:RoaringBitmap:1.0.6 diff --git a/modules/Movecraft/src/main/resources/types/Airship.craft b/Movecraft/src/main/resources/types/Airship.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/Airship.craft rename to Movecraft/src/main/resources/types/Airship.craft diff --git a/modules/Movecraft/src/main/resources/types/Airskiff.craft b/Movecraft/src/main/resources/types/Airskiff.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/Airskiff.craft rename to Movecraft/src/main/resources/types/Airskiff.craft diff --git a/modules/Movecraft/src/main/resources/types/BigAirship.craft b/Movecraft/src/main/resources/types/BigAirship.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/BigAirship.craft rename to Movecraft/src/main/resources/types/BigAirship.craft diff --git a/modules/Movecraft/src/main/resources/types/BigSubAirship.craft b/Movecraft/src/main/resources/types/BigSubAirship.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/BigSubAirship.craft rename to Movecraft/src/main/resources/types/BigSubAirship.craft diff --git a/modules/Movecraft/src/main/resources/types/Elevator.craft b/Movecraft/src/main/resources/types/Elevator.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/Elevator.craft rename to Movecraft/src/main/resources/types/Elevator.craft diff --git a/modules/Movecraft/src/main/resources/types/LaunchTorpedo.craft b/Movecraft/src/main/resources/types/LaunchTorpedo.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/LaunchTorpedo.craft rename to Movecraft/src/main/resources/types/LaunchTorpedo.craft diff --git a/modules/Movecraft/src/main/resources/types/MediumAirship.craft b/Movecraft/src/main/resources/types/MediumAirship.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/MediumAirship.craft rename to Movecraft/src/main/resources/types/MediumAirship.craft diff --git a/modules/Movecraft/src/main/resources/types/MediumSubAirship.craft b/Movecraft/src/main/resources/types/MediumSubAirship.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/MediumSubAirship.craft rename to Movecraft/src/main/resources/types/MediumSubAirship.craft diff --git a/modules/Movecraft/src/main/resources/types/Ship.craft b/Movecraft/src/main/resources/types/Ship.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/Ship.craft rename to Movecraft/src/main/resources/types/Ship.craft diff --git a/modules/Movecraft/src/main/resources/types/SubAirship.craft b/Movecraft/src/main/resources/types/SubAirship.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/SubAirship.craft rename to Movecraft/src/main/resources/types/SubAirship.craft diff --git a/modules/Movecraft/src/main/resources/types/Submarine.craft b/Movecraft/src/main/resources/types/Submarine.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/Submarine.craft rename to Movecraft/src/main/resources/types/Submarine.craft diff --git a/modules/Movecraft/src/main/resources/types/Turret.craft b/Movecraft/src/main/resources/types/Turret.craft similarity index 100% rename from modules/Movecraft/src/main/resources/types/Turret.craft rename to Movecraft/src/main/resources/types/Turret.craft diff --git a/README.md b/README.md index bd2f8d35c..bdf9134be 100644 --- a/README.md +++ b/README.md @@ -24,18 +24,10 @@ Please check the [Wiki](https://github.com/APDevTeam/Movecraft/wiki) and [FAQ](h [Discord](http://bit.ly/JoinAP-Dev) ## Development Environment -Movecraft uses multiple versions of the Spigot server software for legacy support. As such, you need to run [BuildTools](https://www.spigotmc.org/wiki/buildtools/) for several versions before building the plugin. It doesn't matter where you do this, but inside the Movecraft directory is probably a bad place. We recommend building Spigot 1.18.2 and 1.19.4 with Java 17, and 1.20.6 with Java 21. - -``` -java -jar BuildTools.jar --rev 1.18.2 --remapped -java -jar BuildTools.jar --rev 1.19.4 --remapped -java -jar BuildTools.jar --rev 1.20.6 --remapped -``` - -Once you have compiled CraftBukkit, it should continue to exist in your local maven repository, and thus you should need to compile each version at most one time. Once complete, run the following to build Movecraft through `maven`. +Building Movecraft is as easy as downloading the source code and executing the following command: ``` -mvn -T 1C clean install +./gradlew clean shadowJar ``` -Compiled jars can be found in the `/target` directory. +Compiled jars can be found in the `Movecraft/build/libs` directory. #### Movecraft is released under the GNU General Public License V3. diff --git a/api/build.gradle.kts b/api/build.gradle.kts new file mode 100644 index 000000000..9c72f6524 --- /dev/null +++ b/api/build.gradle.kts @@ -0,0 +1,33 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + id("buildlogic.java-conventions") +} + +java.toolchain.languageVersion = JavaLanguageVersion.of(17) + +dependencies { + api(libs.io.papermc.paper.paper.api) + api(libs.org.openjdk.jmh.jmh.core) + api(libs.org.openjdk.jmh.jmh.generator.annprocess) + api(libs.org.roaringbitmap.roaringbitmap) + api(libs.it.unimi.dsi.fastutil) + api(libs.net.kyori.adventure.api) + api(libs.net.kyori.adventure.platform.bukkit) + testImplementation(libs.org.junit.jupiter.junit.jupiter.api) + testImplementation(libs.junit.junit) + testImplementation(libs.org.hamcrest.hamcrest.library) + compileOnly(libs.org.jetbrains.annotations) +} + +tasks { + compileJava { + options.compilerArgs.addAll(listOf( + "--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED" + )) + } +} + +description = "Movecraft-API" diff --git a/modules/api/src/main/java/net/countercraft/movecraft/CruiseDirection.java b/api/src/main/java/net/countercraft/movecraft/CruiseDirection.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/CruiseDirection.java rename to api/src/main/java/net/countercraft/movecraft/CruiseDirection.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/MovecraftChunk.java b/api/src/main/java/net/countercraft/movecraft/MovecraftChunk.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/MovecraftChunk.java rename to api/src/main/java/net/countercraft/movecraft/MovecraftChunk.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/MovecraftLocation.java b/api/src/main/java/net/countercraft/movecraft/MovecraftLocation.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/MovecraftLocation.java rename to api/src/main/java/net/countercraft/movecraft/MovecraftLocation.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/MovecraftRotation.java b/api/src/main/java/net/countercraft/movecraft/MovecraftRotation.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/MovecraftRotation.java rename to api/src/main/java/net/countercraft/movecraft/MovecraftRotation.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/SmoothTeleport.java b/api/src/main/java/net/countercraft/movecraft/SmoothTeleport.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/SmoothTeleport.java rename to api/src/main/java/net/countercraft/movecraft/SmoothTeleport.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/WorldHandler.java b/api/src/main/java/net/countercraft/movecraft/WorldHandler.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/WorldHandler.java rename to api/src/main/java/net/countercraft/movecraft/WorldHandler.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/config/Settings.java b/api/src/main/java/net/countercraft/movecraft/config/Settings.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/config/Settings.java rename to api/src/main/java/net/countercraft/movecraft/config/Settings.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/Craft.java b/api/src/main/java/net/countercraft/movecraft/craft/Craft.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/Craft.java rename to api/src/main/java/net/countercraft/movecraft/craft/Craft.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/CraftStatus.java b/api/src/main/java/net/countercraft/movecraft/craft/CraftStatus.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/CraftStatus.java rename to api/src/main/java/net/countercraft/movecraft/craft/CraftStatus.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/PilotedCraft.java b/api/src/main/java/net/countercraft/movecraft/craft/PilotedCraft.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/PilotedCraft.java rename to api/src/main/java/net/countercraft/movecraft/craft/PilotedCraft.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/PlayerCraft.java b/api/src/main/java/net/countercraft/movecraft/craft/PlayerCraft.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/PlayerCraft.java rename to api/src/main/java/net/countercraft/movecraft/craft/PlayerCraft.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/SinkingCraft.java b/api/src/main/java/net/countercraft/movecraft/craft/SinkingCraft.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/SinkingCraft.java rename to api/src/main/java/net/countercraft/movecraft/craft/SinkingCraft.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/SubCraft.java b/api/src/main/java/net/countercraft/movecraft/craft/SubCraft.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/SubCraft.java rename to api/src/main/java/net/countercraft/movecraft/craft/SubCraft.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/CraftType.java b/api/src/main/java/net/countercraft/movecraft/craft/type/CraftType.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/CraftType.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/CraftType.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/RequiredBlockEntry.java b/api/src/main/java/net/countercraft/movecraft/craft/type/RequiredBlockEntry.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/RequiredBlockEntry.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/RequiredBlockEntry.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/TypeData.java b/api/src/main/java/net/countercraft/movecraft/craft/type/TypeData.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/TypeData.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/TypeData.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/BooleanProperty.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/BooleanProperty.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/BooleanProperty.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/BooleanProperty.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/DoubleProperty.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/DoubleProperty.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/DoubleProperty.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/DoubleProperty.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/FloatProperty.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/FloatProperty.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/FloatProperty.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/FloatProperty.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/IntegerProperty.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/IntegerProperty.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/IntegerProperty.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/IntegerProperty.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/MaterialSetProperty.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/MaterialSetProperty.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/MaterialSetProperty.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/MaterialSetProperty.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/ObjectProperty.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/ObjectProperty.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/ObjectProperty.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/ObjectProperty.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/ObjectPropertyImpl.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/ObjectPropertyImpl.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/ObjectPropertyImpl.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/ObjectPropertyImpl.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/PerWorldProperty.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/PerWorldProperty.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/PerWorldProperty.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/PerWorldProperty.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/Property.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/Property.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/Property.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/Property.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/RequiredBlockProperty.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/RequiredBlockProperty.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/RequiredBlockProperty.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/RequiredBlockProperty.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/StringProperty.java b/api/src/main/java/net/countercraft/movecraft/craft/type/property/StringProperty.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/property/StringProperty.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/property/StringProperty.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/BooleanTransform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/BooleanTransform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/BooleanTransform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/BooleanTransform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/DoubleTransform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/DoubleTransform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/DoubleTransform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/DoubleTransform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/FloatTransform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/FloatTransform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/FloatTransform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/FloatTransform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/IntegerTransform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/IntegerTransform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/IntegerTransform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/IntegerTransform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/MaterialSetTransform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/MaterialSetTransform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/MaterialSetTransform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/MaterialSetTransform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/ObjectTransform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/ObjectTransform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/ObjectTransform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/ObjectTransform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/PerWorldTransform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/PerWorldTransform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/PerWorldTransform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/PerWorldTransform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/RequiredBlockTransform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/RequiredBlockTransform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/RequiredBlockTransform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/RequiredBlockTransform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/StringTransform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/StringTransform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/StringTransform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/StringTransform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/Transform.java b/api/src/main/java/net/countercraft/movecraft/craft/type/transform/Transform.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/craft/type/transform/Transform.java rename to api/src/main/java/net/countercraft/movecraft/craft/type/transform/Transform.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftCollisionEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftCollisionEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftCollisionEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftCollisionEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftCollisionExplosionEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftCollisionExplosionEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftCollisionExplosionEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftCollisionExplosionEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftDetectEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftDetectEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftDetectEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftDetectEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftPilotEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftPilotEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftPilotEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftPilotEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftPreTranslateEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftPreTranslateEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftPreTranslateEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftPreTranslateEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftReleaseEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftReleaseEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftReleaseEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftReleaseEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftRotateEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftRotateEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftRotateEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftRotateEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftScuttleEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftScuttleEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftScuttleEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftScuttleEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftSinkEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftSinkEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftSinkEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftSinkEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftTeleportEntityEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftTeleportEntityEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftTeleportEntityEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftTeleportEntityEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/CraftTranslateEvent.java b/api/src/main/java/net/countercraft/movecraft/events/CraftTranslateEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/CraftTranslateEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/CraftTranslateEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/ExplosionEvent.java b/api/src/main/java/net/countercraft/movecraft/events/ExplosionEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/ExplosionEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/ExplosionEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/FuelBurnEvent.java b/api/src/main/java/net/countercraft/movecraft/events/FuelBurnEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/FuelBurnEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/FuelBurnEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/ItemHarvestEvent.java b/api/src/main/java/net/countercraft/movecraft/events/ItemHarvestEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/ItemHarvestEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/ItemHarvestEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/ManOverboardEvent.java b/api/src/main/java/net/countercraft/movecraft/events/ManOverboardEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/ManOverboardEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/ManOverboardEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/SignTranslateEvent.java b/api/src/main/java/net/countercraft/movecraft/events/SignTranslateEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/SignTranslateEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/SignTranslateEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/events/TypesReloadedEvent.java b/api/src/main/java/net/countercraft/movecraft/events/TypesReloadedEvent.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/events/TypesReloadedEvent.java rename to api/src/main/java/net/countercraft/movecraft/events/TypesReloadedEvent.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/exception/EmptyHitBoxException.java b/api/src/main/java/net/countercraft/movecraft/exception/EmptyHitBoxException.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/exception/EmptyHitBoxException.java rename to api/src/main/java/net/countercraft/movecraft/exception/EmptyHitBoxException.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/exception/NonCancellableReleaseException.java b/api/src/main/java/net/countercraft/movecraft/exception/NonCancellableReleaseException.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/exception/NonCancellableReleaseException.java rename to api/src/main/java/net/countercraft/movecraft/exception/NonCancellableReleaseException.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/processing/CachedMovecraftWorld.java b/api/src/main/java/net/countercraft/movecraft/processing/CachedMovecraftWorld.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/processing/CachedMovecraftWorld.java rename to api/src/main/java/net/countercraft/movecraft/processing/CachedMovecraftWorld.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/processing/MovecraftWorld.java b/api/src/main/java/net/countercraft/movecraft/processing/MovecraftWorld.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/processing/MovecraftWorld.java rename to api/src/main/java/net/countercraft/movecraft/processing/MovecraftWorld.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/processing/WorldManager.java b/api/src/main/java/net/countercraft/movecraft/processing/WorldManager.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/processing/WorldManager.java rename to api/src/main/java/net/countercraft/movecraft/processing/WorldManager.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/processing/effects/Effect.java b/api/src/main/java/net/countercraft/movecraft/processing/effects/Effect.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/processing/effects/Effect.java rename to api/src/main/java/net/countercraft/movecraft/processing/effects/Effect.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/support/AsyncChunk.java b/api/src/main/java/net/countercraft/movecraft/support/AsyncChunk.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/support/AsyncChunk.java rename to api/src/main/java/net/countercraft/movecraft/support/AsyncChunk.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/support/MovecraftState.java b/api/src/main/java/net/countercraft/movecraft/support/MovecraftState.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/support/MovecraftState.java rename to api/src/main/java/net/countercraft/movecraft/support/MovecraftState.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/AtomicBitSet.java b/api/src/main/java/net/countercraft/movecraft/util/AtomicBitSet.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/AtomicBitSet.java rename to api/src/main/java/net/countercraft/movecraft/util/AtomicBitSet.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/AtomicLocationSet.java b/api/src/main/java/net/countercraft/movecraft/util/AtomicLocationSet.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/AtomicLocationSet.java rename to api/src/main/java/net/countercraft/movecraft/util/AtomicLocationSet.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/BitMath.java b/api/src/main/java/net/countercraft/movecraft/util/BitMath.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/BitMath.java rename to api/src/main/java/net/countercraft/movecraft/util/BitMath.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/BukkitTeleport.java b/api/src/main/java/net/countercraft/movecraft/util/BukkitTeleport.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/BukkitTeleport.java rename to api/src/main/java/net/countercraft/movecraft/util/BukkitTeleport.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/CollectionUtils.java b/api/src/main/java/net/countercraft/movecraft/util/CollectionUtils.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/CollectionUtils.java rename to api/src/main/java/net/countercraft/movecraft/util/CollectionUtils.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/CompletableFutureTask.java b/api/src/main/java/net/countercraft/movecraft/util/CompletableFutureTask.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/CompletableFutureTask.java rename to api/src/main/java/net/countercraft/movecraft/util/CompletableFutureTask.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/Counter.java b/api/src/main/java/net/countercraft/movecraft/util/Counter.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/Counter.java rename to api/src/main/java/net/countercraft/movecraft/util/Counter.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/MathUtils.java b/api/src/main/java/net/countercraft/movecraft/util/MathUtils.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/MathUtils.java rename to api/src/main/java/net/countercraft/movecraft/util/MathUtils.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/Pair.java b/api/src/main/java/net/countercraft/movecraft/util/Pair.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/Pair.java rename to api/src/main/java/net/countercraft/movecraft/util/Pair.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/ReflectUtils.java b/api/src/main/java/net/countercraft/movecraft/util/ReflectUtils.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/ReflectUtils.java rename to api/src/main/java/net/countercraft/movecraft/util/ReflectUtils.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/Tags.java b/api/src/main/java/net/countercraft/movecraft/util/Tags.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/Tags.java rename to api/src/main/java/net/countercraft/movecraft/util/Tags.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/TimingData.java b/api/src/main/java/net/countercraft/movecraft/util/TimingData.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/TimingData.java rename to api/src/main/java/net/countercraft/movecraft/util/TimingData.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/UnsafeUtils.java b/api/src/main/java/net/countercraft/movecraft/util/UnsafeUtils.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/UnsafeUtils.java rename to api/src/main/java/net/countercraft/movecraft/util/UnsafeUtils.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/collections/BitmapLocationSet.java b/api/src/main/java/net/countercraft/movecraft/util/collections/BitmapLocationSet.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/collections/BitmapLocationSet.java rename to api/src/main/java/net/countercraft/movecraft/util/collections/BitmapLocationSet.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/collections/LocationSet.java b/api/src/main/java/net/countercraft/movecraft/util/collections/LocationSet.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/collections/LocationSet.java rename to api/src/main/java/net/countercraft/movecraft/util/collections/LocationSet.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/collections/LocationTrieSet.java b/api/src/main/java/net/countercraft/movecraft/util/collections/LocationTrieSet.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/collections/LocationTrieSet.java rename to api/src/main/java/net/countercraft/movecraft/util/collections/LocationTrieSet.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/collections/PackableTrie.java b/api/src/main/java/net/countercraft/movecraft/util/collections/PackableTrie.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/collections/PackableTrie.java rename to api/src/main/java/net/countercraft/movecraft/util/collections/PackableTrie.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/functions/QuadFunction.java b/api/src/main/java/net/countercraft/movecraft/util/functions/QuadFunction.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/functions/QuadFunction.java rename to api/src/main/java/net/countercraft/movecraft/util/functions/QuadFunction.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/functions/TriFunction.java b/api/src/main/java/net/countercraft/movecraft/util/functions/TriFunction.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/functions/TriFunction.java rename to api/src/main/java/net/countercraft/movecraft/util/functions/TriFunction.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/BitmapHitBox.java b/api/src/main/java/net/countercraft/movecraft/util/hitboxes/BitmapHitBox.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/BitmapHitBox.java rename to api/src/main/java/net/countercraft/movecraft/util/hitboxes/BitmapHitBox.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/HitBox.java b/api/src/main/java/net/countercraft/movecraft/util/hitboxes/HitBox.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/HitBox.java rename to api/src/main/java/net/countercraft/movecraft/util/hitboxes/HitBox.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/MutableHitBox.java b/api/src/main/java/net/countercraft/movecraft/util/hitboxes/MutableHitBox.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/MutableHitBox.java rename to api/src/main/java/net/countercraft/movecraft/util/hitboxes/MutableHitBox.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/SetHitBox.java b/api/src/main/java/net/countercraft/movecraft/util/hitboxes/SetHitBox.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/SetHitBox.java rename to api/src/main/java/net/countercraft/movecraft/util/hitboxes/SetHitBox.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/SolidHitBox.java b/api/src/main/java/net/countercraft/movecraft/util/hitboxes/SolidHitBox.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/hitboxes/SolidHitBox.java rename to api/src/main/java/net/countercraft/movecraft/util/hitboxes/SolidHitBox.java diff --git a/modules/api/src/main/java/net/countercraft/movecraft/util/packets/Removed.java b/api/src/main/java/net/countercraft/movecraft/util/packets/Removed.java similarity index 100% rename from modules/api/src/main/java/net/countercraft/movecraft/util/packets/Removed.java rename to api/src/main/java/net/countercraft/movecraft/util/packets/Removed.java diff --git a/modules/api/src/test/net/countercraft/movecraft/AtomicLocationSetTest.java b/api/src/test/net/countercraft/movecraft/AtomicLocationSetTest.java similarity index 100% rename from modules/api/src/test/net/countercraft/movecraft/AtomicLocationSetTest.java rename to api/src/test/net/countercraft/movecraft/AtomicLocationSetTest.java diff --git a/modules/api/src/test/net/countercraft/movecraft/BitmapHitBoxTest.java b/api/src/test/net/countercraft/movecraft/BitmapHitBoxTest.java similarity index 100% rename from modules/api/src/test/net/countercraft/movecraft/BitmapHitBoxTest.java rename to api/src/test/net/countercraft/movecraft/BitmapHitBoxTest.java diff --git a/modules/api/src/test/net/countercraft/movecraft/LocationSetInitializeBenchmark.java b/api/src/test/net/countercraft/movecraft/LocationSetInitializeBenchmark.java similarity index 100% rename from modules/api/src/test/net/countercraft/movecraft/LocationSetInitializeBenchmark.java rename to api/src/test/net/countercraft/movecraft/LocationSetInitializeBenchmark.java diff --git a/modules/api/src/test/net/countercraft/movecraft/LocationSetIterateBenchmark.java b/api/src/test/net/countercraft/movecraft/LocationSetIterateBenchmark.java similarity index 100% rename from modules/api/src/test/net/countercraft/movecraft/LocationSetIterateBenchmark.java rename to api/src/test/net/countercraft/movecraft/LocationSetIterateBenchmark.java diff --git a/modules/api/src/test/net/countercraft/movecraft/MovecraftLocationTest.java b/api/src/test/net/countercraft/movecraft/MovecraftLocationTest.java similarity index 100% rename from modules/api/src/test/net/countercraft/movecraft/MovecraftLocationTest.java rename to api/src/test/net/countercraft/movecraft/MovecraftLocationTest.java diff --git a/modules/api/src/test/net/countercraft/movecraft/SolidHitBoxTest.java b/api/src/test/net/countercraft/movecraft/SolidHitBoxTest.java similarity index 100% rename from modules/api/src/test/net/countercraft/movecraft/SolidHitBoxTest.java rename to api/src/test/net/countercraft/movecraft/SolidHitBoxTest.java diff --git a/modules/api/src/test/net/countercraft/movecraft/TestBenchmark.java b/api/src/test/net/countercraft/movecraft/TestBenchmark.java similarity index 100% rename from modules/api/src/test/net/countercraft/movecraft/TestBenchmark.java rename to api/src/test/net/countercraft/movecraft/TestBenchmark.java diff --git a/modules/api/src/test/net/countercraft/movecraft/TreeHitBoxTest.java b/api/src/test/net/countercraft/movecraft/TreeHitBoxTest.java similarity index 100% rename from modules/api/src/test/net/countercraft/movecraft/TreeHitBoxTest.java rename to api/src/test/net/countercraft/movecraft/TreeHitBoxTest.java diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..6247aa687 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,8 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + id("buildlogic.java-conventions") + id("io.papermc.paperweight.userdev") version "1.7.1" apply false +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 000000000..018784784 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,13 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + // Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. + `kotlin-dsl` +} + +repositories { + // Use the plugin portal to apply community plugins in convention plugins. + gradlePluginPortal() +} diff --git a/buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts new file mode 100644 index 000000000..a3315ee75 --- /dev/null +++ b/buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts @@ -0,0 +1,52 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + `java-library` + `maven-publish` +} + +repositories { + mavenLocal() + maven { + url = uri("https://repo.maven.apache.org/maven2/") + } + + maven { + url = uri("https://maven.pkg.github.com/APDevTeam/Movecraft") + } + + maven { + url = uri("https://hub.spigotmc.org/nexus/content/groups/public/") + } + + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + } + + maven { + url = uri("https://repo.dmulloy2.net/nexus/repository/public/") + } + + maven { + url = uri("https://repo.papermc.io/repository/maven-public/") + } +} + +group = "net.countercraft" +version = "8.0.0_beta-3" + +publishing { + publications.create("maven") { + from(components["java"]) + } +} + +tasks.withType() { + options.encoding = "UTF-8" +} + +tasks.withType() { + options.encoding = "UTF-8" +} diff --git a/datapack/build.gradle.kts b/datapack/build.gradle.kts new file mode 100644 index 000000000..d40a72cae --- /dev/null +++ b/datapack/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + base +} + +val zipTask = tasks.register("zipFolder") { + archiveFileName.set("movecraft-data.zip") + destinationDirectory.set(file("$buildDir/zip")) + + from("src/main/resources/movecraft-data") { + include("**/*") // Include all files and folders within the specified folder + } +} + +tasks.build { + dependsOn(zipTask) +} + +description = "Movecraft-Datapack" diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/carpets.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/carpets.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/carpets.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/carpets.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/chests.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/chests.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/chests.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/chests.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/concrete.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/concrete.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/concrete.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/concrete.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/concrete_powder.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/concrete_powder.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/concrete_powder.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/concrete_powder.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/fence_gates.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/fence_gates.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/fence_gates.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/fence_gates.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass_blocks.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass_blocks.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass_blocks.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass_blocks.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass_panes.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass_panes.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass_panes.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glass_panes.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glazed_terracotta.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glazed_terracotta.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glazed_terracotta.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/glazed_terracotta.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/heads.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/heads.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/heads.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/heads.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/pressure_plates.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/pressure_plates.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/pressure_plates.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/pressure_plates.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/redstone_torches.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/redstone_torches.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/redstone_torches.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/redstone_torches.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/smelter.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/smelter.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/smelter.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/smelter.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/stained_glass_blocks.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/stained_glass_blocks.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/stained_glass_blocks.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/stained_glass_blocks.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/stained_glass_panes.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/stained_glass_panes.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/stained_glass_panes.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/stained_glass_panes.json diff --git a/modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/terracotta.json b/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/terracotta.json similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/terracotta.json rename to datapack/src/main/resources/movecraft-data/data/minecraft/tags/blocks/terracotta.json diff --git a/modules/datapack/src/main/resources/movecraft-data/pack.mcmeta b/datapack/src/main/resources/movecraft-data/pack.mcmeta similarity index 100% rename from modules/datapack/src/main/resources/movecraft-data/pack.mcmeta rename to datapack/src/main/resources/movecraft-data/pack.mcmeta diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..8ab52af61 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,30 @@ +# This file was generated by the Gradle 'init' task. +# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format + +[versions] +io-papermc-paper-paper-api = "1.18.2-R0.1-SNAPSHOT" +it-unimi-dsi-fastutil = "8.5.13" +junit-junit = "4.13.2" +net-kyori-adventure-api = "4.17.0" +net-kyori-adventure-platform-bukkit = "4.3.2" +org-hamcrest-hamcrest-library = "1.3" +org-jetbrains-annotations = "24.1.0" +org-junit-jupiter-junit-jupiter-api = "5.10.2" +org-openjdk-jmh-jmh-core = "1.37" +org-openjdk-jmh-jmh-generator-annprocess = "1.37" +org-roaringbitmap-roaringbitmap = "1.0.6" +org-yaml-snakeyaml = "2.0" + +[libraries] +io-papermc-paper-paper-api = { module = "io.papermc.paper:paper-api", version.ref = "io-papermc-paper-paper-api" } +it-unimi-dsi-fastutil = { module = "it.unimi.dsi:fastutil", version.ref = "it-unimi-dsi-fastutil" } +junit-junit = { module = "junit:junit", version.ref = "junit-junit" } +net-kyori-adventure-api = { module = "net.kyori:adventure-api", version.ref = "net-kyori-adventure-api" } +net-kyori-adventure-platform-bukkit = { module = "net.kyori:adventure-platform-bukkit", version.ref = "net-kyori-adventure-platform-bukkit" } +org-hamcrest-hamcrest-library = { module = "org.hamcrest:hamcrest-library", version.ref = "org-hamcrest-hamcrest-library" } +org-jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "org-jetbrains-annotations" } +org-junit-jupiter-junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "org-junit-jupiter-junit-jupiter-api" } +org-openjdk-jmh-jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "org-openjdk-jmh-jmh-core" } +org-openjdk-jmh-jmh-generator-annprocess = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "org-openjdk-jmh-jmh-generator-annprocess" } +org-roaringbitmap-roaringbitmap = { module = "org.roaringbitmap:RoaringBitmap", version.ref = "org-roaringbitmap-roaringbitmap" } +org-yaml-snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "org-yaml-snakeyaml" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000..e6441136f Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..a4413138c --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 000000000..b740cf133 --- /dev/null +++ b/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 000000000..25da30dbd --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/modules/Movecraft/pom.xml b/modules/Movecraft/pom.xml deleted file mode 100644 index 4e3ea2952..000000000 --- a/modules/Movecraft/pom.xml +++ /dev/null @@ -1,201 +0,0 @@ - - 4.0.0 - movecraft - jar - Movecraft - http://github.com/APDevTeam/Movecraft - - UTF-8 - - - movecraft-parent - net.countercraft - ${revision} - ../../pom.xml - - - - - apache.snapshots - https://repository.apache.org/snapshots/ - - - - - - net.countercraft - movecraft-v1_18 - ${revision} - jar - - - net.countercraft - movecraft-v1_19 - ${revision} - jar - - - net.countercraft - movecraft-v1_20 - ${revision} - jar - - - net.countercraft - movecraft-api - ${revision} - jar - - - net.countercraft - movecraft-datapack - ${revision} - jar - - - org.yaml - snakeyaml - 2.0 - - - - - Movecraft - ../../target - src/main/java - - - . - true - src/main/resources - - plugin.yml - config.yml - localisation/** - types/*.craft - movecraft-data.zip - - - - . - true - ../../target-datapack - - movecraft-data.zip - - - - . - ../../ - - LICENSE.md - - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.6 - - UTF-8 - - zip - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - true - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 17 - 17 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8.1 - - *.metrics - - - - org.apache.maven.plugins - maven-shade-plugin - 3.3.0 - - - package - - shade - - - - - it.unimi - net.countercraft.movecraft.libs.it.unimi - - - net.kyori - net.countercraft.movecraft.libs.net.kyori - - - org.roaringbitmap - net.countercraft.movecraft.libs.org.roaringbitmap - - - true - false - - - net.countercraft:movecraft-v1_18 - - ** - - - - net.countercraft:movecraft-v1_19 - - ** - - - - net.countercraft:movecraft-v1_20 - - ** - - - - net.countercraft:datapack - - ** - - - - - - net.countercraft:movecraft* - org.roaringbitmap:* - it.unimi.dsi:fastutil* - net.kyori:adventure* - net.kyori:examination* - - - - - - - - - diff --git a/modules/api/pom.xml b/modules/api/pom.xml deleted file mode 100644 index dcabe345b..000000000 --- a/modules/api/pom.xml +++ /dev/null @@ -1,192 +0,0 @@ - - 4.0.0 - movecraft-api - Movecraft-API - http://github.com/apdevteam/Movecraft - - - UTF-8 - 5.10.2 - ${junit.jupiter.version} - 1.2.0 - 4.13.2 - - - - net.countercraft - movecraft-parent - ${revision} - ../../pom.xml - - - - - apache.snapshots - https://repository.apache.org/snapshots/ - - - - - - sonatype-oss-snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - - dmulloy2-repo - https://repo.dmulloy2.net/nexus/repository/public/ - - - papermc - https://repo.papermc.io/repository/maven-public/ - - - - - io.papermc.paper - paper-api - 1.18.2-R0.1-SNAPSHOT - - - org.jetbrains - annotations - 24.1.0 - provided - - - org.junit.jupiter - junit-jupiter-api - ${junit.jupiter.version} - test - - - junit - junit - ${junit.version} - test - - - org.hamcrest - hamcrest-library - 1.3 - test - - - org.openjdk.jmh - jmh-core - 1.37 - - - org.openjdk.jmh - jmh-generator-annprocess - 1.37 - - - org.roaringbitmap - RoaringBitmap - 1.0.6 - compile - - - it.unimi.dsi - fastutil - 8.5.13 - compile - - - net.kyori - adventure-api - 4.17.0 - - - net.kyori - adventure-platform-bukkit - 4.3.2 - - - - - src/main/java - src/test - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - - --add-exports - java.base/jdk.internal.vm.annotation=ALL-UNNAMED - - - net/countercraft/movecraft/** - - 17 - 17 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - net/countercraft/movecraft/** - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.0 - - false - -XX:-RestrictContended - - - - org.junit.platform - junit-platform-surefire-provider - ${junit.platform.version} - - - org.junit.jupiter - junit-jupiter-engine - ${junit.jupiter.version} - - - org.junit.vintage - junit-vintage-engine - ${junit.vintage.version} - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.3.0 - - - package - - shade - - - false - true - - - net.countercraft:movecraft* - org.roaringbitmap:* - it.unimi.dsi:fastutil* - net.kyori:adventure* - net.kyori:examination* - - - - - - - - - diff --git a/modules/datapack/pom.xml b/modules/datapack/pom.xml deleted file mode 100644 index 9a04ed65b..000000000 --- a/modules/datapack/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - net.countercraft - movecraft-parent - ${revision} - ../../pom.xml - - 4.0.0 - movecraft-datapack - jar - datapack - - UTF-8 - - - - Movecraft - ../../target-datapack - - - src - true - src/main/resources - - ** - - - - src - true - ../../target-datapack - - movecraft-data.zip - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.3.0 - - - movecraft-data-zip - - single - - process-resources - - false - - src/main/resources/movecraft-data-zip.xml - - movecraft-data - false - - - - - - - diff --git a/modules/datapack/src/main/resources/movecraft-data-zip.xml b/modules/datapack/src/main/resources/movecraft-data-zip.xml deleted file mode 100644 index d3be8f178..000000000 --- a/modules/datapack/src/main/resources/movecraft-data-zip.xml +++ /dev/null @@ -1,14 +0,0 @@ - - movecraft-data-zip - false - - zip - - - - - src/main/resources/movecraft-data - / - - - diff --git a/modules/v1_18/pom.xml b/modules/v1_18/pom.xml deleted file mode 100644 index f69285382..000000000 --- a/modules/v1_18/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - movecraft-parent - net.countercraft - ${revision} - ../../pom.xml - - 4.0.0 - - movecraft-v1_18 - Movecraft-v1_18 - jar - - - org.spigotmc - spigot - 1.18.2-R0.1-SNAPSHOT - remapped-mojang - provided - - - - net.countercraft - movecraft-api - ${revision} - jar - - - - src/main/java - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - - net/countercraft/movecraft/compat/v1_18/** - net/countercraft/movecraft/support/v1_18/** - - 17 - 17 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - net/countercraft/movecraft/compat/v1_18/** - net/countercraft/movecraft/support/v1_18/** - - - - - net.md-5 - specialsource-maven-plugin - 2.0.3 - - - package - - remap - - remap-obf - - org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:txt:maps-mojang - true - org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT:jar:remapped-mojang - true - remapped-obf - - - - package - - remap - - remap-spigot - - ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar - org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:csrg:maps-spigot - org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT:jar:remapped-obf - - - - - - - - \ No newline at end of file diff --git a/modules/v1_19/pom.xml b/modules/v1_19/pom.xml deleted file mode 100644 index 43d5e94e0..000000000 --- a/modules/v1_19/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - movecraft-parent - net.countercraft - ${revision} - ../../pom.xml - - 4.0.0 - - movecraft-v1_19 - Movecraft-v1_19 - jar - - - org.spigotmc - spigot - 1.19.4-R0.1-SNAPSHOT - remapped-mojang - provided - - - - net.countercraft - movecraft-api - ${revision} - jar - - - - src/main/java - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - - net/countercraft/movecraft/compat/v1_19/** - net/countercraft/movecraft/support/v1_19/** - - 17 - 17 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - net/countercraft/movecraft/compat/v1_19/** - net/countercraft/movecraft/support/v1_19/** - - - - - net.md-5 - specialsource-maven-plugin - 2.0.3 - - - package - - remap - - remap-obf - - org.spigotmc:minecraft-server:1.19.4-R0.1-SNAPSHOT:txt:maps-mojang - true - org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT:jar:remapped-mojang - true - remapped-obf - - - - package - - remap - - remap-spigot - - ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar - org.spigotmc:minecraft-server:1.19.4-R0.1-SNAPSHOT:csrg:maps-spigot - org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT:jar:remapped-obf - - - - - - - diff --git a/modules/v1_19/src/main/java/net/countercraft/movecraft/compat/v1_19/IWorldHandler.java b/modules/v1_19/src/main/java/net/countercraft/movecraft/compat/v1_19/IWorldHandler.java deleted file mode 100644 index 568577933..000000000 --- a/modules/v1_19/src/main/java/net/countercraft/movecraft/compat/v1_19/IWorldHandler.java +++ /dev/null @@ -1,326 +0,0 @@ -package net.countercraft.movecraft.compat.v1_19; - -import net.countercraft.movecraft.MovecraftLocation; -import net.countercraft.movecraft.MovecraftRotation; -import net.countercraft.movecraft.WorldHandler; -import net.countercraft.movecraft.craft.Craft; -import net.countercraft.movecraft.util.CollectionUtils; -import net.countercraft.movecraft.util.MathUtils; -import net.countercraft.movecraft.util.UnsafeUtils; -import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.ContainerLevelAccess; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.Rotation; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.chunk.LevelChunk; -import net.minecraft.world.level.chunk.LevelChunkSection; -import net.minecraft.world.ticks.ScheduledTick; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.data.BlockData; -import org.bukkit.craftbukkit.v1_19_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_19_R3.block.data.CraftBlockData; -import org.bukkit.craftbukkit.v1_19_R3.inventory.CraftInventoryView; -import org.bukkit.craftbukkit.v1_19_R3.util.CraftMagicNumbers; -import org.bukkit.inventory.InventoryView; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@SuppressWarnings("unused") -public class IWorldHandler extends WorldHandler { - private static final Rotation ROTATION[]; - - static { - ROTATION = new Rotation[3]; - ROTATION[MovecraftRotation.NONE.ordinal()] = Rotation.NONE; - ROTATION[MovecraftRotation.CLOCKWISE.ordinal()] = Rotation.CLOCKWISE_90; - ROTATION[MovecraftRotation.ANTICLOCKWISE.ordinal()] = Rotation.COUNTERCLOCKWISE_90; - } - - private final NextTickProvider tickProvider = new NextTickProvider(); - - public IWorldHandler() { - String mappings = ((CraftMagicNumbers) CraftMagicNumbers.INSTANCE).getMappingsVersion(); - if (!mappings.equals("3009edc0fff87fa34680686663bd59df")) - throw new IllegalStateException("Movecraft is not compatible with this version of Minecraft 1.19: " + mappings); - } - - @Override - public void rotateCraft(@NotNull Craft craft, @NotNull MovecraftLocation originPoint, @NotNull MovecraftRotation rotation) { - //******************************************* - //* Step one: Convert to Positions * - //******************************************* - HashMap rotatedPositions = new HashMap<>(); - MovecraftRotation counterRotation = rotation == MovecraftRotation.CLOCKWISE ? MovecraftRotation.ANTICLOCKWISE : MovecraftRotation.CLOCKWISE; - for (MovecraftLocation newLocation : craft.getHitBox()) { - rotatedPositions.put(locationToPosition(MathUtils.rotateVec(counterRotation, newLocation.subtract(originPoint)).add(originPoint)), locationToPosition(newLocation)); - } - //******************************************* - //* Step two: Get the tiles * - //******************************************* - ServerLevel nativeWorld = ((CraftWorld) craft.getWorld()).getHandle(); - List tiles = new ArrayList<>(); - //get the tiles - for (BlockPos position : rotatedPositions.keySet()) { - //BlockEntity tile = nativeWorld.removeBlockEntity(position); - BlockEntity tile = removeBlockEntity(nativeWorld, position); - if (tile == null) - continue; -// tile.a(ROTATION[rotation.ordinal()]); - //get the nextTick to move with the tile - tiles.add(new TileHolder(tile, tickProvider.getNextTick(nativeWorld, position), position)); - } - - //******************************************* - //* Step three: Translate all the blocks * - //******************************************* - // blockedByWater=false means an ocean-going vessel - //TODO: Simplify - //TODO: go by chunks - //TODO: Don't move unnecessary blocks - //get the blocks and rotate them - HashMap blockData = new HashMap<>(); - for (BlockPos position : rotatedPositions.keySet()) { - blockData.put(position, nativeWorld.getBlockState(position).rotate(ROTATION[rotation.ordinal()])); - } - //create the new block - for (Map.Entry entry : blockData.entrySet()) { - setBlockFast(nativeWorld, rotatedPositions.get(entry.getKey()), entry.getValue()); - } - - - //******************************************* - //* Step four: replace all the tiles * - //******************************************* - //TODO: go by chunks - for (TileHolder tileHolder : tiles) { - moveBlockEntity(nativeWorld, rotatedPositions.get(tileHolder.getTilePosition()), tileHolder.getTile()); - if (tileHolder.getNextTick() == null) - continue; - final long currentTime = nativeWorld.J.getGameTime(); // J is obfuscated serverLevelData - nativeWorld.getBlockTicks().schedule(new ScheduledTick<>((Block) tileHolder.getNextTick().type(), rotatedPositions.get(tileHolder.getNextTick().pos()), tileHolder.getNextTick().triggerTick() - currentTime, tileHolder.getNextTick().priority(), tileHolder.getNextTick().subTickOrder())); - } - - //******************************************* - //* Step five: Destroy the leftovers * - //******************************************* - //TODO: add support for pass-through - Collection deletePositions = CollectionUtils.filter(rotatedPositions.keySet(), rotatedPositions.values()); - for (BlockPos position : deletePositions) { - setBlockFast(nativeWorld, position, Blocks.AIR.defaultBlockState()); - } - } - - @Override - public void translateCraft(@NotNull Craft craft, @NotNull MovecraftLocation displacement, @NotNull org.bukkit.World world) { - //TODO: Add support for rotations - //A craftTranslateCommand should only occur if the craft is moving to a valid position - //******************************************* - //* Step one: Convert to Positions * - //******************************************* - BlockPos translateVector = locationToPosition(displacement); - List positions = new ArrayList<>(craft.getHitBox().size()); - craft.getHitBox().forEach((movecraftLocation) -> positions.add(locationToPosition((movecraftLocation)).subtract(translateVector))); - ServerLevel oldNativeWorld = ((CraftWorld) craft.getWorld()).getHandle(); - ServerLevel nativeWorld = ((CraftWorld) world).getHandle(); - //******************************************* - //* Step two: Get the tiles * - //******************************************* - List tiles = new ArrayList<>(); - //get the tiles - for (int i = 0, positionsSize = positions.size(); i < positionsSize; i++) { - BlockPos position = positions.get(i); - if (oldNativeWorld.getBlockState(position) == Blocks.AIR.defaultBlockState()) - continue; - //BlockEntity tile = nativeWorld.removeBlockEntity(position); - BlockEntity tile = removeBlockEntity(oldNativeWorld, position); - if (tile == null) - continue; - //get the nextTick to move with the tile - - //nativeWorld.capturedTileEntities.remove(position); - //nativeWorld.getChunkAtWorldCoords(position).getTileEntities().remove(position); - tiles.add(new TileHolder(tile, tickProvider.getNextTick(oldNativeWorld, position), position)); - - } - //******************************************* - //* Step three: Translate all the blocks * - //******************************************* - // blockedByWater=false means an ocean-going vessel - //TODO: Simplify - //TODO: go by chunks - //TODO: Don't move unnecessary blocks - //get the blocks and translate the positions - List blockData = new ArrayList<>(); - List newPositions = new ArrayList<>(); - for (int i = 0, positionsSize = positions.size(); i < positionsSize; i++) { - BlockPos position = positions.get(i); - blockData.add(oldNativeWorld.getBlockState(position)); - newPositions.add(position.offset(translateVector)); - } - //create the new block - for (int i = 0, positionSize = newPositions.size(); i < positionSize; i++) { - setBlockFast(nativeWorld, newPositions.get(i), blockData.get(i)); - } - //******************************************* - //* Step four: replace all the tiles * - //******************************************* - //TODO: go by chunks - for (int i = 0, tilesSize = tiles.size(); i < tilesSize; i++) { - TileHolder tileHolder = tiles.get(i); - moveBlockEntity(nativeWorld, tileHolder.getTilePosition().offset(translateVector), tileHolder.getTile()); - if (tileHolder.getNextTick() == null) - continue; - final long currentTime = nativeWorld.getGameTime(); - nativeWorld.getBlockTicks().schedule(new ScheduledTick<>((Block) tileHolder.getNextTick().type(), tileHolder.getTilePosition().offset(translateVector), tileHolder.getNextTick().triggerTick() - currentTime, tileHolder.getNextTick().priority(), tileHolder.getNextTick().subTickOrder())); - } - //******************************************* - //* Step five: Destroy the leftovers * - //******************************************* - List deletePositions = positions; - if (oldNativeWorld == nativeWorld) - deletePositions = CollectionUtils.filter(positions, newPositions); - for (int i = 0, deletePositionsSize = deletePositions.size(); i < deletePositionsSize; i++) { - BlockPos position = deletePositions.get(i); - setBlockFast(oldNativeWorld, position, Blocks.AIR.defaultBlockState()); - } - } - - @Nullable - private BlockEntity removeBlockEntity(@NotNull Level world, @NotNull BlockPos position) { - return world.getChunkAt(position).blockEntities.remove(position); - } - - @NotNull - private BlockPos locationToPosition(@NotNull MovecraftLocation loc) { - return new BlockPos(loc.getX(), loc.getY(), loc.getZ()); - } - - private void setBlockFast(@NotNull Level world, @NotNull BlockPos position, @NotNull BlockState data) { - LevelChunk chunk = world.getChunkAt(position); - int chunkSection = (position.getY() >> 4) - chunk.getMinSection(); - LevelChunkSection section = chunk.getSections()[chunkSection]; - if (section == null) { - // Put a GLASS block to initialize the section. It will be replaced next with the real block. - chunk.setBlockState(position, Blocks.GLASS.defaultBlockState(), false); - section = chunk.getSections()[chunkSection]; - } - if (section.getBlockState(position.getX() & 15, position.getY() & 15, position.getZ() & 15).equals(data)) { - //Block is already of correct type and data, don't overwrite - return; - } - section.setBlockState(position.getX() & 15, position.getY() & 15, position.getZ() & 15, data); - world.sendBlockUpdated(position, data, data, 3); - world.getLightEngine().checkBlock(position); // boolean corresponds to if chunk section empty - chunk.setUnsaved(true); - } - - @Override - public void setBlockFast(@NotNull Location location, @NotNull BlockData data) { - setBlockFast(location, MovecraftRotation.NONE, data); - } - - @Override - public void setBlockFast(@NotNull Location location, @NotNull MovecraftRotation rotation, @NotNull BlockData data) { - BlockState blockData; - if (data instanceof CraftBlockData) { - blockData = ((CraftBlockData) data).getState(); - } - else { - blockData = (BlockState) data; - } - blockData = blockData.rotate(ROTATION[rotation.ordinal()]); - Level world = ((CraftWorld) (location.getWorld())).getHandle(); - BlockPos BlockPos = locationToPosition(MathUtils.bukkit2MovecraftLoc(location)); - setBlockFast(world, BlockPos, blockData); - } - - @Override - public @Nullable Location getAccessLocation(@NotNull InventoryView inventoryView) { - AbstractContainerMenu menu = ((CraftInventoryView) inventoryView).getHandle(); - Field field = UnsafeUtils.getFieldOfType(ContainerLevelAccess.class, menu.getClass()); - if (field != null) { - try { - field.setAccessible(true); - return ((ContainerLevelAccess) field.get(menu)).getLocation(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - return null; - } - - @Override - public void setAccessLocation(@NotNull InventoryView inventoryView, @NotNull Location location) { - if (location.getWorld() == null) - return; - ServerLevel level = ((CraftWorld) location.getWorld()).getHandle(); - BlockPos position = new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()); - ContainerLevelAccess access = ContainerLevelAccess.create(level, position); - - AbstractContainerMenu menu = ((CraftInventoryView) inventoryView).getHandle(); - UnsafeUtils.trySetFieldOfType(ContainerLevelAccess.class, menu, access); - } - - private void moveBlockEntity(@NotNull Level nativeWorld, @NotNull BlockPos newPosition, @NotNull BlockEntity tile) { - LevelChunk chunk = nativeWorld.getChunkAt(newPosition); - try { - var positionField = BlockEntity.class.getDeclaredField("p"); // p is obfuscated worldPosition - UnsafeUtils.setField(positionField, tile, newPosition); - } - catch (NoSuchFieldException e) { - e.printStackTrace(); - } - tile.setLevel(nativeWorld); - tile.clearRemoved(); - if (nativeWorld.captureBlockStates) { - nativeWorld.capturedTileEntities.put(newPosition, tile); - return; - } - chunk.setBlockEntity(tile); - chunk.blockEntities.put(newPosition, tile); - } - - private static class TileHolder { - @NotNull - private final BlockEntity tile; - @Nullable - private final ScheduledTick nextTick; - @NotNull - private final BlockPos tilePosition; - - public TileHolder(@NotNull BlockEntity tile, @Nullable ScheduledTick nextTick, @NotNull BlockPos tilePosition) { - this.tile = tile; - this.nextTick = nextTick; - this.tilePosition = tilePosition; - } - - - @NotNull - public BlockEntity getTile() { - return tile; - } - - @Nullable - public ScheduledTick getNextTick() { - return nextTick; - } - - @NotNull - public BlockPos getTilePosition() { - return tilePosition; - } - } -} \ No newline at end of file diff --git a/modules/v1_19/src/main/java/net/countercraft/movecraft/compat/v1_19/NextTickProvider.java b/modules/v1_19/src/main/java/net/countercraft/movecraft/compat/v1_19/NextTickProvider.java deleted file mode 100644 index 2a436da5c..000000000 --- a/modules/v1_19/src/main/java/net/countercraft/movecraft/compat/v1_19/NextTickProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.countercraft.movecraft.compat.v1_19; - -import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.levelgen.structure.BoundingBox; -import net.minecraft.world.ticks.LevelTicks; -import net.minecraft.world.ticks.ScheduledTick; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.lang.reflect.Field; -import java.util.List; -import java.util.Queue; - -public class NextTickProvider { - - @Nullable - public ScheduledTick getNextTick(@NotNull ServerLevel world, @NotNull BlockPos position){ - LevelTicks tickList = world.getBlockTicks(); - var box = BoundingBox.encapsulatingPositions(List.of(position)); - if(box.isEmpty()){ - return null; - } - Queue> toRunThisTick; - try { - Field toRunThisTickField = LevelTicks.class.getDeclaredField("g"); - toRunThisTickField.setAccessible(true); - toRunThisTick = (Queue>) toRunThisTickField.get(tickList); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - return null; - } - for (var iter = toRunThisTick.iterator(); iter.hasNext(); ) { - var next = iter.next(); - if (!next.pos().equals(position)) { - continue; - } - iter.remove(); - return next; - } - return null; - } -} diff --git a/modules/v1_19/src/main/java/net/countercraft/movecraft/support/v1_19/IAsyncChunk.java b/modules/v1_19/src/main/java/net/countercraft/movecraft/support/v1_19/IAsyncChunk.java deleted file mode 100644 index 92c842157..000000000 --- a/modules/v1_19/src/main/java/net/countercraft/movecraft/support/v1_19/IAsyncChunk.java +++ /dev/null @@ -1,61 +0,0 @@ -package net.countercraft.movecraft.support.v1_19; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import net.countercraft.movecraft.MovecraftLocation; -import net.countercraft.movecraft.processing.WorldManager; -import net.countercraft.movecraft.support.AsyncChunk; -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.chunk.ChunkAccess; -import net.minecraft.world.level.chunk.ChunkStatus; -import org.bukkit.Chunk; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.block.data.BlockData; -import org.bukkit.craftbukkit.v1_19_R3.CraftChunk; -import org.bukkit.craftbukkit.v1_19_R3.block.data.CraftBlockData; -import org.jetbrains.annotations.NotNull; - -@SuppressWarnings("unused") -public class IAsyncChunk extends AsyncChunk { - private final @NotNull LoadingCache stateCache = CacheBuilder.newBuilder().maximumSize(1000).build(new CacheLoader<>() { - @Override - public BlockState load(@NotNull MovecraftLocation movecraftLocation) { - var block = chunk.getBlock(movecraftLocation.getX(), movecraftLocation.getY(), movecraftLocation.getZ()); - return WorldManager.INSTANCE.executeMain(block::getState); - } - }); - - // getHandle needs to be access in the main thread as of 1.19.4 - private final ChunkAccess handle; - - public IAsyncChunk(@NotNull Chunk chunk) { - super(chunk); - handle = this.chunk.getHandle(ChunkStatus.FULL); - } - - @NotNull - @Override - protected CraftChunk adapt(@NotNull org.bukkit.Chunk chunk) { - return (CraftChunk) chunk; - } - - @NotNull - @Override - public BlockState getState(@NotNull MovecraftLocation location) { - return stateCache.getUnchecked(location); - } - - @Override - @NotNull - public Material getType(@NotNull MovecraftLocation location){ - return this.getData(location).getMaterial(); - } - - @Override - @NotNull - public BlockData getData(@NotNull MovecraftLocation location){ - return CraftBlockData.fromData(handle.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ()))); - } -} diff --git a/modules/v1_19/src/main/java/net/countercraft/movecraft/support/v1_19/ISmoothTeleport.java b/modules/v1_19/src/main/java/net/countercraft/movecraft/support/v1_19/ISmoothTeleport.java deleted file mode 100644 index 705b1211c..000000000 --- a/modules/v1_19/src/main/java/net/countercraft/movecraft/support/v1_19/ISmoothTeleport.java +++ /dev/null @@ -1,100 +0,0 @@ -package net.countercraft.movecraft.support.v1_19; - -import net.countercraft.movecraft.SmoothTeleport; -import net.countercraft.movecraft.util.ReflectUtils; -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.jetbrains.annotations.NotNull; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Set; - -/** - * Code derived from code taken with permission from MicleBrick - * https://www.spigotmc.org/threads/teleport-player-smoothly.317416/ - * Used for 1.19.4 - */ -public class ISmoothTeleport extends SmoothTeleport { - private final Set teleportFlags; - - private final Method positionMethod; - private final Method sendMethod; - - private final Constructor vec3Constructor; - private final Constructor packetConstructor; - - private final Field connectionField; - private final Field teleportPosField; - private final Field teleportAwaitField; - private final Field awaitingTeleportTimeField; - private final Field tickCountField; - private final Field yawField; - private final Field pitchField; - - private static @NotNull Class getNmClass(String name) throws ClassNotFoundException { - return Class.forName("net.minecraft." + name); - } - - private void sendPacket(Object packet, Player p) { - try { - Object handle = ReflectUtils.getHandle(p); - Object pConnection = connectionField.get(handle); - sendMethod.invoke(pConnection, packet); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public ISmoothTeleport() throws NoSuchFieldException, NoSuchMethodException, ClassNotFoundException { - Class packetClass = getNmClass("network.protocol.Packet"); - Class positionPacketClass = getNmClass("network.protocol.game.PacketPlayOutPosition"); // ClientboundPlayerPositionPacket - Class entityClass = getNmClass("world.entity.Entity"); - Class playerClass = getNmClass("server.level.EntityPlayer"); // ServerPlayer - Class connectionClass = getNmClass("server.network.PlayerConnection"); // ServerGamePacketListenerImpl - Class vectorClass = getNmClass("world.phys.Vec3D"); // Vec3 - - Object[] flags = getNmClass("world.entity.RelativeMovement").getEnumConstants(); - teleportFlags = Set.of(flags[4], flags[3]); // X_ROT, Y_ROT - - positionMethod = entityClass.getDeclaredMethod("a", Double.TYPE, Double.TYPE, Double.TYPE, Float.TYPE, Float.TYPE); // absMoveTo - sendMethod = connectionClass.getMethod("a", packetClass); // send - - vec3Constructor = vectorClass.getConstructor(Double.TYPE, Double.TYPE, Double.TYPE); - packetConstructor = positionPacketClass.getConstructor(Double.TYPE, Double.TYPE, Double.TYPE, Float.TYPE, Float.TYPE, Set.class, Integer.TYPE); - - connectionField = ReflectUtils.getField(playerClass, "b"); // connection - teleportPosField = ReflectUtils.getField(connectionClass, "D"); // awaitingPositionFromClient - teleportAwaitField = ReflectUtils.getField(connectionClass, "E"); // awaitingTeleport - awaitingTeleportTimeField = ReflectUtils.getField(connectionClass, "F"); // awaitingTeleportTime - tickCountField = ReflectUtils.getField(connectionClass, "j"); // tickCount - yawField = ReflectUtils.getField(entityClass, "aF"); // xRot - pitchField = ReflectUtils.getField(entityClass, "aE"); // yRot - } - - public void teleport(Player player, @NotNull Location location, float yawChange, float pitchChange) { - double x = location.getX(); - double y = location.getY(); - double z = location.getZ(); - Object handle = ReflectUtils.getHandle(player); - try { - positionMethod.invoke(handle, x, y, z, yawField.get(handle), pitchField.get(handle)); - Object connection = connectionField.get(handle); - teleportPosField.set(connection, vec3Constructor.newInstance(x, y, z)); - int teleportAwait = teleportAwaitField.getInt(connection) + 1; - if (teleportAwait == Integer.MAX_VALUE) - teleportAwait = 0; - teleportAwaitField.setInt(connection, teleportAwait); - awaitingTeleportTimeField.set(connection, tickCountField.get(connection)); - - Object packet = packetConstructor.newInstance(x, y, z, yawChange, pitchChange, teleportFlags, teleportAwait); - sendPacket(packet, player); - } - catch (IllegalAccessException | InvocationTargetException | InstantiationException e) { - e.printStackTrace(); - } - } -} diff --git a/modules/v1_20/pom.xml b/modules/v1_20/pom.xml deleted file mode 100644 index bf59a50b7..000000000 --- a/modules/v1_20/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - movecraft-parent - net.countercraft - ${revision} - ../../pom.xml - - 4.0.0 - - movecraft-v1_20 - Movecraft-v1_20 - jar - - - org.spigotmc - spigot - 1.20.6-R0.1-SNAPSHOT - remapped-mojang - provided - - - - net.countercraft - movecraft-api - ${revision} - jar - - - - src/main/java - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - - net/countercraft/movecraft/compat/v1_20/** - net/countercraft/movecraft/support/v1_20/** - - 17 - 17 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - net/countercraft/movecraft/compat/v1_20/** - net/countercraft/movecraft/support/v1_20/** - - - - - net.md-5 - specialsource-maven-plugin - 2.0.3 - - - package - - remap - - remap-obf - - org.spigotmc:minecraft-server:1.20.6-R0.1-SNAPSHOT:txt:maps-mojang - true - org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT:jar:remapped-mojang - true - remapped-obf - - - - package - - remap - - remap-spigot - - ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar - org.spigotmc:minecraft-server:1.20.6-R0.1-SNAPSHOT:csrg:maps-spigot - org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT:jar:remapped-obf - - - - - - - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index c2ed7eb5e..000000000 --- a/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - 4.0.0 - net.countercraft - movecraft-parent - pom - ${revision} - Movecraft Parent Pom - http://github.com/apdevteam/Movecraft - - UTF-8 - 8.0.0_beta-3 - - - - modules/api - modules/v1_18 - modules/v1_19 - modules/v1_20 - modules/datapack - modules/Movecraft - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/groups/public/ - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 17 - 17 - - - - org.codehaus.mojo - flatten-maven-plugin - 1.2.2 - - - - - - flatten - process-resources - - flatten - - - - - flatten.clean - clean - - clean - - - - - - - - - github - GitHub Packages - https://maven.pkg.github.com/apdevteam/movecraft - - - diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..2e45f7fa7 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,15 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +rootProject.name = "movecraft-parent" +include(":movecraft-v1_18") +include(":movecraft-v1_20") +include(":movecraft-api") +include(":movecraft-datapack") +include(":movecraft") +project(":movecraft-v1_18").projectDir = file("v1_18") +project(":movecraft-v1_20").projectDir = file("v1_20") +project(":movecraft-api").projectDir = file("api") +project(":movecraft-datapack").projectDir = file("datapack") +project(":movecraft").projectDir = file("Movecraft") diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 61972d606..000000000 --- a/setup.sh +++ /dev/null @@ -1,52 +0,0 @@ -# Save git information -git_name=$(git config user.name) -git_email=$(git config user.email) - -# Setup Java 11 -if [ -f /usr/lib/jvm/temurin-11-jdk-amd64/bin/java ]; then - echo "Java 11 already installed" -else - sudo apt install -y wget apt-transport-https - wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo tee /usr/share/keyrings/adoptium.asc - echo "deb [signed-by=/usr/share/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list - sudo apt update - sudo apt install -y temurin-11-jdk -fi - -# Setup BuildTools -cd .. -if [ ! -d BuildTools ]; then - mkdir BuildTools -fi -cd BuildTools -if [ -f BuildTools.jar ]; then - echo "BuildTools.jar already exists, skipping download" -else - echo "Downloading BuildTools.jar" - wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -fi - -# Build 1.18.2 -if [ -f ~/.m2/repository/org/spigotmc/spigot/1.18.2-R0.1-SNAPSHOT/spigot-1.18.2-R0.1-SNAPSHOT.jar ]; then - echo "1.18.2 already exists, skipping build" -else - java -jar BuildTools.jar --rev 1.18.2 --remapped -fi - -# Build 1.19.4 -if [ -f ~/.m2/repository/org/spigotmc/spigot/1.19.4-R0.1-SNAPSHOT/spigot-1.19.4-R0.1-SNAPSHOT.jar ]; then - echo "1.19.4 already exists, skipping build" -else - java -jar BuildTools.jar --rev 1.19.4 --remapped -fi - -# Build 1.20.6 -if [ -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT.jar ]; then - echo "1.20.6 already exists, skipping build" -else - java -jar BuildTools.jar --rev 1.20.6 --remapped -fi - -# Restore git information -git config --global user.name "$git_name" -git config --global user.email "$git_email" diff --git a/v1_18/build.gradle.kts b/v1_18/build.gradle.kts new file mode 100644 index 000000000..684c553a1 --- /dev/null +++ b/v1_18/build.gradle.kts @@ -0,0 +1,18 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + id("buildlogic.java-conventions") + id("io.papermc.paperweight.userdev") +} + +java.toolchain.languageVersion = JavaLanguageVersion.of(17) + +dependencies { + api(project(":movecraft-api")) + paperweight.paperDevBundle("1.18.2-R0.1-SNAPSHOT") +} + +description = "Movecraft-v1_18" +paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION diff --git a/modules/v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/IWorldHandler.java b/v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/IWorldHandler.java similarity index 99% rename from modules/v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/IWorldHandler.java rename to v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/IWorldHandler.java index c4923e6ad..577b9f81a 100644 --- a/modules/v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/IWorldHandler.java +++ b/v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/IWorldHandler.java @@ -117,7 +117,7 @@ public void rotateCraft(@NotNull Craft craft, @NotNull MovecraftLocation originP moveBlockEntity(nativeWorld, rotatedPositions.get(tileHolder.getTilePosition()), tileHolder.getTile()); } for (TickHolder tickHolder : ticks) { - final long currentTime = nativeWorld.M.getGameTime(); + final long currentTime = nativeWorld.serverLevelData.getGameTime(); nativeWorld.getBlockTicks().schedule(new ScheduledTick<>((Block) tickHolder.getTick().type(), rotatedPositions.get(tickHolder.getTick().pos()), tickHolder.getTick().triggerTick() - currentTime, tickHolder.getTick().priority(), tickHolder.getTick().subTickOrder())); } diff --git a/modules/v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/NextTickProvider.java b/v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/NextTickProvider.java similarity index 100% rename from modules/v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/NextTickProvider.java rename to v1_18/src/main/java/net/countercraft/movecraft/compat/v1_18/NextTickProvider.java diff --git a/modules/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java b/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java similarity index 96% rename from modules/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java rename to v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java index 8d07b48d5..72d98448c 100644 --- a/modules/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java +++ b/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java @@ -22,7 +22,7 @@ public class IAsyncChunk extends AsyncChunk { @Override public BlockState load(@NotNull MovecraftLocation movecraftLocation) { var block = chunk.getBlock(movecraftLocation.getX(), movecraftLocation.getY(), movecraftLocation.getZ()); - return WorldManager.INSTANCE.executeMain(block::getState); + return WorldManager.INSTANCE.executeMain(() -> block.getState()); } }); diff --git a/modules/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/ISmoothTeleport.java b/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/ISmoothTeleport.java similarity index 100% rename from modules/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/ISmoothTeleport.java rename to v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/ISmoothTeleport.java diff --git a/v1_20/build.gradle.kts b/v1_20/build.gradle.kts new file mode 100644 index 000000000..24e62bc02 --- /dev/null +++ b/v1_20/build.gradle.kts @@ -0,0 +1,18 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + id("buildlogic.java-conventions") + id("io.papermc.paperweight.userdev") +} + +java.toolchain.languageVersion = JavaLanguageVersion.of(21) + +dependencies { + api(project(":movecraft-api")) + paperweight.paperDevBundle("1.20.6-R0.1-SNAPSHOT") +} + +description = "Movecraft-v1_20" +paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION diff --git a/modules/v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/IWorldHandler.java b/v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/IWorldHandler.java similarity index 97% rename from modules/v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/IWorldHandler.java rename to v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/IWorldHandler.java index ed81e86ba..333f73f72 100644 --- a/modules/v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/IWorldHandler.java +++ b/v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/IWorldHandler.java @@ -21,12 +21,11 @@ import net.minecraft.world.level.chunk.LevelChunkSection; import net.minecraft.world.ticks.ScheduledTick; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.block.data.BlockData; -import org.bukkit.craftbukkit.v1_20_R4.CraftWorld; -import org.bukkit.craftbukkit.v1_20_R4.block.data.CraftBlockData; -import org.bukkit.craftbukkit.v1_20_R4.inventory.CraftInventoryView; -import org.bukkit.craftbukkit.v1_20_R4.util.CraftMagicNumbers; +import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.craftbukkit.inventory.CraftInventoryView; +import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.inventory.InventoryView; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -109,7 +108,7 @@ public void rotateCraft(@NotNull Craft craft, @NotNull MovecraftLocation originP moveBlockEntity(nativeWorld, rotatedPositions.get(tileHolder.getTilePosition()), tileHolder.getTile()); if (tileHolder.getNextTick() == null) continue; - final long currentTime = nativeWorld.K.getGameTime(); + final long currentTime = nativeWorld.serverLevelData.getGameTime(); nativeWorld.getBlockTicks().schedule(new ScheduledTick<>((Block) tileHolder.getNextTick().type(), rotatedPositions.get(tileHolder.getNextTick().pos()), tileHolder.getNextTick().triggerTick() - currentTime, tileHolder.getNextTick().priority(), tileHolder.getNextTick().subTickOrder())); } diff --git a/modules/v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/NextTickProvider.java b/v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/NextTickProvider.java similarity index 100% rename from modules/v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/NextTickProvider.java rename to v1_20/src/main/java/net/countercraft/movecraft/compat/v1_20/NextTickProvider.java diff --git a/modules/v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/IAsyncChunk.java b/v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/IAsyncChunk.java similarity index 91% rename from modules/v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/IAsyncChunk.java rename to v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/IAsyncChunk.java index fe47278b2..77b3d0cfa 100644 --- a/modules/v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/IAsyncChunk.java +++ b/v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/IAsyncChunk.java @@ -13,8 +13,8 @@ import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.block.data.BlockData; -import org.bukkit.craftbukkit.v1_20_R4.CraftChunk; -import org.bukkit.craftbukkit.v1_20_R4.block.data.CraftBlockData; +import org.bukkit.craftbukkit.CraftChunk; +import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.jetbrains.annotations.NotNull; @SuppressWarnings("unused") @@ -23,7 +23,7 @@ public class IAsyncChunk extends AsyncChunk { @Override public BlockState load(@NotNull MovecraftLocation movecraftLocation) { var block = chunk.getBlock(movecraftLocation.getX(), movecraftLocation.getY(), movecraftLocation.getZ()); - return WorldManager.INSTANCE.executeMain(block::getState); + return WorldManager.INSTANCE.executeMain(() -> block.getState()); } }); diff --git a/modules/v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/ISmoothTeleport.java b/v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/ISmoothTeleport.java similarity index 100% rename from modules/v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/ISmoothTeleport.java rename to v1_20/src/main/java/net/countercraft/movecraft/support/v1_20/ISmoothTeleport.java