Fix ResourceLocation characters limitation for Minecraft 1.13+ (#126)

This commit is contained in:
ZekerZhayard authored and GitHub committed 2020-11-05 11:52:49 +08:00
1 parent a65445e989
commit 90ed224dd8
1 file changed
+2 -1
@@ -10,6 +10,7 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import com.google.common.collect.Maps;
import com.google.common.hash.Hashing;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
@@ -49,7 +50,7 @@ public class FakeSkinManager {
}
private ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final HttpTextureInfo info, final Type textureType, final SkinAvailableCallback skinAvailableCallback) {
final ResourceLocation resourcelocation = new ResourceLocation("skins/" + info.hash);
final ResourceLocation resourcelocation = new ResourceLocation("skins/" + Hashing.sha1().hashUnencodedChars(info.hash).toString());
if (((IFakeTextureManager_1) this.textureManager).func_229267_b_(resourcelocation) != null) {//Have already loaded
makeCallback(skinAvailableCallback, textureType, resourcelocation, modelCache.getOrDefault(resourcelocation, profileTexture));