mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-19 14:59:21 +00:00
feat: start 1.21.3
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
|
||||
plugins {
|
||||
id 'com.gradleup.shadow' version '8.3.3'
|
||||
id 'com.gradleup.shadow' version '8.3.4'
|
||||
id 'org.cadixdev.licenser' version '0.6.1' apply false
|
||||
id 'fabric-loom' version '1.7-SNAPSHOT' apply false
|
||||
id 'fabric-loom' version "$fabric_loom_version" apply false
|
||||
id 'org.ajoberstar.grgit' version '5.3.0'
|
||||
id 'maven-publish'
|
||||
id 'java'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dependencies {
|
||||
implementation project(path: ':common')
|
||||
|
||||
implementation 'net.william278.uniform:uniform-bukkit:1.2.1'
|
||||
implementation 'net.william278.uniform:uniform-bukkit:1.2.2'
|
||||
implementation 'net.william278:mpdbdataconverter:1.0.1'
|
||||
implementation 'net.william278:hsldataconverter:1.0'
|
||||
implementation 'net.william278:mapdataapi:1.0.3'
|
||||
@@ -9,7 +9,7 @@ dependencies {
|
||||
implementation 'net.kyori:adventure-platform-bukkit:4.3.4'
|
||||
implementation 'dev.triumphteam:triumph-gui:3.1.10'
|
||||
implementation 'space.arim.morepaperlib:morepaperlib:0.4.4'
|
||||
implementation 'de.tr7zw:item-nbt-api:2.13.2'
|
||||
implementation 'de.tr7zw:item-nbt-api:2.13.3-SNAPSHOT'
|
||||
|
||||
compileOnly "org.spigotmc:spigot-api:${bukkit_spigot_api}"
|
||||
compileOnly 'com.github.retrooper.packetevents:spigot:2.3.0'
|
||||
|
||||
@@ -16,7 +16,7 @@ dependencies {
|
||||
exclude module: 'slf4j-api'
|
||||
}
|
||||
|
||||
compileOnly 'net.william278.uniform:uniform-common:1.2.1'
|
||||
compileOnly 'net.william278.uniform:uniform-common:1.2.2'
|
||||
compileOnly 'com.mojang:brigadier:1.1.8'
|
||||
compileOnly 'org.projectlombok:lombok:1.18.34'
|
||||
compileOnly 'org.jetbrains:annotations:26.0.1'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '1.7-SNAPSHOT'
|
||||
id 'fabric-loom' version "$fabric_loom_version"
|
||||
}
|
||||
|
||||
apply plugin: 'fabric-loom'
|
||||
@@ -18,7 +18,7 @@ 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.2.1+1.20.1')
|
||||
modImplementation include('net.william278.uniform:uniform-fabric:1.2.2+1.21.3')
|
||||
modCompileOnly "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"
|
||||
|
||||
implementation include('org.apache.commons:commons-pool2:2.12.0')
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.ModContainer;
|
||||
import net.kyori.adventure.platform.AudienceProvider;
|
||||
import net.kyori.adventure.platform.fabric.FabricServerAudiences;
|
||||
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.william278.desertwell.util.Version;
|
||||
import net.william278.husksync.adapter.DataAdapter;
|
||||
@@ -142,7 +142,7 @@ public class FabricHuskSync implements DedicatedServerModInitializer, HuskSync,
|
||||
|
||||
private void onEnable() {
|
||||
// Initial plugin setup
|
||||
this.audiences = FabricServerAudiences.of(minecraftServer);
|
||||
this.audiences = MinecraftServerAudiences.of(minecraftServer);
|
||||
|
||||
// Check compatibility
|
||||
checkCompatibility();
|
||||
|
||||
@@ -157,7 +157,7 @@ public abstract class FabricData implements Data {
|
||||
@Override
|
||||
public void apply(@NotNull FabricUser user, @NotNull FabricHuskSync plugin) throws IllegalStateException {
|
||||
final ServerPlayerEntity player = user.getPlayer();
|
||||
player.playerScreenHandler.clearCraftingSlots();
|
||||
player.playerScreenHandler.getCraftingInput().clear();
|
||||
player.currentScreenHandler.setCursorStack(ItemStack.EMPTY);
|
||||
final ItemStack[] items = getContents();
|
||||
for (int slot = 0; slot < player.getInventory().size(); slot++) {
|
||||
@@ -693,6 +693,7 @@ public abstract class FabricData implements Data {
|
||||
@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());
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.EntityHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -124,9 +123,9 @@ public class FabricEventListener extends EventListener implements LockedHandler
|
||||
return (cancelPlayerEvent(player.getUuid())) ? ActionResult.FAIL : ActionResult.PASS;
|
||||
}
|
||||
|
||||
private TypedActionResult<ItemStack> 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())) ? TypedActionResult.fail(stackInHand) : TypedActionResult.pass(stackInHand);
|
||||
return (cancelPlayerEvent(player.getUuid())) ? ActionResult.FAIL : ActionResult.PASS;
|
||||
}
|
||||
|
||||
private boolean handleBlockBreak(World world, PlayerEntity player, BlockPos blockPos, BlockState blockState, BlockEntity blockEntity) {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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;
|
||||
|
||||
@Accessor("exhaustion")
|
||||
public void setExhaustion(float exhaustion) {
|
||||
this.exhaustion = exhaustion;
|
||||
}
|
||||
|
||||
@Accessor("exhaustion")
|
||||
public float getExhaustion() {
|
||||
return exhaustion;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class ServerWorldMixin {
|
||||
@Shadow
|
||||
private MinecraftServer server;
|
||||
|
||||
@Inject(method = "saveLevel", at = @At("HEAD"))
|
||||
@Inject(method = "savePersistentState", at = @At("HEAD"))
|
||||
public void saveLevel(CallbackInfo ci) {
|
||||
if (server.isStopping() || server.isStopped()) {
|
||||
return;
|
||||
|
||||
@@ -25,7 +25,7 @@ import eu.pb4.sgui.api.elements.GuiElementInterface;
|
||||
import eu.pb4.sgui.api.gui.SimpleGui;
|
||||
import me.lucko.fabric.api.permissions.v0.Permissions;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.platform.fabric.FabricServerAudiences;
|
||||
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.screen.GenericContainerScreenHandler;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
@@ -102,7 +102,7 @@ public class FabricUser extends OnlineUser implements FabricUserDataHolder {
|
||||
this.editable = editable;
|
||||
|
||||
// Set title, items
|
||||
this.setTitle(((FabricServerAudiences) plugin.getAudiences()).toNative(title.toComponent()));
|
||||
this.setTitle(((MinecraftServerAudiences) plugin.getAudiences()).asNative(title.toComponent()));
|
||||
this.setLockPlayerInventory(!editable);
|
||||
for (int i = 0; i < size; i++) {
|
||||
final ItemStack item = items.getContents()[i];
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
"PlayerEntityMixin",
|
||||
"ServerPlayerEntityMixin",
|
||||
"ServerPlayNetworkHandlerMixin",
|
||||
"ServerWorldMixin"
|
||||
"ServerWorldMixin",
|
||||
"HungerManagerMixin"
|
||||
],
|
||||
"client": [],
|
||||
"injectors": {
|
||||
|
||||
@@ -4,15 +4,15 @@ org.gradle.daemon=true
|
||||
javaVersion=21
|
||||
|
||||
# Plugin settings
|
||||
plugin_version=3.7
|
||||
minecraft_version=1.21.1
|
||||
plugin_version=3.7.1
|
||||
minecraft_version=1.21.3
|
||||
plugin_archive=husksync
|
||||
plugin_description=A modern, cross-server player data synchronization system
|
||||
|
||||
# Drivers
|
||||
jedis_version=5.1.4
|
||||
mysql_driver_version=9.0.0
|
||||
mariadb_driver_version=3.4.1
|
||||
jedis_version=5.2.0
|
||||
mysql_driver_version=9.1.0
|
||||
mariadb_driver_version=3.5.0
|
||||
postgres_driver_version=42.7.3
|
||||
mongodb_driver_version=5.1.2
|
||||
snappy_version=1.1.10.6
|
||||
@@ -22,9 +22,10 @@ bukkit_spigot_api=1.21.1-R0.1-SNAPSHOT
|
||||
bukkit_paper_api=1.21.1-R0.1-SNAPSHOT
|
||||
|
||||
# Fabric build settings
|
||||
fabric_loader_version=0.16.2
|
||||
fabric_yarn_mappings=1.21.1+build.3
|
||||
fabric_api_version=0.102.1+1.21.1
|
||||
fabric_adventure_platform_version=5.14.1
|
||||
fabric_permissions_api_version=0.3.1
|
||||
fabric_sgui_version=1.6.0+1.21
|
||||
fabric_loom_version=1.8-SNAPSHOT
|
||||
fabric_loader_version=0.16.9
|
||||
fabric_yarn_mappings=1.21.3+build.2
|
||||
fabric_api_version=0.107.0+1.21.3
|
||||
fabric_adventure_platform_version=6.1.0
|
||||
fabric_permissions_api_version=0.3.3
|
||||
fabric_sgui_version=1.7.2+1.21.2
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
2
gradlew
vendored
2
gradlew
vendored
@@ -55,7 +55,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
@@ -6,7 +6,7 @@ dependencies {
|
||||
implementation project(':bukkit')
|
||||
compileOnly project(':common')
|
||||
|
||||
implementation 'net.william278.uniform:uniform-paper:1.2.1'
|
||||
implementation 'net.william278.uniform:uniform-paper:1.2.2'
|
||||
|
||||
compileOnly "io.papermc.paper:paper-api:${bukkit_paper_api}"
|
||||
compileOnly 'org.jetbrains:annotations:26.0.1'
|
||||
|
||||
Reference in New Issue
Block a user