1
0
mirror of https://github.com/Suiranoil/SkinRestorer.git synced 2026-01-16 04:42:12 +00:00

Merge branch '1.20.5-multiloader' into 1.20.3-multiloader

This commit is contained in:
2024-12-23 11:59:36 +03:00
6 changed files with 17 additions and 25 deletions

View File

@@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.2.0] - 2024-11-28
## [2.2.1] - 2024-12-23
### Fixed
- Fixed game not closing because of mineskin working threads (closes [#41](https://github.com/Suiranoil/SkinRestorer/issues/41))
## [2.2.0] - 2024-12-02
### Added
- Added support for [SkinShuffle](https://modrinth.com/mod/skinshuffle) clients (requires FabricAPI on Fabric)
(closes [#34](https://github.com/Suiranoil/SkinRestorer/issues/34))

View File

@@ -1,10 +1,2 @@
### Added
- Added support for [SkinShuffle](https://modrinth.com/mod/skinshuffle) clients (requires FabricAPI on Fabric)
(closes [#34](https://github.com/Suiranoil/SkinRestorer/issues/34))
- Added `providers.mineskin.apiKey` config option (see [wiki](https://github.com/Suiranoil/SkinRestorer/wiki/Configuration#providersmineskin))
### Changed
- Migrated to MineSkin's new API V2
### Fixed
- Fixed `providers` config validation
### Removed
- Dropped support for NeoForge on Minecraft 1.20.2-1.20.4
- Fixed game not closing because of mineskin working threads (closes [#41](https://github.com/Suiranoil/SkinRestorer/issues/41))

View File

@@ -27,9 +27,7 @@ public class SkinIO {
public SkinValue loadSkin(UUID uuid) {
try {
var value = SkinIO.loadSkin(savePath.resolve(SkinIO.uuidToFilename(uuid)));
Objects.requireNonNull(value.provider());
return value;
return SkinIO.loadSkin(savePath.resolve(SkinIO.uuidToFilename(uuid)));
} catch (Exception e) {
return SkinValue.EMPTY;
}

View File

@@ -3,11 +3,14 @@ package net.lionarius.skinrestorer.skin;
import com.mojang.authlib.properties.Property;
import net.lionarius.skinrestorer.skin.provider.EmptySkinProvider;
import net.lionarius.skinrestorer.skin.provider.SkinProviderContext;
import net.lionarius.skinrestorer.util.gson.GsonPostProcessable;
import org.jetbrains.annotations.NotNull;
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) {
@Nullable Property value, @Nullable Property originalValue) implements GsonPostProcessable {
public static final SkinValue EMPTY = new SkinValue(EmptySkinProvider.PROVIDER_NAME, null, null, null);
@@ -30,4 +33,9 @@ public record SkinValue(@NotNull String provider, @Nullable String argument, @Nu
public SkinValue setOriginalValue(Property originalValue) {
return new SkinValue(this.provider, this.argument, this.variant, this.value, originalValue);
}
@Override
public void gsonPostProcess() {
Objects.requireNonNull(this.provider);
}
}

View File

@@ -22,7 +22,6 @@ import org.mineskin.response.QueueResponse;
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.time.Duration;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
@@ -31,19 +30,10 @@ public final class MineskinSkinProvider implements SkinProvider {
public static final String PROVIDER_NAME = "web";
private static final URI API_URI;
private static MineSkinClient MINESKIN_CLIENT;
private static LoadingCache<Pair<URI, SkinVariant>, Optional<Property>> SKIN_CACHE;
static {
try {
API_URI = new URI("https://api.mineskin.org");
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
}
public static void reload() {
var config = SkinRestorer.getConfig();
var configApiKey = config.providersConfig().mineskin().apiKey();

View File

@@ -8,7 +8,7 @@ minecraft_version_list=1.20.3,1.20.4
minecraft_version_range=[1.20.3,1.20.4]
mod_id=skinrestorer
mod_name=SkinRestorer
mod_version=2.2.0
mod_version=2.2.1
mod_author=Lionarius
mod_homepage=https://modrinth.com/mod/skinrestorer
mod_sources=https://github.com/Suiranoil/SkinRestorer