9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-19 14:59:21 +00:00

build: target Minecraft 1.21.3

This commit is contained in:
William
2024-10-31 23:52:09 +00:00
parent c942a015d1
commit eda8e72633
13 changed files with 82 additions and 68 deletions

View File

@@ -14,7 +14,7 @@ permissions:
jobs: jobs:
build: build:
name: 'Build - 1.21.1' name: 'Build - 1.21.3'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: 'Setup JDK 21 📦' - name: 'Setup JDK 21 📦'
@@ -31,7 +31,7 @@ jobs:
env: env:
SNAPSHOTS_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} SNAPSHOTS_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
SNAPSHOTS_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} SNAPSHOTS_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: '[Current - 1.21.1] Build 🛎️' - name: '[Current - 1.21.3] Build 🛎️'
run: | run: |
./gradlew clean build publish ./gradlew clean build publish
- name: 'Publish Test Report 📊' - name: 'Publish Test Report 📊'
@@ -55,14 +55,14 @@ jobs:
version: ${{ env.version_name }} version: ${{ env.version_name }}
changelog: ${{ github.event.head_commit.message }} changelog: ${{ github.event.head_commit.message }}
distro-names: | distro-names: |
paper-1.21.1 paper-1.21.3
fabric-1.21.1 fabric-1.21.3
distro-groups: | distro-groups: |
paper paper
fabric fabric
distro-descriptions: | distro-descriptions: |
Paper 1.21.1 Paper 1.21.3
Fabric 1.21.1 Fabric 1.21.3
files: | files: |
target/HuskSync-Paper-${{ env.version_name }}+mc.1.21.1.jar target/HuskSync-Paper-${{ env.version_name }}+mc.1.21.3.jar
target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.1.jar target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.3.jar

View File

