mirror of
https://github.com/Suiranoil/SkinRestorer.git
synced 2026-01-16 04:42:12 +00:00
Compare commits
14 Commits
04e781d36f
...
7af35cda9f
| Author | SHA1 | Date | |
|---|---|---|---|
|
7af35cda9f
|
|||
|
3d92617e47
|
|||
|
f357e6c985
|
|||
|
e4c9e1b3cd
|
|||
|
3ef3318ed3
|
|||
|
3fff2eb920
|
|||
|
50a49b33a2
|
|||
|
8de7f3a16f
|
|||
|
5b384c32d6
|
|||
|
8a730c7c61
|
|||
|
0feba3f4b2
|
|||
|
fcd76d9a87
|
|||
|
8119a08c80
|
|||
|
6c159d6aa2
|
@@ -4,6 +4,12 @@ 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.3.3] - 2025-06-01
|
||||||
|
### Fixed
|
||||||
|
- Fixed forge mixin crash (closes [#54](https://github.com/Suiranoil/SkinRestorer/issues/53))
|
||||||
|
### Removed
|
||||||
|
- Removed minecraft 1.19 support
|
||||||
|
|
||||||
## [2.3.2] - 2025-05-24
|
## [2.3.2] - 2025-05-24
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fixed mixin incompatibility with ModernFix (closes [#42](https://github.com/Suiranoil/SkinRestorer/issues/52))
|
- Fixed mixin incompatibility with ModernFix (closes [#42](https://github.com/Suiranoil/SkinRestorer/issues/52))
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
### Fixed
|
### Fixed
|
||||||
- Fixed mixin incompatibility with ModernFix (closes [#42](https://github.com/Suiranoil/SkinRestorer/issues/52))
|
- Fixed forge mixin crash (closes [#54](https://github.com/Suiranoil/SkinRestorer/issues/53))
|
||||||
|
### Removed
|
||||||
|
- Removed minecraft 1.19 support
|
||||||
|
|||||||
@@ -6,26 +6,17 @@ import net.minecraft.server.MinecraftServer;
|
|||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.server.network.CommonListenerCookie;
|
import net.minecraft.server.network.CommonListenerCookie;
|
||||||
import net.minecraft.server.players.PlayerList;
|
import net.minecraft.server.players.PlayerList;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mixin(PlayerList.class)
|
@Mixin(PlayerList.class)
|
||||||
public abstract class PlayerListMixin {
|
public abstract class PlayerListMixin {
|
||||||
|
|
||||||
@Shadow
|
|
||||||
public abstract List<ServerPlayer> getPlayers();
|
|
||||||
|
|
||||||
@Shadow @Final
|
|
||||||
private MinecraftServer server;
|
|
||||||
|
|
||||||
@Inject(method = "remove", at = @At("TAIL"))
|
@Inject(method = "remove", at = @At("TAIL"))
|
||||||
private void remove(ServerPlayer player, CallbackInfo ci) {
|
private void remove(ServerPlayer player, CallbackInfo ci) {
|
||||||
SkinRestorer.Events.onPlayerDisconnect(player);
|
SkinRestorer.Events.onPlayerDisconnect(player);
|
||||||
@@ -33,13 +24,14 @@ public abstract class PlayerListMixin {
|
|||||||
|
|
||||||
@Inject(method = "removeAll", at = @At("HEAD"))
|
@Inject(method = "removeAll", at = @At("HEAD"))
|
||||||
private void removeAll(CallbackInfo ci) {
|
private void removeAll(CallbackInfo ci) {
|
||||||
for (var player : getPlayers()) {
|
for (var player : ((PlayerList) (Object) this).getPlayers()) {
|
||||||
SkinRestorer.Events.onPlayerDisconnect(player);
|
SkinRestorer.Events.onPlayerDisconnect(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "placeNewPlayer", at = @At("HEAD"))
|
@Inject(method = "placeNewPlayer", at = @At("HEAD"))
|
||||||
private void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie cookie, CallbackInfo ci) {
|
private void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie cookie, CallbackInfo ci) {
|
||||||
|
var server = ((PlayerList) (Object) this).getServer();
|
||||||
var delay = SkinRestorer.getConfig().skinApplyDelayOnJoin();
|
var delay = SkinRestorer.getConfig().skinApplyDelayOnJoin();
|
||||||
|
|
||||||
if (delay <= 0) {
|
if (delay <= 0) {
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package net.lionarius.skinrestorer.mixin;
|
||||||
|
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import net.minecraft.server.network.ServerLoginPacketListenerImpl;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
@Mixin(ServerLoginPacketListenerImpl.class)
|
||||||
|
public interface ServerLoginPacketListenerImplAccessorInvoker {
|
||||||
|
|
||||||
|
@Accessor
|
||||||
|
GameProfile getAuthenticatedProfile();
|
||||||
|
}
|
||||||
@@ -7,9 +7,7 @@ import net.lionarius.skinrestorer.skin.provider.SkinProviderContext;
|
|||||||
import net.lionarius.skinrestorer.util.PlayerUtils;
|
import net.lionarius.skinrestorer.util.PlayerUtils;
|
||||||
import net.lionarius.skinrestorer.util.Result;
|
import net.lionarius.skinrestorer.util.Result;
|
||||||
import net.minecraft.server.network.ServerLoginPacketListenerImpl;
|
import net.minecraft.server.network.ServerLoginPacketListenerImpl;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
@@ -20,9 +18,6 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
@Mixin(ServerLoginPacketListenerImpl.class)
|
@Mixin(ServerLoginPacketListenerImpl.class)
|
||||||
public abstract class ServerLoginPacketListenerImplMixin {
|
public abstract class ServerLoginPacketListenerImplMixin {
|
||||||
|
|
||||||
@Shadow @Nullable
|
|
||||||
private GameProfile authenticatedProfile;
|
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
private CompletableFuture<Void> skinrestorer$pendingSkin;
|
private CompletableFuture<Void> skinrestorer$pendingSkin;
|
||||||
|
|
||||||
@@ -32,7 +27,7 @@ public abstract class ServerLoginPacketListenerImplMixin {
|
|||||||
public void waitForSkin(CallbackInfo ci) {
|
public void waitForSkin(CallbackInfo ci) {
|
||||||
if (skinrestorer$pendingSkin == null) {
|
if (skinrestorer$pendingSkin == null) {
|
||||||
skinrestorer$pendingSkin = CompletableFuture.supplyAsync(() -> {
|
skinrestorer$pendingSkin = CompletableFuture.supplyAsync(() -> {
|
||||||
final var profile = authenticatedProfile;
|
final var profile = ((ServerLoginPacketListenerImplAccessorInvoker) this).getAuthenticatedProfile();
|
||||||
|
|
||||||
assert profile != null;
|
assert profile != null;
|
||||||
var originalSkin = PlayerUtils.getPlayerSkin(profile);
|
var originalSkin = PlayerUtils.getPlayerSkin(profile);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"mixins": [
|
"mixins": [
|
||||||
"ChunkMapAccessor",
|
"ChunkMapAccessor",
|
||||||
"PlayerListMixin",
|
"PlayerListMixin",
|
||||||
|
"ServerLoginPacketListenerImplAccessorInvoker",
|
||||||
"ServerLoginPacketListenerImplMixin",
|
"ServerLoginPacketListenerImplMixin",
|
||||||
"TrackedEntityAccessorInvoker"
|
"TrackedEntityAccessorInvoker"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ minecraft_version_list=1.20.3,1.20.4
|
|||||||
minecraft_version_range=[1.20.3,1.20.4]
|
minecraft_version_range=[1.20.3,1.20.4]
|
||||||
mod_id=skinrestorer
|
mod_id=skinrestorer
|
||||||
mod_name=SkinRestorer
|
mod_name=SkinRestorer
|
||||||
mod_version=2.3.2
|
mod_version=2.3.3
|
||||||
mod_author=Lionarius
|
mod_author=Lionarius
|
||||||
mod_homepage=https://modrinth.com/mod/skinrestorer
|
mod_homepage=https://modrinth.com/mod/skinrestorer
|
||||||
mod_sources=https://github.com/Suiranoil/SkinRestorer
|
mod_sources=https://github.com/Suiranoil/SkinRestorer
|
||||||
|
|||||||
Reference in New Issue
Block a user