diff --git a/.github/workflows/ci_1.21.1.yml b/.github/workflows/ci_master.yml similarity index 91% rename from .github/workflows/ci_1.21.1.yml rename to .github/workflows/ci_master.yml index faa4d4fa..c8e513bc 100644 --- a/.github/workflows/ci_1.21.1.yml +++ b/.github/workflows/ci_master.yml @@ -14,7 +14,7 @@ permissions: jobs: build: - name: 'Build - 1.21.1' + name: 'Build - 1.21.3' runs-on: ubuntu-latest steps: - name: 'Setup JDK 21 📦' @@ -31,7 +31,7 @@ jobs: env: SNAPSHOTS_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} SNAPSHOTS_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - - name: '[Current - 1.21.1] Build 🛎️' + - name: '[Current - 1.21.3] Build 🛎️' run: | ./gradlew clean build publish - name: 'Publish Test Report 📊' @@ -55,14 +55,14 @@ jobs: version: ${{ env.version_name }} changelog: ${{ github.event.head_commit.message }} distro-names: | - paper-1.21.1 - fabric-1.21.1 + paper-1.21.3 + fabric-1.21.3 distro-groups: | paper fabric distro-descriptions: | - Paper 1.21.1 - Fabric 1.21.1 + Paper 1.21.3 + Fabric 1.21.3 files: | - target/HuskSync-Paper-${{ env.version_name }}+mc.1.21.1.jar - target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.1.jar \ No newline at end of file + target/HuskSync-Paper-${{ env.version_name }}+mc.1.21.3.jar + target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.3.jar \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f384df3..846f3e37 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: uses: gradle/actions/setup-gradle@v4 with: gradle-version: '8.8' - - name: '[Current - 1.21.1] Checkout for CI 🛎️' + - name: '[Current - 1.21.3] Checkout for CI 🛎️' uses: actions/checkout@v4 with: path: '1_21_1' @@ -35,7 +35,7 @@ jobs: env: RELEASES_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} RELEASES_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - - name: '[Current - 1.21.1] Build 🛎️' + - name: '[Current - 1.21.3] Build 🛎️' run: | mkdir target cd 1_21_1 @@ -62,8 +62,8 @@ jobs: version: ${{ github.event.release.tag_name }} changelog: ${{ github.event.release.body }} distro-names: | - paper-1.21.1 - fabric-1.21.1 + paper-1.21.3 + fabric-1.21.3 paper-1.20.1 fabric-1.20.1 distro-groups: | @@ -72,12 +72,12 @@ jobs: paper fabric distro-descriptions: | - Paper 1.21.1 - Fabric 1.21.1 + Paper 1.21.3 + Fabric 1.21.3 Paper 1.20.1 Fabric 1.20.1 files: | - target/HuskSync-Paper-${{ github.event.release.tag_name }}+mc.1.21.1.jar - target/HuskSync-Fabric-${{ github.event.release.tag_name }}+mc.1.21.1.jar + target/HuskSync-Paper-${{ github.event.release.tag_name }}+mc.1.21.3.jar + target/HuskSync-Fabric-${{ github.event.release.tag_name }}+mc.1.21.3.jar target/HuskSync-Paper-${{ github.event.release.tag_name }}+mc.1.20.1.jar target/HuskSync-Fabric-${{ github.event.release.tag_name }}+mc.1.20.1.jar \ No newline at end of file diff --git a/README.md b/README.md index b47e57cd..fefff7cb 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