@@ -23,7 +23,7 @@ jobs:
uses: gradle/actions/setup-gradle@v4 uses: gradle/actions/setup-gradle@v4
with: with:
gradle-version: '8.8' gradle-version: '8.8'
- name: '[Current - 1.21.1] Checkout for CI 🛎️' - name: '[Current - 1.21.3] Checkout for CI 🛎️'
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
path: '1_21_1' path: '1_21_1'
@@ -35,7 +35,7 @@ jobs:
env: env:
RELEASES_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} RELEASES_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
RELEASES_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} RELEASES_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: '[Current - 1.21.1] Build 🛎️' - name: '[Current - 1.21.3] Build 🛎️'
run: | run: |
mkdir target mkdir target
cd 1_21_1 cd 1_21_1
@@ -62,8 +62,8 @@ jobs:
version: ${{ github.event.release.tag_name }} version: ${{ github.event.release.tag_name }}
changelog: ${{ github.event.release.body }} changelog: ${{ github.event.release.body }}
distro-names: | distro-names: |
paper-1.21.1 paper-1.21.3
fabric-1.21.1 fabric-1.21.3
paper-1.20.1 paper-1.20.1
fabric-1.20.1 fabric-1.20.1
distro-groups: | distro-groups: |
@@ -72,12 +72,12 @@ jobs:
paper paper
fabric fabric
distro-descriptions: | distro-descriptions: |
Paper 1.21.1 Paper 1.21.3
Fabric 1.21.1 Fabric 1.21.3
Paper 1.20.1 Paper 1.20.1
Fabric 1.20.1 Fabric 1.20.1
files: | files: |
target/HuskSync-Paper-${{ 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.1.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-Paper-${{ github.event.release.tag_name }}+mc.1.20.1.jar
target/HuskSync-Fabric-${{ github.event.release.tag_name }}+mc.1.20.1.jar target/HuskSync-Fabric-${{ github.event.release.tag_name }}+mc.1.20.1.jar

View File

@@ -1,8 +1,8 @@
<!--suppress ALL --> <!--suppress ALL -->
<p align="center"> <p align="center">
<img src="images/banner.png" alt="HuskSync" /> <img src="images/banner.png" alt="HuskSync" />
<a href="https://github.com/WiIIiam278/HuskSync/actions/workflows/ci_1.21.1.yml"> <a href="https://github.com/WiIIiam278/HuskSync/actions/workflows/ci_master.yml">
<img src="https://img.shields.io/github/actions/workflow/status/WiIIiam278/HuskSync/ci_1.21.1.yml?branch=master&logo=github"/> <img src="https://img.shields.io/github/actions/workflow/status/WiIIiam278/HuskSync/ci_master.yml?branch=master&logo=github"/>
</a> </a>
<a href="https://repo.william278.net/#/releases/net/william278/husksync/"> <a href="https://repo.william278.net/#/releases/net/william278/husksync/">
<img src="https://repo.william278.net/api/badge/latest/releases/net/william278/husksync/husksync-common?color=00fb9a&name=Maven&prefix=v" /> <img src="https://repo.william278.net/api/badge/latest/releases/net/william278/husksync/husksync-common?color=00fb9a&name=Maven&prefix=v" />
@@ -47,8 +47,9 @@
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: 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 | | Minecraft | Latest HuskSync | Java Version | Platforms | Support Ends |
|:---------------:|:---------------:|:------------:|:--------------|:--------------------------| |:---------------:|:---------------:|:------------:|:--------------|:------------------------------|
| 1.21.1 | _latest_ | 21 | Paper, Fabric | ✅ **Active Release** | | 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.6 | 3.6.8 | 17 | Paper | ❌ _October 2024_ |
| 1.20.4 | 3.6.8 | 17 | Paper | ❌ _July 2024_ | | 1.20.4 | 3.6.8 | 17 | Paper | ❌ _July 2024_ |
| 1.20.1 | _latest_ | 17 | Paper, Fabric | ✅ **November 2025** (LTS) | | 1.20.1 | _latest_ | 17 | Paper, Fabric | ✅ **November 2025** (LTS) |

View File

@@ -165,7 +165,8 @@ public class BukkitSerializer {
case "1.20", "1.20.1", "1.20.2" -> DataFixerUtil.VERSION1_20_2; 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.3", "1.20.4" -> DataFixerUtil.VERSION1_20_4;
case "1.20.5", "1.20.6" -> DataFixerUtil.VERSION1_20_5; 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(); default -> DataFixerUtil.getCurrentVersion();
}; };
} }

View File

@@ -1,8 +1,9 @@
HuskSync supports the following versions of Minecraft. Since v3.7, you must download the correct version of HuskSync for your server: 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 | | Minecraft | Latest HuskSync | Java Version | Platforms | Support Ends |
|:---------------:|:---------------:|:------------:|:--------------|:--------------------------| |:---------------:|:---------------:|:------------:|:--------------|:------------------------------|
| 1.21.1 | _latest_ | 21 | Paper, Fabric | ✅ **Active Release** | | 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.6 | 3.6.8 | 17 | Paper | ❌ _October 2024_ |
| 1.20.4 | 3.6.8 | 17 | Paper | ❌ _July 2024_ | | 1.20.4 | 3.6.8 | 17 | Paper | ❌ _July 2024_ |
| 1.20.1 | _latest_ | 17 | Paper, Fabric | ✅ **November 2025** (LTS) | | 1.20.1 | _latest_ | 17 | Paper, Fabric | ✅ **November 2025** (LTS) |

View File

