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

Merge branch 'refs/heads/1.21-multiloader' into 1.20.5-multiloader

This commit is contained in:
2024-09-25 20:48:47 +03:00
8 changed files with 39 additions and 88 deletions

View File

@@ -4,6 +4,17 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.1.0] - 2024-09-26
### Added
- Added `config reload` command for dynamic configuration updates
- Added `refreshSkinOnJoin` config option (see [wiki](https://github.com/Suiranoil/SkinRestorer/wiki/Configuration#refreshskinonjoin))
- Implemented caching for skin providers
- Added provider configurations (see [wiki](https://github.com/Suiranoil/SkinRestorer/wiki/Configuration#providers))
- Added username and url validation for requests
### Fixed
- Fixed old skin directory migration not working
- Prevented overwriting existing skin files during migration
## [2.0.3] - 2024-08-20 ## [2.0.3] - 2024-08-20
### Added ### Added
- Added `firstJoinSkinProvider` config option (see [wiki](https://github.com/Suiranoil/SkinRestorer/wiki/Config#firstjoinskinprovider)) - Added `firstJoinSkinProvider` config option (see [wiki](https://github.com/Suiranoil/SkinRestorer/wiki/Config#firstjoinskinprovider))

View File

@@ -1,4 +1,9 @@
### Added ### Added
- Added `firstJoinSkinProvider` config option (see [wiki](https://github.com/Suiranoil/SkinRestorer/wiki/Config#firstjoinskinprovider)) - Added `config reload` command for dynamic configuration updates
- Added `refreshSkinOnJoin` config option (see [wiki](https://github.com/Suiranoil/SkinRestorer/wiki/Configuration#refreshskinonjoin))
- Implemented caching for skin providers
- Added provider configurations (see [wiki](https://github.com/Suiranoil/SkinRestorer/wiki/Configuration#providers))
- Added username and url validation for requests
### Fixed ### Fixed
- Fixed ability to set config values to `null` - Fixed old skin directory migration not working
- Prevented overwriting existing skin files during migration

View File

@@ -1,7 +1,7 @@
# SkinRestorer # SkinRestorer
<a href="https://www.curseforge.com/minecraft/mc-mods/skinrestorer"><img src="https://raw.githubusercontent.com/Suiranoil/badges/main/assets/minecraft/platform/curseforge/mini/badge.svg" alt="CurseForge" height="32"></a>
<a href="https://modrinth.com/mod/skinrestorer"><img src="https://raw.githubusercontent.com/Suiranoil/badges/main/assets/minecraft/platform/modrinth/mini/badge.svg" alt="Modrinth" height="32"></a> <a href="https://modrinth.com/mod/skinrestorer"><img src="https://raw.githubusercontent.com/Suiranoil/badges/main/assets/minecraft/platform/modrinth/mini/badge.svg" alt="Modrinth" height="32"></a>
<a href="https://www.curseforge.com/minecraft/mc-mods/skinrestorer"><img src="https://raw.githubusercontent.com/Suiranoil/badges/main/assets/minecraft/platform/curseforge/mini/badge.svg" alt="CurseForge" height="32"></a>
A server-side mod for managing and restoring player skins. A server-side mod for managing and restoring player skins.
@@ -10,94 +10,25 @@ A server-side mod for managing and restoring player skins.
- **Set skins from Mojang Account**: Fetch and apply skins using a valid Minecraft username. - **Set skins from Mojang Account**: Fetch and apply skins using a valid Minecraft username.
- **Set skins from Ely.by**: Fetch and apply skins using a valid [Ely.by](https://ely.by/) username. - **Set skins from Ely.by**: Fetch and apply skins using a valid [Ely.by](https://ely.by/) username.
- **Set skins from URL**: Fetch and apply skins from any image URL, supporting both classic (Steve) and slim (Alex) skin models. - **Set skins from URL**: Fetch and apply skins from any image URL, supporting both classic (Steve) and slim (Alex) skin models.
- **Automatic skin fetching**: Automatically fetch skin from Mojang/Ely.by when a player joins the server running in offline/insecure mode ([configurable](https://github.com/Suiranoil/SkinRestorer/wiki/Config)). - **Automatic skin fetching**: Automatically fetch skin from Mojang/Ely.by when a player joins the server running in offline/insecure mode ([configurable](https://github.com/Suiranoil/SkinRestorer/wiki/Configuration)).
- **Singleplayer support**: Apply skins individually for each world. - **Singleplayer support**: Apply skins individually for each world.
- **Permissions API support** - **Permissions API support**
## 📜 Command Usage Guide ## 📜 Command Usage Guide
### Set Mojang skin For a detailed list of available commands and their usage, please visit the [commands wiki page](https://github.com/Suiranoil/SkinRestorer/wiki/Commands).
Fetch and apply skins using a valid Minecraft username. ## ❌ Known Incompatibilities
``` - **[Arclight](https://github.com/IzzelAliz/Arclight) (<=1.20.1)**: Trials or older versions are not compatible due to mixin conflicts.
/skin set mojang <username> [<targets>] As an alternative, consider using the [SkinsRestorer](https://www.spigotmc.org/resources/skinsrestorer.2124/) plugin.
```
- **Parameters** ## 🪙 Donation
- `<username>`: Minecraft username to fetch the skin from.
- `[<targets>]`: (Optional, server operators only) Player(s) to apply the skin to.
### Set Ely.by skin If you enjoy using **SkinRestorer** and would like to support its development, you can contribute through cryptocurrency donations.
Fetch and apply skins using a valid [Ely.by](https://ely.by/) username. Bitcoin (BTC): `1Ndbwny8pxdnWXFgadp95fp97y5JqMJKTX`\
USDT (TRC20): `TGXn8wrqku5KLzwPWQAeH7wgnV4UzwHEae`\
USDT (TON): `UQAQF18Xlmx-V1oZ90C2YOju5qI7q1LgrCP5QaIUhqIELmDS`
``` Thank you for your generosity!
/skin set ely.by <username> [<targets>]
```
- **Parameters**
- `<username>`: Ely.by username to fetch the skin from.
- `[<targets>]`: (Optional, server operators only) Player(s) to apply the skin to.
### Set Web skin
Fetch and apply skins from any image URL, supporting both classic (Steve) and slim (Alex) skin models.
Uses [mineskin api](https://mineskin.org/) under the hood.
```
/skin set web (classic|slim) "<url>" [<targets>]
```
- **Parameters**
- `(classic|slim)`: Type of the skin model (`classic` for Steve model, `slim` for Alex model).
- `"<url>"`: URL pointing to the skin image file (ensure it follows Minecraft's skin size and format requirements).
- `[<targets>]`: (Optional, server operators only) Player(s) to apply the skin to.
### Refresh skin
Refetch and reapply the currently applied skins.
```
/skin refresh [<targets>]
```
- **Parameters**
- `[<targets>]`: (Optional, server operators only) Player(s) to refresh the skin for.
### Clear skin
Remove the currently applied skins.
```
/skin clear [<targets>]
```
- **Parameters**
- `[<targets>]`: (Optional, server operators only) Player(s) to clear the skin for.
### Reset skin
Reset to the default skin or remove any custom skin.
If [automatic skin fetching](https://github.com/Suiranoil/SkinRestorer/wiki/Config#fetchskinonfirstjoin) is enabled, a new skin will be fetched when the player rejoins the server.
```
/skin reset [<targets>]
```
- **Parameters**
- `[<targets>]`: (Optional, server operators only) Player(s) to reset the skin for.
### Notes
- If `targets` is not specified, the command will apply to the player executing the command.
### Examples
```
/skin set mojang Notch
/skin set web classic "https://example.com/skin.png"
/skin clear @a
```

View File

@@ -20,6 +20,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Optional; import java.util.Optional;
@@ -71,7 +72,7 @@ public final class SkinRestorer {
var isDefaultName = config.name().equals(defaultName); var isDefaultName = config.name().equals(defaultName);
SkinRestorer.providersRegistry.register(defaultName, provider, config.enabled() && isDefaultName); SkinRestorer.providersRegistry.register(defaultName, provider, config.enabled() && isDefaultName);
if (!isDefaultName) if (!isDefaultName && Arrays.stream(SkinProvider.BUILTIN_PROVIDER_NAMES).noneMatch(name -> name.equals(config.name())))
SkinRestorer.providersRegistry.register(config.name(), provider, config.enabled()); SkinRestorer.providersRegistry.register(config.name(), provider, config.enabled());
} }

View File

@@ -49,7 +49,8 @@ public final class SkinCommand {
var providers = SkinRestorer.getProvidersRegistry().getPublicProviders(); var providers = SkinRestorer.getProvidersRegistry().getPublicProviders();
for (var entry : providers) for (var entry : providers)
set.then(buildSetSubcommand(entry.first(), entry.second())); set.then(buildSetSubcommand(entry.first(), entry.second()));
base.then(set); if (!providers.isEmpty())
base.then(set);
base.then( base.then(
literal("config") literal("config")

View File

@@ -14,7 +14,7 @@ public final class Config {
private String language = "en_us"; private String language = "en_us";
private boolean refreshSkinOnJoin = false; private boolean refreshSkinOnJoin = true;
private boolean fetchSkinOnFirstJoin = true; private boolean fetchSkinOnFirstJoin = true;

View File

@@ -12,6 +12,8 @@ public interface SkinProvider {
ElyBySkinProvider ELY_BY = new ElyBySkinProvider(); ElyBySkinProvider ELY_BY = new ElyBySkinProvider();
MineskinSkinProvider MINESKIN = new MineskinSkinProvider(); MineskinSkinProvider MINESKIN = new MineskinSkinProvider();
String[] BUILTIN_PROVIDER_NAMES = new String[]{EmptySkinProvider.PROVIDER_NAME, MojangSkinProvider.PROVIDER_NAME, ElyBySkinProvider.PROVIDER_NAME, MineskinSkinProvider.PROVIDER_NAME};
String getArgumentName(); String getArgumentName();
boolean hasVariantSupport(); boolean hasVariantSupport();

View File

@@ -8,9 +8,9 @@ minecraft_version_list=1.20.5,1.20.6
minecraft_version_range=[1.20.5,1.20.6] minecraft_version_range=[1.20.5,1.20.6]
mod_id=skinrestorer mod_id=skinrestorer
mod_name=SkinRestorer mod_name=SkinRestorer
mod_version=2.0.3 mod_version=2.1.0
mod_author=Lionarius mod_author=Lionarius
mod_homepage=https://www.curseforge.com/minecraft/mc-mods/skinrestorer mod_homepage=https://modrinth.com/mod/skinrestorer
mod_sources=https://github.com/Suiranoil/SkinRestorer mod_sources=https://github.com/Suiranoil/SkinRestorer
mod_issues=https://github.com/Suiranoil/SkinRestorer/issues mod_issues=https://github.com/Suiranoil/SkinRestorer/issues
license=MIT license=MIT