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

Compare commits

..

6 Commits

Author SHA1 Message Date
f189322e03 bump version 2024-06-25 14:44:57 +03:00
6f441d5d58 fix no method sendStatusEffects 2024-06-25 14:27:50 +03:00
5def32e4b4 better skin refresh 2024-06-25 14:20:37 +03:00
05e421e24c allow command blocks to execute commands 2024-06-25 12:02:38 +03:00
9617102600 fix no permission level for clear command targets 2024-06-25 12:02:31 +03:00
0e9ceccc47 downgrade version to 1.2.5 2024-06-25 06:46:44 +03:00
4 changed files with 13 additions and 43 deletions

View File

@@ -6,44 +6,8 @@
[![Modrinth Downloads](https://img.shields.io/modrinth/dt/skinrestorer?logo=modrinth)](https://modrinth.com/mod/skinrestorer)
SkinRestorer is a **server-side** only mod for Fabric that allows players to use and change skins on servers running in offline/insecure mode.
This is a server-side only mod for fabric.
## Features
- **Set Skins from Mojang Account**: Fetch and apply skins using a valid Minecraft account name.
- **Set Skins from URL**: Apply skins from any image URL, supporting both classic (Steve) and slim (Alex) skin models.
It allows you to use and change skins on servers that are in offline/insecure mode.
## Command Usage Guide
### Set Mojang Skin
```
/skin set mojang <skin_name> [<targets>]
```
- **Parameters:**
- `<skin_name>`: Minecraft account name to fetch the skin from.
- `[<targets>]`: (Optional, server operators only) Player(s) to apply the skin to.
### Set Web Skin
```
/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.
### Clear Skin
```
/skin clear [<targets>]
```
- **Parameters:**
- `[<targets>]`: (Optional, server operators only) Player(s) to clear 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 "http://example.com/skin.png"
/skin clear @a
```
After installation on server use /skin command to change skin.

View File

@@ -2,6 +2,9 @@ plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = "${project.mod_version}+${project.minecraft_version}"
group = project.maven_group
@@ -27,7 +30,7 @@ processResources {
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release.set(21)
it.options.release.set(17)
}
java {

View File

@@ -4,8 +4,8 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.21
yarn_mappings=1.21+build.2
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.15.11
# Mod Properties

View File

@@ -7,6 +7,7 @@ import com.mojang.authlib.properties.Property;
import it.unimi.dsi.fastutil.Pair;
import net.fabricmc.api.DedicatedServerModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.network.packet.s2c.play.*;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PlayerManager;
@@ -64,7 +65,9 @@ public class SkinRestorer implements DedicatedServerModInitializer {
playerManager.sendCommandTree(player);
playerManager.sendWorldInfo(player, serverWorld);
playerManager.sendPlayerStatus(player);
playerManager.sendStatusEffects(player);
for (StatusEffectInstance statusEffectInstance : player.getStatusEffects()) {
player.networkHandler.sendPacket(new EntityStatusEffectS2CPacket(player.getId(), statusEffectInstance, false));
}
}
public static CompletableFuture<Pair<Collection<ServerPlayerEntity>, Collection<GameProfile>>> setSkinAsync(MinecraftServer server, Collection<GameProfile> targets, Supplier<Property> skinSupplier) {