mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-19 14:59:21 +00:00
feat: support Minecraft 1.21.7
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
essential.defaults.loom.mappings=net.fabricmc:yarn:1.21.6+build.1:v2
|
||||
|
||||
fabric_loader_version=0.16.14
|
||||
fabric_api_version=0.127.1+1.21.6
|
||||
fabric_permissions_api_version=0.4.0
|
||||
fabric_adventure_platform_version=6.5.0-SNAPSHOT
|
||||
fabric_sgui_version=1.10.0+1.21.6
|
||||
7
fabric/1.21.7/gradle.properties
Normal file
7
fabric/1.21.7/gradle.properties
Normal file
@@ -0,0 +1,7 @@
|
||||
essential.defaults.loom.mappings=net.fabricmc:yarn:1.21.7+build.2:v2
|
||||
|
||||
fabric_loader_version=0.16.14
|
||||
fabric_api_version=0.128.1+1.21.7
|
||||
fabric_permissions_api_version=0.4.1
|
||||
fabric_adventure_platform_version=6.5.0-SNAPSHOT
|
||||
fabric_sgui_version=1.10.0+1.21.6
|
||||
@@ -14,8 +14,8 @@ dependencies {
|
||||
modImplementation include("net.kyori:adventure-platform-fabric:${fabric_adventure_platform_version}")
|
||||
modImplementation include("me.lucko:fabric-permissions-api:${fabric_permissions_api_version}")
|
||||
modImplementation include("eu.pb4:sgui:${fabric_sgui_version}")
|
||||
modImplementation include("net.william278.uniform:uniform-fabric:1.3.5+${project.name}")
|
||||
modImplementation include("net.william278.toilet:toilet-fabric:1.0.14+${project.name}")
|
||||
modImplementation include("net.william278.uniform:uniform-fabric:1.3.6+${project.name}")
|
||||
modImplementation include("net.william278.toilet:toilet-fabric:1.0.15+${project.name}")
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"
|
||||
|
||||
// Manually include config deps due to the way including api deps works
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.21.6
|
||||
1.21.7
|
||||
@@ -3,15 +3,15 @@ plugins {
|
||||
}
|
||||
|
||||
preprocess {
|
||||
def fabric12106 = createNode("1.21.6", 12106, "yarn")
|
||||
def fabric12107 = createNode("1.21.7", 12107, "yarn")
|
||||
def fabric12105 = createNode("1.21.5", 12105, "yarn")
|
||||
def fabric12104 = createNode("1.21.4", 12104, "yarn")
|
||||
def fabric12101 = createNode("1.21.1", 12101, "yarn")
|
||||
def fabric12001 = createNode("1.20.1", 12001, "yarn")
|
||||
|
||||
strictExtraMappings.set(true)
|
||||
fabric12105.link(fabric12106, null)
|
||||
fabric12104.link(fabric12106, null)
|
||||
fabric12101.link(fabric12106, null)
|
||||
fabric12001.link(fabric12106, null)
|
||||
fabric12105.link(fabric12107, null)
|
||||
fabric12104.link(fabric12107, null)
|
||||
fabric12101.link(fabric12107, null)
|
||||
fabric12001.link(fabric12107, null)
|
||||
}
|
||||
@@ -102,6 +102,7 @@ public class FabricHuskSync implements DedicatedServerModInitializer, HuskSync,
|
||||
private static final int VERSION1_21_4 = 4189;
|
||||
private static final int VERSION1_21_5 = 4323;
|
||||
private static final int VERSION1_21_6 = 4435;
|
||||
private static final int VERSION1_21_7 = 4438;
|
||||
|
||||
private final HashMap<Identifier, Serializer<? extends Data>> serializers = Maps.newHashMap();
|
||||
private final Map<UUID, Map<Identifier, Data>> playerCustomDataStore = Maps.newConcurrentMap();
|
||||
@@ -389,8 +390,9 @@ public class FabricHuskSync implements DedicatedServerModInitializer, HuskSync,
|
||||
case "1.21.4" -> VERSION1_21_4;
|
||||
case "1.21.5" -> VERSION1_21_5;
|
||||
case "1.21.6" -> VERSION1_21_6;
|
||||
//#if MC==12106
|
||||
default -> VERSION1_21_6;
|
||||
case "1.21.7" -> VERSION1_21_7;
|
||||
//#if MC==12107
|
||||
default -> VERSION1_21_7;
|
||||
//#elseif MC==12105
|
||||
//$$ default -> VERSION1_21_5;
|
||||
//#elseif MC==12104
|
||||
|
||||
@@ -274,7 +274,7 @@ public abstract class FabricSerializer {
|
||||
@Nullable
|
||||
private NbtCompound encodeNbt(@NotNull ItemStack item, @NotNull DynamicRegistryManager reg) {
|
||||
try {
|
||||
//#if MC>=12106
|
||||
//#if MC>=12107
|
||||
return (NbtCompound) ItemStack.CODEC.encodeStart(reg.getOps(NbtOps.INSTANCE), item).getOrThrow();
|
||||
//#elseif MC>=12104
|
||||
//$$ return (NbtCompound) item.toNbt(reg);
|
||||
@@ -292,7 +292,7 @@ public abstract class FabricSerializer {
|
||||
|
||||
@NotNull
|
||||
private ItemStack decodeNbt(@NotNull NbtElement item, @NotNull DynamicRegistryManager reg) {
|
||||
//#if MC>=12106
|
||||
//#if MC>=12107
|
||||
final @Nullable ItemStack stack = ItemStack.CODEC.decode(reg.getOps(NbtOps.INSTANCE), item).getOrThrow().getFirst();
|
||||
//#elseif MC>12001
|
||||
//$$ final @Nullable ItemStack stack = ItemStack.fromNbt(reg, item).orElse(null);
|
||||
|
||||
Reference in New Issue
Block a user