Skip to content

Commit

Permalink
(mc1.20.2+) fix playerSkinBlockingLoading causing the client to get…
Browse files Browse the repository at this point in the history
… stuck forever
  • Loading branch information
Fallen-Breath committed Dec 5, 2024
1 parent 85f9467 commit e9e4f9a
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package me.fallenbreath.tweakermore.mixins.tweaks.mc_tweaks.playerSkinBlockingLoading;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import me.fallenbreath.conditionalmixin.api.annotation.Condition;
import me.fallenbreath.conditionalmixin.api.annotation.Restriction;
import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
Expand All @@ -43,12 +43,18 @@
@Mixin(targets = "net/minecraft/client/texture/PlayerSkinProvider$1") // the CacheLoader subclass in PlayerSkinProvider's constructor
public abstract class PlayerSkinProviderMixin
{
@ModifyReturnValue(method = "load(Ljava/lang/Object;)Ljava/lang/Object;", at = @At(value = "TAIL"))
private Object playerSkinBlockingLoading_blockingProfileFetching(Object completableFuture)
@ModifyExpressionValue(
method = "load(Lnet/minecraft/client/texture/PlayerSkinProvider$Key;)Ljava/util/concurrent/CompletableFuture;",
at = @At(
value = "INVOKE",
target = "Ljava/util/concurrent/CompletableFuture;supplyAsync(Ljava/util/function/Supplier;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;"
)
)
private CompletableFuture<?> playerSkinBlockingLoading_blockingProfileFetching(CompletableFuture<?> completableFuture)
{
if (TweakerMoreConfigs.PLAYER_SKIN_BLOCKING_LOADING.getBooleanValue())
{
completableFuture = TaskSynchronizer.createSyncedFuture((CompletableFuture<?>)completableFuture);
completableFuture = TaskSynchronizer.createSyncedFuture(completableFuture);
}
return completableFuture;
}
Expand Down

0 comments on commit e9e4f9a

Please sign in to comment.