diff --git a/.github/scripts/buildtools.sh b/.github/scripts/buildtools.sh deleted file mode 100644 index 8e89577..0000000 --- a/.github/scripts/buildtools.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -buildtools_dir=~/buildtools -buildtools=$buildtools_dir/BuildTools.jar -spigot_regex='version\("spigot", "([0-9.]*)' - -while read line -do - if [[ $line =~ $spigot_regex ]] - then - spigot_version=${BASH_REMATCH[1]} - fi -done < ./settings.gradle.kts - -set -e -echo "Installing Spigot: $spigot_version" - -if ! [[ -d $buildtools_dir && -f $buildtools ]]; then - mkdir $buildtools_dir - wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -O $buildtools -fi - -java -jar $buildtools --rev "$spigot_version" --remapped \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 156e655..00d3b85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,22 +12,30 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set Up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: 17 distribution: adopt - - name: Run BuildTools - run: . .github/scripts/buildtools.sh - - name: Setup Gradle uses: gradle/gradle-build-action@v2 + with: + cache-disabled: true - name: Build Spigot-Mapped - run: ./gradlew clean addonJar "-DoutDir=artifacts/" + uses: gradle/gradle-build-action@v2 + with: + arguments: | + addonJar + -PoutDir=artifacts + -PxenondevsNms + --scan + env: + ORG_GRADLE_PROJECT_xenondevsNmsUsername: ${{ secrets.XENONDEVS_NMS_USERNAME }} + ORG_GRADLE_PROJECT_xenondevsNmsPassword: ${{ secrets.XENONDEVS_NMS_PASSWORD }} - name: Upload Artifacts id: upload @@ -36,10 +44,10 @@ jobs: name: Artifacts path: ./artifacts/*.jar - - name: Publish Artifacts + - name: Attach Artifacts to Release if: github.event_name == 'release' uses: skx/github-action-publish-binaries@release-2.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - args: ./artifacts/*.jar + args: ./artifacts/*.jar \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index c28e295..c468262 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile group = "xyz.xenondevs" -version = "1.1" +version = "1.2-RC.1" val mojangMapped = project.hasProperty("mojang-mapped") @@ -13,9 +13,19 @@ plugins { } repositories { + mavenLocal() mavenCentral() maven("https://repo.xenondevs.xyz/releases") - mavenLocal { content { includeGroup("org.spigotmc") } } + + // include xenondevs-nms repository if requested + if (project.hasProperty("xenondevsNms")) { + maven("https://repo.papermc.io/repository/maven-public/") // authlib, brigadier, etc. + maven { + name = "xenondevsNms" + url = uri("https://repo.xenondevs.xyz/nms/") + credentials(PasswordCredentials::class) + } + } } dependencies { @@ -30,7 +40,6 @@ addon { main.set("xyz.xenondevs.vanillahammers.VanillaHammers") authors.add("StudioCode") - // TODO: spigot resource id } spigotRemap { diff --git a/settings.gradle.kts b/settings.gradle.kts index f2c680f..e7aac8d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,8 +3,8 @@ rootProject.name = "vanilla_hammers" dependencyResolutionManagement { versionCatalogs { create("libs") { - version("nova", "0.13") - version("spigot", "1.19.4-R0.1-SNAPSHOT") + version("nova", "0.14-alpha.1") + version("spigot", "1.20-R0.1-SNAPSHOT") version("kotlin", "1.8.20") plugin("kotlin", "org.jetbrains.kotlin.jvm").versionRef("kotlin") @@ -19,8 +19,21 @@ dependencyResolutionManagement { pluginManagement { repositories { + mavenLocal() mavenCentral() + gradlePluginPortal() maven("https://repo.xenondevs.xyz/releases") - mavenLocal { content { includeGroup("org.spigotmc") } } + maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") // for nova-gradle-plugin + } +} + +plugins { + id("com.gradle.enterprise") version "3.13" +} + +gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" } } \ No newline at end of file diff --git a/src/main/kotlin/xyz/xenondevs/vanillahammers/VanillaHammers.kt b/src/main/kotlin/xyz/xenondevs/vanillahammers/VanillaHammers.kt index bd33a9b..c78bd46 100644 --- a/src/main/kotlin/xyz/xenondevs/vanillahammers/VanillaHammers.kt +++ b/src/main/kotlin/xyz/xenondevs/vanillahammers/VanillaHammers.kt @@ -1,8 +1,13 @@ package xyz.xenondevs.vanillahammers import xyz.xenondevs.nova.addon.Addon +import xyz.xenondevs.nova.update.ProjectDistributor import xyz.xenondevs.vanillahammers.advancement.Advancements import xyz.xenondevs.vanillahammers.registry.Items import xyz.xenondevs.vanillahammers.registry.ToolTiers -object VanillaHammers : Addon() \ No newline at end of file +object VanillaHammers : Addon() { + + override val projectDistributors = listOf(ProjectDistributor.hangar("xenondevs/Vanilla-Hammers")) + +} \ No newline at end of file diff --git a/src/main/resources/recipes/minecraft/smithing/netherite_hammer.json b/src/main/resources/recipes/minecraft/smithing_transform/netherite_hammer.json similarity index 68% rename from src/main/resources/recipes/minecraft/smithing/netherite_hammer.json rename to src/main/resources/recipes/minecraft/smithing_transform/netherite_hammer.json index 1f06d9e..dc6863f 100644 --- a/src/main/resources/recipes/minecraft/smithing/netherite_hammer.json +++ b/src/main/resources/recipes/minecraft/smithing_transform/netherite_hammer.json @@ -1,4 +1,5 @@ { + "template": "minecraft:netherite_upgrade_smithing_template", "base": "vanilla_hammers:diamond_hammer", "addition": "minecraft:netherite_ingot", "result": "vanilla_hammers:netherite_hammer"