@@ -49,6 +49,7 @@ import net.william278.husksync.FabricHuskSync;
import net.william278.husksync.HuskSync; import net.william278.husksync.HuskSync;
import net.william278.husksync.adapter.Adaptable; import net.william278.husksync.adapter.Adaptable;
import net.william278.husksync.config.Settings.SynchronizationSettings.AttributeSettings; import net.william278.husksync.config.Settings.SynchronizationSettings.AttributeSettings;
import net.william278.husksync.mixins.HungerManagerMixin;
import net.william278.husksync.user.FabricUser; import net.william278.husksync.user.FabricUser;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@@ -693,8 +694,7 @@ public abstract class FabricData implements Data {
@NotNull @NotNull
public static FabricData.Hunger adapt(@NotNull ServerPlayerEntity player) { public static FabricData.Hunger adapt(@NotNull ServerPlayerEntity player) {
final HungerManager hunger = player.getHungerManager(); final HungerManager hunger = player.getHungerManager();
// todo mixin for hunger return from(hunger.getFoodLevel(), hunger.getSaturationLevel(), ((HungerManagerMixin) hunger).getExhaustion());
return from(hunger.getFoodLevel(), hunger.getSaturationLevel(), hunger.getExhaustion());
} }
@NotNull @NotNull
@@ -708,7 +708,7 @@ public abstract class FabricData implements Data {
final HungerManager hunger = player.getHungerManager(); final HungerManager hunger = player.getHungerManager();
hunger.setFoodLevel(foodLevel); hunger.setFoodLevel(foodLevel);
hunger.setSaturationLevel(saturation); hunger.setSaturationLevel(saturation);
hunger.setExhaustion(exhaustion); ((HungerManagerMixin) hunger).setExhaustion(exhaustion);
} }
} }

View File

@@ -148,10 +148,11 @@ public abstract class FabricSerializer {
int VERSION1_19_2 = 3120; int VERSION1_19_2 = 3120;
int VERSION1_19_4 = 3337; int VERSION1_19_4 = 3337;
int VERSION1_20_1 = 3465; int VERSION1_20_1 = 3465;
int VERSION1_20_2 = 3578; // Future int VERSION1_20_2 = 3578;
int VERSION1_20_4 = 3700; // Future int VERSION1_20_4 = 3700;
int VERSION1_20_5 = 3837; // Future int VERSION1_20_5 = 3837;
int VERSION1_21 = 3953; // Future int VERSION1_21_1 = 3955;
int VERSION1_21_3 = 4082; // Current
@NotNull @NotNull
default ItemStack[] getItems(@NotNull NbtCompound tag, @NotNull Version mcVersion, @NotNull FabricHuskSync plugin) { default ItemStack[] getItems(@NotNull NbtCompound tag, @NotNull Version mcVersion, @NotNull FabricHuskSync plugin) {
@@ -186,7 +187,7 @@ public abstract class FabricSerializer {
if (item == null || item.isEmpty()) { if (item == null || item.isEmpty()) {
continue; continue;
} }
NbtCompound entry = (NbtCompound) item.encode(registryManager); NbtCompound entry = (NbtCompound) item.toNbt(registryManager);
entry.putInt("Slot", i); entry.putInt("Slot", i);
itemList.add(entry); itemList.add(entry);
} }
@@ -213,7 +214,6 @@ public abstract class FabricSerializer {
return itemStacks; return itemStacks;
} }
@NotNull @NotNull
@SuppressWarnings({"rawtypes", "unchecked"}) // For NBTOps lookup @SuppressWarnings({"rawtypes", "unchecked"}) // For NBTOps lookup
private NbtCompound upgradeItemData(@NotNull NbtCompound tag, @NotNull Version mcVersion, private NbtCompound upgradeItemData(@NotNull NbtCompound tag, @NotNull Version mcVersion,
@@ -232,11 +232,12 @@ public abstract class FabricSerializer {
case "1.19", "1.19.1", "1.19.2" -> VERSION1_19_2; case "1.19", "1.19.1", "1.19.2" -> VERSION1_19_2;
case "1.19.4" -> VERSION1_19_4; case "1.19.4" -> VERSION1_19_4;
case "1.20", "1.20.1" -> VERSION1_20_1; case "1.20", "1.20.1" -> VERSION1_20_1;
case "1.20.2" -> VERSION1_20_2; // Future case "1.20.2" -> VERSION1_20_2;
case "1.20.4" -> VERSION1_20_4; // Future case "1.20.4" -> VERSION1_20_4;
case "1.20.5", "1.20.6" -> VERSION1_20_5; // Future case "1.20.5", "1.20.6" -> VERSION1_20_5;
case "1.21" -> VERSION1_21; // Future case "1.21", "1.21.1" -> VERSION1_21_1;
default -> VERSION1_20_1; // Current supported ver case "1.21.2", "1.21.3" -> VERSION1_21_3;
default -> VERSION1_21_3; // Current supported ver
}; };
} }

