Skip to content

Commit

Permalink
build: target Minecraft 1.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Oct 31, 2024
1 parent c942a01 commit eda8e72
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 📦'
Expand All @@ -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 📊'
Expand All @@ -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
target/HuskSync-Paper-${{ env.version_name }}+mc.1.21.3.jar
target/HuskSync-Fabric-${{ env.version_name }}+mc.1.21.3.jar
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!--suppress ALL -->
<p align="center">
<img src="images/banner.png" alt="HuskSync" />
<a href="https://github.com/WiIIiam278/HuskSync/actions/workflows/ci_1.21.1.yml">
<img src="https://img.shields.io/github/actions/workflow/status/WiIIiam278/HuskSync/ci_1.21.1.yml?branch=master&logo=github"/>
<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_master.yml?branch=master&logo=github"/>
</a>
<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" />
Expand Down Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
}
Expand Down
17 changes: 9 additions & 8 deletions docs/Compatibility.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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,
Expand All @@ -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
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
/*
* This file is part of HuskSync, licensed under the Apache License 2.0.
*
* Copyright (c) William278 <[email protected]>
* 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);

}
4 changes: 2 additions & 2 deletions fabric/src/main/resources/husksync.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"package": "net.william278.husksync.mixins",
"compatibilityLevel": "JAVA_17",
"server": [
"HungerManagerMixin",
"ItemEntityMixin",
"PlayerEntityMixin",
"ServerPlayerEntityMixin",
"ServerPlayNetworkHandlerMixin",
"ServerWorldMixin",
"HungerManagerMixin"
"ServerWorldMixin"
],
"client": [],
"injectors": {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion paper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ shadowJar {

tasks {
runServer {
minecraftVersion('1.21.1')
minecraftVersion('1.21.3')
}
}
2 changes: 1 addition & 1 deletion test/spin_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit eda8e72

Please sign in to comment.