From c7ad681a76a49234c6631af5e6d7cb7a08a1cadf Mon Sep 17 00:00:00 2001 From: Kazuk <46299532+Kazzuk@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:46:35 +0100 Subject: [PATCH] Fix shadowJar task to include API --- .github/workflows/gradle.yml | 6 ++++-- server/build.gradle.kts | 6 ++++-- .../java/org/cloudburstmc/server/block/BlockPalette.java | 4 +++- .../main/java/org/cloudburstmc/server/item/ItemPalette.java | 4 +++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index dd48f73eb..06a2ec4f5 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,10 +1,12 @@ name: Java CI -on: [push, pull_request] +on: [ push, pull_request ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: recursive - name: Set up JDK 17 uses: actions/setup-java@v4 with: @@ -13,7 +15,7 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - name: Build with Gradle Wrapper - run: ./gradlew shadowJar -x test --no-daemon + run: ./gradlew shadowJar - name: Upload artifacts uses: actions/upload-artifact@v4 with: diff --git a/server/build.gradle.kts b/server/build.gradle.kts index d5bfb5ad4..76fdd0460 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -56,7 +56,6 @@ extraJavaModuleInfo { automaticModule("net.jodah:expiringmap", "net.jodah.expiringmap") } - tasks.shadowJar { archiveBaseName.set("Cloudburst") archiveVersion.set("") @@ -67,4 +66,7 @@ tasks.shadowJar { } transform(Log4j2PluginsCacheFileTransformer()) mergeServiceFiles() -} \ No newline at end of file + + dependsOn(":api:classes") + from(project(":api").sourceSets.main.get().output) +} diff --git a/server/src/main/java/org/cloudburstmc/server/block/BlockPalette.java b/server/src/main/java/org/cloudburstmc/server/block/BlockPalette.java index cb876bd3b..f3b6285c9 100644 --- a/server/src/main/java/org/cloudburstmc/server/block/BlockPalette.java +++ b/server/src/main/java/org/cloudburstmc/server/block/BlockPalette.java @@ -133,7 +133,9 @@ public void generateRuntimeIds() { for (int i = 0; i < vanillaPalette.size(); i++) { NbtMapBuilder builder = vanillaPalette.get(i).toBuilder(); - builder.remove("name_hash"); // Temporary workaround - Added in 1.19.20 + builder.remove("name_hash"); // Added in 1.19.20 + builder.remove("network_id"); // Added in 1.19.80 + builder.remove("block_id"); // Added in 1.20.60 NbtMap nbt = builder.build(); BlockState state = serializedStateMap.get(nbt); diff --git a/server/src/main/java/org/cloudburstmc/server/item/ItemPalette.java b/server/src/main/java/org/cloudburstmc/server/item/ItemPalette.java index 26fbfbab1..202f2cd2f 100644 --- a/server/src/main/java/org/cloudburstmc/server/item/ItemPalette.java +++ b/server/src/main/java/org/cloudburstmc/server/item/ItemPalette.java @@ -192,7 +192,9 @@ public void registerVanillaCreativeItems() { if (item.has("block_state_b64")) { NbtMap blockState = decodeNbt(item.get("block_state_b64").asText()); NbtMapBuilder builder = blockState.toBuilder(); - builder.remove("name_hash"); + builder.remove("name_hash"); // Added in 1.19.20 + builder.remove("network_id"); // Added in 1.19.80 + builder.remove("block_id"); // Added in 1.20.60 blockState = builder.build(); BlockState state = CloudBlockRegistry.REGISTRY.getBlock(blockState);