View File

@@ -124,7 +124,6 @@ public class FabricEventListener extends EventListener implements LockedHandler
} }
private ActionResult handleItemInteract(PlayerEntity player, World world, Hand hand) { private ActionResult handleItemInteract(PlayerEntity player, World world, Hand hand) {
ItemStack stackInHand = player.getStackInHand(hand);
return (cancelPlayerEvent(player.getUuid())) ? ActionResult.FAIL : ActionResult.PASS; return (cancelPlayerEvent(player.getUuid())) ? ActionResult.FAIL : ActionResult.PASS;
} }

View File

@@ -1,24 +1,35 @@
/*
* This file is part of HuskSync, licensed under the Apache License 2.0.
*
* Copyright (c) William278 <will27528@gmail.com>
* 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; package net.william278.husksync.mixins;
import net.minecraft.entity.player.HungerManager; import net.minecraft.entity.player.HungerManager;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(HungerManager.class) @Mixin(HungerManager.class)
public class HungerManagerMixin { public interface HungerManagerMixin {
@Shadow @Accessor
private float exhaustion; float getExhaustion();
@Accessor("exhaustion") @Accessor("exhaustion")
public void setExhaustion(float exhaustion) { void setExhaustion(float exhaustion);
this.exhaustion = exhaustion;
}
@Accessor("exhaustion")
public float getExhaustion() {
return exhaustion;
}
} }

View File

@@ -4,12 +4,12 @@
"package": "net.william278.husksync.mixins", "package": "net.william278.husksync.mixins",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"server": [ "server": [
"HungerManagerMixin",
"ItemEntityMixin", "ItemEntityMixin",
"PlayerEntityMixin", "PlayerEntityMixin",
"ServerPlayerEntityMixin", "ServerPlayerEntityMixin",
"ServerPlayNetworkHandlerMixin", "ServerPlayNetworkHandlerMixin",
"ServerWorldMixin", "ServerWorldMixin"
"HungerManagerMixin"
], ],
"client": [], "client": [],
"injectors": { "injectors": {

View File

@@ -18,8 +18,8 @@ mongodb_driver_version=5.1.2
snappy_version=1.1.10.6 snappy_version=1.1.10.6
# Spigot/Paper build settings # Spigot/Paper build settings
bukkit_spigot_api=1.21.1-R0.1-SNAPSHOT bukkit_spigot_api=1.21.3-R0.1-SNAPSHOT
bukkit_paper_api=1.21.1-R0.1-SNAPSHOT bukkit_paper_api=1.21.3-R0.1-SNAPSHOT
# Fabric build settings # Fabric build settings
fabric_loom_version=1.8-SNAPSHOT fabric_loom_version=1.8-SNAPSHOT

View File

@@ -49,6 +49,6 @@ shadowJar {
tasks { tasks {
runServer { runServer {
minecraftVersion('1.21.1') minecraftVersion('1.21.3')
} }
} }

View File

@@ -13,7 +13,7 @@ from tqdm import tqdm
class Parameters: class Parameters:
root_dir = './servers/' root_dir = './servers/'
proxy_version = "1.21" proxy_version = "1.21"
minecraft_version = '1.21.1' minecraft_version = '1.21.3'
eula_agreement = 'true' eula_agreement = 'true'
backend_names = ['alpha', 'beta'] backend_names = ['alpha', 'beta']