diff --git a/common/src/main/java/net/lionarius/skinrestorer/skin/SkinValue.java b/common/src/main/java/net/lionarius/skinrestorer/skin/SkinValue.java index dd2ff7d..48fed8b 100644 --- a/common/src/main/java/net/lionarius/skinrestorer/skin/SkinValue.java +++ b/common/src/main/java/net/lionarius/skinrestorer/skin/SkinValue.java @@ -9,11 +9,25 @@ import org.jetbrains.annotations.Nullable; import java.util.Objects; -public record SkinValue(@NotNull String provider, @Nullable String argument, @Nullable SkinVariant variant, - @Nullable Property value, @Nullable Property originalValue) implements GsonPostProcessable { +public final class SkinValue implements GsonPostProcessable { public static final SkinValue EMPTY = new SkinValue(EmptySkinProvider.PROVIDER_NAME, null, null, null); + private @NotNull String provider; + private @Nullable String argument; + private @Nullable SkinVariant variant; + private @Nullable Property value; + private @Nullable Property originalValue; + + public SkinValue(@NotNull String provider, @Nullable String argument, @Nullable SkinVariant variant, + @Nullable Property value, @Nullable Property originalValue) { + this.provider = provider; + this.argument = argument; + this.variant = variant; + this.value = value; + this.originalValue = originalValue; + } + public SkinValue(String provider, String argument, SkinVariant variant, Property value) { this(provider, argument, variant, value, null); } @@ -38,4 +52,23 @@ public record SkinValue(@NotNull String provider, @Nullable String argument, @Nu public void gsonPostProcess() { Objects.requireNonNull(this.provider); } + + public @NotNull String provider() { + return provider; + } + + public @Nullable String argument() { + return argument; + } + + public @Nullable SkinVariant variant() { + return variant;} + + public @Nullable Property value() { + return value; + } + + public @Nullable Property originalValue() { + return originalValue; + } } diff --git a/common/src/main/java/net/lionarius/skinrestorer/util/PlayerUtils.java b/common/src/main/java/net/lionarius/skinrestorer/util/PlayerUtils.java index 83fd3e8..4d6f7a1 100644 --- a/common/src/main/java/net/lionarius/skinrestorer/util/PlayerUtils.java +++ b/common/src/main/java/net/lionarius/skinrestorer/util/PlayerUtils.java @@ -44,8 +44,8 @@ public final class PlayerUtils { PlayerList playerList = serverLevel.getServer().getPlayerList(); ChunkMap chunkMap = serverLevel.getChunkSource().chunkMap; - playerList.broadcastAll(new ClientboundPlayerInfoRemovePacket(List.of(player.getUUID()))); - playerList.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(Collections.singleton(player))); + playerList.broadcastAll(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, player)); + playerList.broadcastAll(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, player)); var trackedEntity = (TrackedEntityAccessorInvoker) ((ChunkMapAccessor) chunkMap).getEntityMap().get(player.getId()); if (trackedEntity != null) { @@ -73,7 +73,7 @@ public final class PlayerUtils { player.gameMode.getPreviousGameModeForPlayer(), player.getLevel().isDebug(), player.getLevel().isFlat(), - (byte) 3, + true, player.getLastDeathLocation() ) ); diff --git a/gradle.properties b/gradle.properties index 69197a7..8bc4cfe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ group=net.lionarius java_version=17 # Common -minecraft_version=1.19.3 -minecraft_version_list=1.19.3 -minecraft_version_range=[1.19.3,1.19.4) +minecraft_version=1.19.1 +minecraft_version_list=1.19.1,1.19.2 +minecraft_version_range=[1.19.1,1.19.3) mod_id=skinrestorer mod_name=SkinRestorer mod_version=2.3.0 @@ -21,18 +21,18 @@ description=A server-side mod for managing skins. mineskin_client_version=3.0.1-SNAPSHOT # ParchmentMC mappings, see https://parchmentmc.org/docs/getting-started#choose-a-version for new versions -parchment_minecraft=1.19.3 -parchment_version=2023.06.25 +parchment_minecraft=1.19.2 +parchment_version=2022.11.27 # Fabric, see https://fabricmc.net/develop/ for new versions fabric_loader_version=0.15.0 fabric_optional_dependencies= # Forge, see https://files.minecraftforge.net/net/minecraftforge/forge/ for new versions -forge_version=44.0.0 -forge_loader_version_range=[44,) +forge_version=42.0.0 +forge_loader_version_range=[42,) # Forge sometimes skips minor minecraft versions (like 1.20.5) -forge_minecraft_version=1.19.3 +forge_minecraft_version=1.19.1 # NeoForge, see https://projects.neoforged.net/neoforged/neoforge for new versions neoforge_version=20.2.3-beta