mirror of
https://github.com/Suiranoil/SkinRestorer.git
synced 2026-01-16 04:42:12 +00:00
Compare commits
25 Commits
034d4863b7
...
bd983e10ec
| Author | SHA1 | Date | |
|---|---|---|---|
|
bd983e10ec
|
|||
|
c695e66a94
|
|||
|
c07497cddb
|
|||
|
418397d3d2
|
|||
|
7af35cda9f
|
|||
|
3d92617e47
|
|||
|
f357e6c985
|
|||
|
e4c9e1b3cd
|
|||
|
3ef3318ed3
|
|||
|
c9bf691544
|
|||
|
1a6327f91c
|
|||
|
56655bca36
|
|||
|
90ca995907
|
|||
|
0823ed6669
|
|||
|
3fff2eb920
|
|||
|
50a49b33a2
|
|||
|
8de7f3a16f
|
|||
|
5b384c32d6
|
|||
|
7fb647b3ba
|
|||
|
907566e12b
|
|||
|
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/),
|
||||
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
|
||||
### Fixed
|
||||
- Fixed mixin incompatibility with ModernFix (closes [#42](https://github.com/Suiranoil/SkinRestorer/issues/52))
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
### 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
|
||||
|
||||
@@ -5,26 +5,17 @@ import net.minecraft.network.Connection;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.players.PlayerList;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(PlayerList.class)
|
||||
public abstract class PlayerListMixin {
|
||||
|
||||
@Shadow
|
||||
public abstract List<ServerPlayer> getPlayers();
|
||||
|
||||
@Shadow @Final
|
||||
private MinecraftServer server;
|
||||
|
||||
@Inject(method = "remove", at = @At("TAIL"))
|
||||
private void remove(ServerPlayer player, CallbackInfo ci) {
|
||||
SkinRestorer.Events.onPlayerDisconnect(player);
|
||||
@@ -32,13 +23,14 @@ public abstract class PlayerListMixin {
|
||||
|
||||
@Inject(method = "removeAll", at = @At("HEAD"))
|
||||
private void removeAll(CallbackInfo ci) {
|
||||
for (var player : getPlayers()) {
|
||||
for (var player : ((PlayerList) (Object) this).getPlayers()) {
|
||||
SkinRestorer.Events.onPlayerDisconnect(player);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "placeNewPlayer", at = @At("HEAD"))
|
||||
private void placeNewPlayer(Connection connection, ServerPlayer player, CallbackInfo ci) {
|
||||
var server = ((PlayerList) (Object) this).getServer();
|
||||
var delay = SkinRestorer.getConfig().skinApplyDelayOnJoin();
|
||||
|
||||
if (delay <= 0) {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
@Mixin(ServerLoginPacketListenerImpl.class)
|
||||
public interface ServerLoginPacketListenerImplAccessorInvoker {
|
||||
|
||||
@Accessor
|
||||
GameProfile getGameProfile();
|
||||
|
||||
@Invoker
|
||||
GameProfile invokeCreateFakeProfile(GameProfile original);
|
||||
}
|
||||
@@ -20,24 +20,18 @@ import java.util.concurrent.CompletableFuture;
|
||||
@Mixin(ServerLoginPacketListenerImpl.class)
|
||||
public abstract class ServerLoginPacketListenerImplMixin {
|
||||
|
||||
@Shadow @Nullable
|
||||
private GameProfile gameProfile;
|
||||
|
||||
@Unique
|
||||
private CompletableFuture<Void> skinrestorer$pendingSkin;
|
||||
|
||||
@Shadow
|
||||
protected abstract GameProfile createFakeProfile(GameProfile original);
|
||||
|
||||
@Inject(method = "handleAcceptedLogin", at = @At(value = "HEAD"), cancellable = true)
|
||||
public void waitForSkin(CallbackInfo ci) {
|
||||
if (skinrestorer$pendingSkin == null) {
|
||||
skinrestorer$pendingSkin = CompletableFuture.supplyAsync(() -> {
|
||||
var profile = gameProfile;
|
||||
var profile = ((ServerLoginPacketListenerImplAccessorInvoker) this).getGameProfile();
|
||||
assert profile != null;
|
||||
|
||||
if (!profile.isComplete())
|
||||
profile = createFakeProfile(profile);
|
||||
profile = ((ServerLoginPacketListenerImplAccessorInvoker) this).invokeCreateFakeProfile(profile);
|
||||
|
||||
var originalSkin = PlayerUtils.getPlayerSkin(profile);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"mixins": [
|
||||
"ChunkMapAccessor",
|
||||
"PlayerListMixin",
|
||||
"ServerLoginPacketListenerImplAccessorInvoker",
|
||||
"ServerLoginPacketListenerImplMixin",
|
||||
"TrackedEntityAccessorInvoker"
|
||||
],
|
||||
|
||||
@@ -8,7 +8,7 @@ minecraft_version_list=1.19.3
|
||||
minecraft_version_range=[1.19.3,1.19.4)
|
||||
mod_id=skinrestorer
|
||||
mod_name=SkinRestorer
|
||||
mod_version=2.3.2
|
||||
mod_version=2.3.3
|
||||
mod_author=Lionarius
|
||||
mod_homepage=https://modrinth.com/mod/skinrestorer
|
||||
mod_sources=https://github.com/Suiranoil/SkinRestorer
|
||||
|
||||
Reference in New Issue
Block a user