HuskSync - - + + @@ -46,14 +46,15 @@ ## Compatibility HuskSync supports the following [compatible versions](https://william278.net/docs/husksync/compatibility) of Minecraft. Since v3.7, you must download the correct version of HuskSync for your server: -| Minecraft | Latest HuskSync | Java Version | Platforms | Support Ends | -|:---------------:|:---------------:|:------------:|:--------------|:--------------------------| -| 1.21.1 | _latest_ | 21 | Paper, Fabric | ✅ **Active Release** | -| 1.20.6 | 3.6.8 | 17 | Paper | ❌ _October 2024_ | -| 1.20.4 | 3.6.8 | 17 | Paper | ❌ _July 2024_ | -| 1.20.1 | _latest_ | 17 | Paper, Fabric | ✅ **November 2025** (LTS) | -| 1.17.1 - 1.19.4 | 3.6.8 | 17 | Paper | ❌ _Support ended_ | -| 1.16.5 | 3.2.1 | 16 | Paper | ❌ _Support ended_ | +| Minecraft | Latest HuskSync | Java Version | Platforms | Support Ends | +|:---------------:|:---------------:|:------------:|:--------------|:------------------------------| +| 1.21.3 | _latest_ | 21 | Paper, Fabric | ✅ **Active Release** | +| 1.21.1 | _latest_ | 21 | Paper, Fabric | ✅ **December 2024** (Non-LTS) | +| 1.20.6 | 3.6.8 | 17 | Paper | ❌ _October 2024_ | +| 1.20.4 | 3.6.8 | 17 | Paper | ❌ _July 2024_ | +| 1.20.1 | _latest_ | 17 | Paper, Fabric | ✅ **November 2025** (LTS) | +| 1.17.1 - 1.19.4 | 3.6.8 | 17 | Paper | ❌ _Support ended_ | +| 1.16.5 | 3.2.1 | 16 | Paper | ❌ _Support ended_ | HuskSync is primarily developed against the latest release. Old Minecraft versions are allocated a support channel based on popularity, mod support, etc: diff --git a/bukkit/src/main/java/net/william278/husksync/data/BukkitSerializer.java b/bukkit/src/main/java/net/william278/husksync/data/BukkitSerializer.java index 7f900165..c72448be 100644 --- a/bukkit/src/main/java/net/william278/husksync/data/BukkitSerializer.java +++ b/bukkit/src/main/java/net/william278/husksync/data/BukkitSerializer.java @@ -165,7 +165,8 @@ private int getDataVersion(@NotNull Version mcVersion) { case "1.20", "1.20.1", "1.20.2" -> DataFixerUtil.VERSION1_20_2; case "1.20.3", "1.20.4" -> DataFixerUtil.VERSION1_20_4; case "1.20.5", "1.20.6" -> DataFixerUtil.VERSION1_20_5; - case "1.21" -> DataFixerUtil.VERSION1_21; + case "1.21", "1.21.1" -> DataFixerUtil.VERSION1_21; + case "1.21.2", "1.21.3" -> DataFixerUtil.VERSION1_21_2; default -> DataFixerUtil.getCurrentVersion(); }; } diff --git a/docs/Compatibility.md b/docs/Compatibility.md index 30bde4d2..74fe7128 100644 --- a/docs/Compatibility.md +++ b/docs/Compatibility.md @@ -1,13 +1,14 @@ HuskSync supports the following versions of Minecraft. Since v3.7, you must download the correct version of HuskSync for your server: -| Minecraft | Latest HuskSync | Java Version | Platforms | Support Ends | -|:---------------:|:---------------:|:------------:|:--------------|:--------------------------| -| 1.21.1 | _latest_ | 21 | Paper, Fabric | ✅ **Active Release** | -| 1.20.6 | 3.6.8 | 17 | Paper | ❌ _October 2024_ | -| 1.20.4 | 3.6.8 | 17 | Paper | ❌ _July 2024_ | -| 1.20.1 | _latest_ | 17 | Paper, Fabric | ✅ **November 2025** (LTS) | -| 1.17.1 - 1.19.4 | 3.6.8 | 17 | Paper | ❌ _Support ended_ | -| 1.16.5 | 3.2.1 | 16 | Paper | ❌ _Support ended_ | +| Minecraft | Latest HuskSync | Java Version | Platforms | Support Ends | +|:---------------:|:---------------:|:------------:|:--------------|:------------------------------| +| 1.21.3 | _latest_ | 21 | Paper, Fabric | ✅ **Active Release** | +| 1.21.1 | _latest_ | 21 | Paper, Fabric | ✅ **December 2024** (Non-LTS) | +| 1.20.6 | 3.6.8 | 17 | Paper | ❌ _October 2024_ | +| 1.20.4 | 3.6.8 | 17 | Paper | ❌ _July 2024_ | +| 1.20.1 | _latest_ | 17 | Paper, Fabric | ✅ **November 2025** (LTS) | +| 1.17.1 - 1.19.4 | 3.6.8 | 17 | Paper | ❌ _Support ended_ | +| 1.16.5 | 3.2.1 | 16 | Paper | ❌ _Support ended_ | HuskSync is primarily developed against the latest release. Old Minecraft versions are allocated a support channel based on popularity, mod support, etc: diff --git a/fabric/src/main/java/net/william278/husksync/data/FabricData.java b/fabric/src/main/java/net/william278/husksync/data/FabricData.java index afff670f..2ecdc08d 100644 --- a/fabric/src/main/java/net/william278/husksync/data/FabricData.java +++ b/fabric/src/main/java/net/william278/husksync/data/FabricData.java @@ -49,6 +49,7 @@ import net.william278.husksync.HuskSync; import net.william278.husksync.adapter.Adaptable; import net.william278.husksync.config.Settings.SynchronizationSettings.AttributeSettings; +import net.william278.husksync.mixins.HungerManagerMixin; import net.william278.husksync.user.FabricUser; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -693,8 +694,7 @@ public static class Hunger extends FabricData implements Data.Hunger, Adaptable @NotNull public static FabricData.Hunger adapt(@NotNull ServerPlayerEntity player) { final HungerManager hunger = player.getHungerManager(); - // todo mixin for hunger - return from(hunger.getFoodLevel(), hunger.getSaturationLevel(), hunger.getExhaustion()); + return from(hunger.getFoodLevel(), hunger.getSaturationLevel(), ((HungerManagerMixin) hunger).getExhaustion()); } @NotNull @@ -708,7 +708,7 @@ public void apply(@NotNull FabricUser user, @NotNull FabricHuskSync plugin) thro final HungerManager hunger = player.getHungerManager(); hunger.setFoodLevel(foodLevel); hunger.setSaturationLevel(saturation); - hunger.setExhaustion(exhaustion); + ((HungerManagerMixin) hunger).setExhaustion(exhaustion); } } diff --git a/fabric/src/main/java/net/william278/husksync/data/FabricSerializer.java b/fabric/src/main/java/net/william278/husksync/data/FabricSerializer.java index 3be5b416..b62fcdf4 100644 --- a/fabric/src/main/java/net/william278/husksync/data/FabricSerializer.java +++ b/fabric/src/main/java/net/william278/husksync/data/FabricSerializer.java @@ -148,10 +148,11 @@ private interface ItemDeserializer { int VERSION1_19_2 = 3120; int VERSION1_19_4 = 3337; int VERSION1_20_1 = 3465; - int VERSION1_20_2 = 3578; // Future - int VERSION1_20_4 = 3700; // Future - int VERSION1_20_5 = 3837; // Future - int VERSION1_21 = 3953; // Future + int VERSION1_20_2 = 3578; + int VERSION1_20_4 = 3700; + int VERSION1_20_5 = 3837; + int VERSION1_21_1 = 3955; + int VERSION1_21_3 = 4082; // Current @NotNull default ItemStack[] getItems(@NotNull NbtCompound tag, @NotNull Version mcVersion, @NotNull FabricHuskSync plugin) { @@ -186,7 +187,7 @@ default NbtCompound serializeItemArray(@Nullable ItemStack @NotNull [] items, @N if (item == null || item.isEmpty()) { continue; } - NbtCompound entry = (NbtCompound) item.encode(registryManager); + NbtCompound entry = (NbtCompound) item.toNbt(registryManager); entry.putInt("Slot", i); itemList.add(entry); } @@ -213,7 +214,6 @@ default NbtCompound serializeItemArray(@Nullable ItemStack @NotNull [] items, @N return itemStacks; } - @NotNull @SuppressWarnings({"rawtypes", "unchecked"}) // For NBTOps lookup private NbtCompound upgradeItemData(@NotNull NbtCompound tag, @NotNull Version mcVersion, @@ -232,11 +232,12 @@ private int getDataVersion(@NotNull Version mcVersion) { case "1.19", "1.19.1", "1.19.2" -> VERSION1_19_2; case "1.19.4" -> VERSION1_19_4; case "1.20", "1.20.1" -> VERSION1_20_1; - case "1.20.2" -> VERSION1_20_2; // Future - case "1.20.4" -> VERSION1_20_4; // Future - case "1.20.5", "1.20.6" -> VERSION1_20_5; // Future - case "1.21" -> VERSION1_21; // Future - default -> VERSION1_20_1; // Current supported ver + case "1.20.2" -> VERSION1_20_2; + case "1.20.4" -> VERSION1_20_4; + case "1.20.5", "1.20.6" -> VERSION1_20_5; + case "1.21", "1.21.1" -> VERSION1_21_1; + case "1.21.2", "1.21.3" -> VERSION1_21_3; + default -> VERSION1_21_3; // Current supported ver }; } diff --git a/fabric/src/main/java/net/william278/husksync/listener/FabricEventListener.java b/fabric/src/main/java/net/william278/husksync/listener/FabricEventListener.java index 19db870e..4728f413 100644 --- a/fabric/src/main/java/net/william278/husksync/listener/FabricEventListener.java +++ b/fabric/src/main/java/net/william278/husksync/listener/FabricEventListener.java @@ -124,7 +124,6 @@ private ActionResult handleEntityInteract(PlayerEntity player, World world, Hand } private ActionResult handleItemInteract(PlayerEntity player, World world, Hand hand) { - ItemStack stackInHand = player.getStackInHand(hand); return (cancelPlayerEvent(player.getUuid())) ? ActionResult.FAIL : ActionResult.PASS; } diff --git a/fabric/src/main/java/net/william278/husksync/mixins/HungerManagerMixin.java b/fabric/src/main/java/net/william278/husksync/mixins/HungerManagerMixin.java index f2b103f1..b028f0fc 100644 --- a/fabric/src/main/java/net/william278/husksync/mixins/HungerManagerMixin.java +++ b/fabric/src/main/java/net/william278/husksync/mixins/HungerManagerMixin.java @@ -1,24 +1,35 @@ +/* + * This file is part of HuskSync, licensed under the Apache License 2.0. + * + * Copyright (c) William278 + * Copyright (c) contributors + * + * 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 + * + * http://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. + */ + package net.william278.husksync.mixins; import net.minecraft.entity.player.HungerManager; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(HungerManager.class) -public class HungerManagerMixin { - - @Shadow - private float exhaustion; +public interface HungerManagerMixin { - @Accessor("exhaustion") - public void setExhaustion(float exhaustion) { - this.exhaustion = exhaustion; - } + @Accessor + float getExhaustion(); @Accessor("exhaustion") - public float getExhaustion() { - return exhaustion; - } + void setExhaustion(float exhaustion); } diff --git a/fabric/src/main/resources/husksync.mixins.json b/fabric/src/main/resources/husksync.mixins.json index fe97735d..f01be722 100644 --- a/fabric/src/main/resources/husksync.mixins.json +++ b/fabric/src/main/resources/husksync.mixins.json @@ -4,12 +4,12 @@ "package": "net.william278.husksync.mixins", "compatibilityLevel": "JAVA_17", "server": [ + "HungerManagerMixin", "ItemEntityMixin", "PlayerEntityMixin", "ServerPlayerEntityMixin", "ServerPlayNetworkHandlerMixin", - "ServerWorldMixin", - "HungerManagerMixin" + "ServerWorldMixin" ], "client": [], "injectors": { diff --git a/gradle.properties b/gradle.properties index e5fc2dbb..2fb9eb60 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,8 +18,8 @@ mongodb_driver_version=5.1.2 snappy_version=1.1.10.6 # Spigot/Paper build settings -bukkit_spigot_api=1.21.1-R0.1-SNAPSHOT -bukkit_paper_api=1.21.1-R0.1-SNAPSHOT +bukkit_spigot_api=1.21.3-R0.1-SNAPSHOT +bukkit_paper_api=1.21.3-R0.1-SNAPSHOT # Fabric build settings fabric_loom_version=1.8-SNAPSHOT diff --git a/paper/build.gradle b/paper/build.gradle index 9a9146b6..d5b989e2 100644 --- a/paper/build.gradle +++ b/paper/build.gradle @@ -49,6 +49,6 @@ shadowJar { tasks { runServer { - minecraftVersion('1.21.1') + minecraftVersion('1.21.3') } } \ No newline at end of file diff --git a/test/spin_network.py b/test/spin_network.py index 3c75d92c..e68aa9d8 100644 --- a/test/spin_network.py +++ b/test/spin_network.py @@ -13,7 +13,7 @@ class Parameters: root_dir = './servers/' proxy_version = "1.21" - minecraft_version = '1.21.1' + minecraft_version = '1.21.3' eula_agreement = 'true' backend_names = ['alpha', 'beta']