Compare commits

...
76 Commits
Author SHA1 Message Date
Alexander Xia 10e57fe349 Bump 14.11 2019-08-27 17:55:49 +08:00
Alexander Xia 9f70ad0159 Update upload url 2019-06-25 15:24:14 +08:00
ZekerZhayard 0d5538a110 Support for forge 1.14.2 (#59)
* Support for forge 1.14.2

* Delete unnecessary code.
2019-06-25 14:38:40 +08:00
Alexander Xia 27efbbfeb0 Fix addScheduledTask method not found 2019-06-24 20:07:48 +08:00
Alexander Xia 7fad8c602d Add 1.14.2 forge suport 2019-06-24 19:52:02 +08:00
Alexander Xia 29a0952bc4 Fix compatibility with ModLauncher 1.1 (#57) 2019-06-15 17:37:48 +08:00
Alexander Xia b7107b7172 Remove 1.13.2 vanilla 2019-05-24 00:06:35 +08:00
Alexander Xia 2adbc25f69 Fix gradle upload 2019-05-23 23:47:33 +08:00
ZekerZhayard 3bee9281ec Fix remapJar (#55) 2019-05-23 23:35:56 +08:00
ZekerZhayard 917f9f650b Support Fabric for 1.14.1 (#53)
* Fix ClassCastException

* Support Fabric for 1.14.1

* Support Fabric for 1.14.1

* Use mapping file instead of hard code
2019-05-22 23:47:59 +08:00
LionZXY edf6e241e4 Add GlitchlessAPI (#51)
* Add GlitchlessAPI

* Fix build and move GlitchlessSkin to down
2019-05-10 16:20:39 +08:00
Alexander Xia d2c65f00c9 Remove meaningless log 2019-04-26 13:59:08 +08:00
Alexander Xia 95ee345441 Fix 1.14 skin load 2019-04-26 13:56:22 +08:00
Alexander Xia 3ade4867d4 Add 1.14 to settings.gradle 2019-04-26 10:36:20 +08:00
Alexander Xia 2d1951774d Add 1.14 support 2019-04-26 10:34:31 +08:00
ZekerZhayard cc3616a074 Add CSLPluginsLoader (#48)
* Add CSLPluginsLoader

* Remove plugin loader. Add some events.

* Use ServiceLoader to load plugins

* Remove PluginClassLoader.
2019-03-08 13:38:44 +08:00
xfl03 42c48c5c2e Bump 14.10a 2019-03-05 19:33:09 +08:00
xfl03 030daf12a2 Fix 1.8 forge support 2019-03-04 20:12:13 +08:00
xfl03 88763d64ef Bump 14.10 2019-03-03 12:20:28 +08:00
xfl03 4f2b5edf84 Fix incorrect response code judgement 2019-03-03 11:53:48 +08:00
xfl03 cbe07b9003 Fix http redirect to https 2019-03-03 11:34:54 +08:00
xfl03 b2867a0dbf Add support for 1.13.2 forge 2019-03-02 12:26:53 +08:00
xfl03 65dacd8527 Fix javascript cannot expand 2019-03-01 20:31:23 +08:00
xfl03 d2d425e96e Remove 1.13 & 1.13.1 in settings.gradle 2019-03-01 20:10:50 +08:00
xfl03 0762e3e339 Remove support for vanilla 1.13 & 1.13.1 2019-03-01 20:08:22 +08:00
xfl03 4cb1e348bb Try to support 1.13 forge 2019-03-01 14:59:02 +08:00
Alexander Xia 7bbfd19bfd Fix no content cache 2019-02-06 00:39:17 +08:00
Alexander Xia be8b80bd55 Tweak CircleCI Docker Image 2019-01-05 00:20:22 +08:00
Alexander Xia 47de6d3a89 Add workaround for #42 2019-01-05 00:12:42 +08:00
Alexander Xia f78a3b2565 Add disable cape feature 2018-11-26 15:16:07 +08:00
Alexander Xia 016249c6ca Fix version display again 2018-11-25 02:33:12 +08:00
Alexander Xia 860edd2e1a Fix version display 2018-11-25 02:13:55 +08:00
Alexander Xia 3e6e444857 Fix gradle script buid again 2018-11-25 02:08:54 +08:00
Alexander Xia d67b7c6296 Fix gradle script buid again 2018-11-25 02:04:36 +08:00
Alexander Xia 94f6044c9a Fix gradle script build error 2018-11-25 01:53:28 +08:00
Alexander Xia 6b3531964e Tweak version json name 2018-11-25 01:44:06 +08:00
Alexander Xia fbd06f147a Modify gradle script 2018-11-24 01:38:49 +08:00
Alexander Xia e3020dad00 Add Upload Version json to COS 2018-11-23 03:23:17 +08:00
Alexander Xia 49fb976a2c Fix COS upload path 2018-11-23 02:48:19 +08:00
Alexander Xia 78bc4b5f7e Try to upload file to COS 2018-11-23 02:43:30 +08:00
Alexander Xia 7a3dc4f9c2 Support for 1.13.2 2018-11-02 14:48:07 +08:00
Alexander Xia 2087f7bb94 Tweak: Change Profile.json mirror 2018-09-23 23:44:25 +08:00
Alexander Xia e95edb16ac Add: Vanilla Support for 1.13.1 2018-09-23 23:00:34 +08:00
Alexander Xia 3b07b5ccca Update config version checker
Update config output
Add enableCape in config
2018-09-02 15:57:08 +08:00
xfl03 a3fb3cd770 Fix Build 2018-08-26 07:16:37 +08:00
xfl03 b7b59c0b85 Support ModLauncher 2018-08-26 07:04:25 +08:00
Alexander Xia db6b54732e Update MCP map to stable 2018-08-22 03:42:50 +08:00
Alexander Xia 09e3b81552 Fix path for ForgePlugin.log 2018-08-20 19:23:47 +08:00
Alexander Xia 2f494d295e Update Forge Version 2018-08-13 05:15:32 +08:00
Alexander Xia e8e3a72ae7 Add Fingerprint Violation 2018-08-13 05:11:47 +08:00
Alexander Xia ca8bd4e83d Add Profile.json for vanilla edition
Remove CustomSkinAPIPlusPrivacy
Fix typo in ReadMe
Update mcp map
2018-08-11 07:34:13 +08:00
Alexander Xia d789119c8f Get Ready for Forge 1.13 2018-07-26 20:50:41 +08:00
Alexander Xia bfd1b41ecc Update ReadMe
Thanks for @HeartyYF
2018-07-26 13:19:33 +08:00
Alexander Xia 5807acb34a Bump 14.9 2018-07-25 21:16:59 +08:00
Alexander Xia f319d535ae Merge branch '1.13-dev' into csl-14 2018-07-25 21:08:10 +08:00
Alexander Xia f669d095b6 Add Support for 1.13!
Thanks for MinecraftForge/MCPConfig.
2018-07-25 21:06:16 +08:00
Alexander Xia ca8b0ba185 Add FakeImage 2018-07-25 15:55:03 +08:00
Alexander Xia 7acef4d987 Fix Support for Java9
Add ElyBy in default load list
2018-07-20 23:23:37 +08:00
Alexander Xia 79404f659c Merge pull request #36 from andylizi/pr-replace
Replace the unnecessary `replaceAll` calls with `replace`
2018-07-13 22:36:31 +08:00
andylizi 85c86ff375 Replace the unnecessary replaceAll calls with replace 2018-07-13 19:48:02 +08:00
Alexander Xia f4030701ee Fix Legacy Texture cannot refresh in cache 2018-07-12 15:18:13 +08:00
Alexander Xia a36eca2a53 Add ElyByAPI 2018-07-09 19:53:35 +08:00
Alexander Xia 6ffdf2aafb Fix Spectator Menu totally 2018-07-02 00:15:03 +08:00
Alexander Xia fba9f7ca28 Fix head in Spectator Menu 2018-07-01 23:25:57 +08:00
Alexander Xia 2d157e3d5b Fix head is not loaded first time open Spectator Menu 2018-07-01 23:15:06 +08:00
Alexander Xia 055aef17db Fix ForgePlugin log 2018-06-25 00:56:47 +08:00
Alexander Xia 622e834d26 Make Code Better 2018-06-25 00:34:32 +08:00
Alexander Xia 469c8b62a9 Fix Noname skull load 2018-06-24 23:07:51 +08:00
Alexander Xia 1558ec819a Fix Crash in Spectator Menu 2018-06-24 22:59:46 +08:00
Alexander Xia 883e7b45fc Add skin model auto judge 2018-05-18 21:06:28 +08:00
Alexander Xia f30d3319b0 Reuse Vanilla Code 2018-05-06 01:10:55 +08:00
Alexander Xia 58276a7a0c Reuse Vanilla Code 2018-05-06 01:09:48 +08:00
Alexander Xia 883fb39380 Update Gradle Script
Fix local jsonAPI bug
https://minecraft.curseforge.com/projects/customskinloader?comment=10
2018-05-05 23:07:20 +08:00
Alexander Xia 1358a99f51 Merge pull request #35 from tnqzh123/csl-14
Update LittleSkin's API root
2018-04-10 23:39:31 +08:00
LittleStudio-Little_Qiu 47ea01dc39 Update API root 2018-04-10 23:29:45 +08:00
LittleStudio-Little_Qiu ee36f2f42a Update README.md
change link
2018-04-10 23:28:27 +08:00
90 changed files with 2908 additions and 1799 deletions

No files matched your search

+2 -1
View File
@@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/openjdk:8-jdk
- image: circleci/openjdk@sha256:7be33522f6f0ca65c2e78b22b1ef3e6739038494c1de1b8fb6d96da400dccf53
working_directory: ~/repo
@@ -26,6 +26,7 @@ jobs:
# Gradle
- run: gradle --version
- run: gradle clean build
- run: gradle upload
- store_artifacts:
path: ./build/libs
+14 -4
View File
@@ -1,3 +1,4 @@
# Java
*.class
# Mobile Tools for Java (J2ME)
@@ -11,16 +12,25 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
#VSCode
# VSCode
.vscode/
#eclipse
# eclipse
*/.classpath
.classpath
*/.project
.project
.settings/
*.launch
#gradle
# gradle
.gradle/
build/
build/
gradle/
gradlew*
run/
# IDEA
.idea/
*.iml
out/
-3
View File
@@ -1,3 +0,0 @@
/build/
/src/main/
-6
View File
@@ -1,6 +0,0 @@
minecraft_version=1.12
minecraft_full_versions=1.12
#forge gradle needs forge version
forge_mc_version=1.12
forge_version=14.21.1.2387
mappings_version=snapshot_20180203
@@ -1,402 +0,0 @@
package net.minecraft.client.gui;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.Ordering;
import com.mojang.authlib.GameProfile;
import java.util.Comparator;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.scoreboard.IScoreCriteria;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.GameType;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiPlayerTabOverlay extends Gui
{
private static final Ordering<NetworkPlayerInfo> ENTRY_ORDERING = Ordering.from(new GuiPlayerTabOverlay.PlayerComparator());
private final Minecraft mc;
private final GuiIngame guiIngame;
private ITextComponent footer;
private ITextComponent header;
/** The last time the playerlist was opened (went from not being renderd, to being rendered) */
private long lastTimeOpened;
/** Weither or not the playerlist is currently being rendered */
private boolean isBeingRendered;
public GuiPlayerTabOverlay(Minecraft mcIn, GuiIngame guiIngameIn)
{
this.mc = mcIn;
this.guiIngame = guiIngameIn;
}
/**
* Returns the name that should be renderd for the player supplied
*/
public String getPlayerName(NetworkPlayerInfo networkPlayerInfoIn)
{
return networkPlayerInfoIn.getDisplayName() != null ? networkPlayerInfoIn.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfoIn.getPlayerTeam(), networkPlayerInfoIn.getGameProfile().getName());
}
/**
* Called by GuiIngame to update the information stored in the playerlist, does not actually render the list,
* however.
*/
public void updatePlayerList(boolean willBeRendered)
{
if (willBeRendered && !this.isBeingRendered)
{
this.lastTimeOpened = Minecraft.getSystemTime();
}
this.isBeingRendered = willBeRendered;
}
/**
* Renders the playerlist, its background, headers and footers.
*/
public void renderPlayerlist(int width, Scoreboard scoreboardIn, @Nullable ScoreObjective scoreObjectiveIn)
{
NetHandlerPlayClient nethandlerplayclient = this.mc.player.connection;
List<NetworkPlayerInfo> list = ENTRY_ORDERING.<NetworkPlayerInfo>sortedCopy(nethandlerplayclient.getPlayerInfoMap());
int i = 0;
int j = 0;
for (NetworkPlayerInfo networkplayerinfo : list)
{
int k = this.mc.fontRenderer.getStringWidth(this.getPlayerName(networkplayerinfo));
i = Math.max(i, k);
if (scoreObjectiveIn != null && scoreObjectiveIn.getRenderType() != IScoreCriteria.EnumRenderType.HEARTS)
{
k = this.mc.fontRenderer.getStringWidth(" " + scoreboardIn.getOrCreateScore(networkplayerinfo.getGameProfile().getName(), scoreObjectiveIn).getScorePoints());
j = Math.max(j, k);
}
}
list = list.subList(0, Math.min(list.size(), 80));
int l3 = list.size();
int i4 = l3;
int j4;
for (j4 = 1; i4 > 20; i4 = (l3 + j4 - 1) / j4)
{
++j4;
}
//boolean flag = this.mc.isIntegratedServerRunning() || this.mc.getConnection().getNetworkManager().isEncrypted();
boolean flag = true;//Modified
int l;
if (scoreObjectiveIn != null)
{
if (scoreObjectiveIn.getRenderType() == IScoreCriteria.EnumRenderType.HEARTS)
{
l = 90;
}
else
{
l = j;
}
}
else
{
l = 0;
}
int i1 = Math.min(j4 * ((flag ? 9 : 0) + i + l + 13), width - 50) / j4;
int j1 = width / 2 - (i1 * j4 + (j4 - 1) * 5) / 2;
int k1 = 10;
int l1 = i1 * j4 + (j4 - 1) * 5;
List<String> list1 = null;
if (this.header != null)
{
list1 = this.mc.fontRenderer.listFormattedStringToWidth(this.header.getFormattedText(), width - 50);
for (String s : list1)
{
l1 = Math.max(l1, this.mc.fontRenderer.getStringWidth(s));
}
}
List<String> list2 = null;
if (this.footer != null)
{
list2 = this.mc.fontRenderer.listFormattedStringToWidth(this.footer.getFormattedText(), width - 50);
for (String s1 : list2)
{
l1 = Math.max(l1, this.mc.fontRenderer.getStringWidth(s1));
}
}
if (list1 != null)
{
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list1.size() * this.mc.fontRenderer.FONT_HEIGHT, Integer.MIN_VALUE);
for (String s2 : list1)
{
int i2 = this.mc.fontRenderer.getStringWidth(s2);
this.mc.fontRenderer.drawStringWithShadow(s2, (float)(width / 2 - i2 / 2), (float)k1, -1);
k1 += this.mc.fontRenderer.FONT_HEIGHT;
}
++k1;
}
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + i4 * 9, Integer.MIN_VALUE);
for (int k4 = 0; k4 < l3; ++k4)
{
int l4 = k4 / i4;
int i5 = k4 % i4;
int j2 = j1 + l4 * i1 + l4 * 5;
int k2 = k1 + i5 * 9;
drawRect(j2, k2, j2 + i1, k2 + 8, 553648127);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
if (k4 < list.size())
{
NetworkPlayerInfo networkplayerinfo1 = list.get(k4);
GameProfile gameprofile = networkplayerinfo1.getGameProfile();
if (flag)
{
EntityPlayer entityplayer = ((net.minecraft.world.World)this.mc.world).getPlayerEntityByUUID(gameprofile.getId());//Modified
boolean flag1 = entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.CAPE) && ("Dinnerbone".equals(gameprofile.getName()) || "Grumm".equals(gameprofile.getName()));
this.mc.getTextureManager().bindTexture(networkplayerinfo1.getLocationSkin());
int l2 = 8 + (flag1 ? 8 : 0);
int i3 = 8 * (flag1 ? -1 : 1);
Gui.drawScaledCustomSizeModalRect(j2, k2, 8.0F, (float)l2, 8, i3, 8, 8, 64.0F, 64.0F);
if (entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.HAT))
{
int j3 = 8 + (flag1 ? 8 : 0);
int k3 = 8 * (flag1 ? -1 : 1);
Gui.drawScaledCustomSizeModalRect(j2, k2, 40.0F, (float)j3, 8, k3, 8, 8, 64.0F, 64.0F);
}
j2 += 9;
}
String s4 = this.getPlayerName(networkplayerinfo1);
if (networkplayerinfo1.getGameType() == GameType.SPECTATOR)
{
this.mc.fontRenderer.drawStringWithShadow(TextFormatting.ITALIC + s4, (float)j2, (float)k2, -1862270977);
}
else
{
this.mc.fontRenderer.drawStringWithShadow(s4, (float)j2, (float)k2, -1);
}
if (scoreObjectiveIn != null && networkplayerinfo1.getGameType() != GameType.SPECTATOR)
{
int k5 = j2 + i + 1;
int l5 = k5 + l;
if (l5 - k5 > 5)
{
this.drawScoreboardValues(scoreObjectiveIn, k2, gameprofile.getName(), k5, l5, networkplayerinfo1);
}
}
this.drawPing(i1, j2 - (flag ? 9 : 0), k2, networkplayerinfo1);
}
}
if (list2 != null)
{
k1 = k1 + i4 * 9 + 1;
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list2.size() * this.mc.fontRenderer.FONT_HEIGHT, Integer.MIN_VALUE);
for (String s3 : list2)
{
int j5 = this.mc.fontRenderer.getStringWidth(s3);
this.mc.fontRenderer.drawStringWithShadow(s3, (float)(width / 2 - j5 / 2), (float)k1, -1);
k1 += this.mc.fontRenderer.FONT_HEIGHT;
}
}
}
protected void drawPing(int p_175245_1_, int p_175245_2_, int p_175245_3_, NetworkPlayerInfo networkPlayerInfoIn)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(ICONS);
int i = 0;
int j;
if (networkPlayerInfoIn.getResponseTime() < 0)
{
j = 5;
}
else if (networkPlayerInfoIn.getResponseTime() < 150)
{
j = 0;
}
else if (networkPlayerInfoIn.getResponseTime() < 300)
{
j = 1;
}
else if (networkPlayerInfoIn.getResponseTime() < 600)
{
j = 2;
}
else if (networkPlayerInfoIn.getResponseTime() < 1000)
{
j = 3;
}
else
{
j = 4;
}
this.zLevel += 100.0F;
this.drawTexturedModalRect(p_175245_2_ + p_175245_1_ - 11, p_175245_3_, 0, 176 + j * 8, 10, 8);
this.zLevel -= 100.0F;
}
private void drawScoreboardValues(ScoreObjective objective, int p_175247_2_, String name, int p_175247_4_, int p_175247_5_, NetworkPlayerInfo info)
{
int i = objective.getScoreboard().getOrCreateScore(name, objective).getScorePoints();
if (objective.getRenderType() == IScoreCriteria.EnumRenderType.HEARTS)
{
this.mc.getTextureManager().bindTexture(ICONS);
if (this.lastTimeOpened == info.getRenderVisibilityId())
{
if (i < info.getLastHealth())
{
info.setLastHealthTime(Minecraft.getSystemTime());
info.setHealthBlinkTime((long)(this.guiIngame.getUpdateCounter() + 20));
}
else if (i > info.getLastHealth())
{
info.setLastHealthTime(Minecraft.getSystemTime());
info.setHealthBlinkTime((long)(this.guiIngame.getUpdateCounter() + 10));
}
}
if (Minecraft.getSystemTime() - info.getLastHealthTime() > 1000L || this.lastTimeOpened != info.getRenderVisibilityId())
{
info.setLastHealth(i);
info.setDisplayHealth(i);
info.setLastHealthTime(Minecraft.getSystemTime());
}
info.setRenderVisibilityId(this.lastTimeOpened);
info.setLastHealth(i);
int j = MathHelper.ceil((float)Math.max(i, info.getDisplayHealth()) / 2.0F);
int k = Math.max(MathHelper.ceil((float)(i / 2)), Math.max(MathHelper.ceil((float)(info.getDisplayHealth() / 2)), 10));
boolean flag = info.getHealthBlinkTime() > (long)this.guiIngame.getUpdateCounter() && (info.getHealthBlinkTime() - (long)this.guiIngame.getUpdateCounter()) / 3L % 2L == 1L;
if (j > 0)
{
float f = Math.min((float)(p_175247_5_ - p_175247_4_ - 4) / (float)k, 9.0F);
if (f > 3.0F)
{
for (int l = j; l < k; ++l)
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)l * f, (float)p_175247_2_, flag ? 25 : 16, 0, 9, 9);
}
for (int j1 = 0; j1 < j; ++j1)
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, flag ? 25 : 16, 0, 9, 9);
if (flag)
{
if (j1 * 2 + 1 < info.getDisplayHealth())
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, 70, 0, 9, 9);
}
if (j1 * 2 + 1 == info.getDisplayHealth())
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, 79, 0, 9, 9);
}
}
if (j1 * 2 + 1 < i)
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, j1 >= 10 ? 160 : 52, 0, 9, 9);
}
if (j1 * 2 + 1 == i)
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, j1 >= 10 ? 169 : 61, 0, 9, 9);
}
}
}
else
{
float f1 = MathHelper.clamp((float)i / 20.0F, 0.0F, 1.0F);
int i1 = (int)((1.0F - f1) * 255.0F) << 16 | (int)(f1 * 255.0F) << 8;
String s = "" + (float)i / 2.0F;
if (p_175247_5_ - this.mc.fontRenderer.getStringWidth(s + "hp") >= p_175247_4_)
{
s = s + "hp";
}
this.mc.fontRenderer.drawStringWithShadow(s, (float)((p_175247_5_ + p_175247_4_) / 2 - this.mc.fontRenderer.getStringWidth(s) / 2), (float)p_175247_2_, i1);
}
}
}
else
{
String s1 = TextFormatting.YELLOW + "" + i;
this.mc.fontRenderer.drawStringWithShadow(s1, (float)(p_175247_5_ - this.mc.fontRenderer.getStringWidth(s1)), (float)p_175247_2_, 16777215);
}
}
public void setFooter(@Nullable ITextComponent footerIn)
{
this.footer = footerIn;
}
public void setHeader(@Nullable ITextComponent headerIn)
{
this.header = headerIn;
}
public void resetFooterHeader()
{
this.header = null;
this.footer = null;
}
@SideOnly(Side.CLIENT)
static class PlayerComparator implements Comparator<NetworkPlayerInfo>
{
private PlayerComparator()
{
}
public int compare(NetworkPlayerInfo p_compare_1_, NetworkPlayerInfo p_compare_2_)
{
ScorePlayerTeam scoreplayerteam = p_compare_1_.getPlayerTeam();
ScorePlayerTeam scoreplayerteam1 = p_compare_2_.getPlayerTeam();
return ComparisonChain.start().compareTrueFirst(p_compare_1_.getGameType() != GameType.SPECTATOR, p_compare_2_.getGameType() != GameType.SPECTATOR).compare(scoreplayerteam != null ? scoreplayerteam.getName() : "", scoreplayerteam1 != null ? scoreplayerteam1.getName() : "").compare(p_compare_1_.getGameProfile().getName(), p_compare_2_.getGameProfile().getName()).result();
}
}
}
@@ -1,54 +0,0 @@
package net.minecraft.client.gui.spectator;
import com.mojang.authlib.GameProfile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.network.play.client.CPacketSpectate;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class PlayerMenuObject implements ISpectatorMenuObject
{
private final GameProfile profile;
private final ResourceLocation resourceLocation;
public PlayerMenuObject(GameProfile profileIn)
{
this.profile = profileIn;
/*
this.resourceLocation = AbstractClientPlayer.getLocationSkin(profileIn.getName());
AbstractClientPlayer.getDownloadImageSkin(this.resourceLocation, profileIn.getName());
*/
this.resourceLocation = customskinloader.fake.FakeClientPlayer.getLocationSkin(profileIn.getName());
customskinloader.fake.FakeClientPlayer.getDownloadImageSkin(this.resourceLocation, profileIn.getName());
}
public void selectItem(SpectatorMenu menu)
{
Minecraft.getMinecraft().getConnection().sendPacket(new CPacketSpectate(this.profile.getId()));
}
public ITextComponent getSpectatorName()
{
return new TextComponentString(this.profile.getName());
}
public void renderIcon(float brightness, int alpha)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
public boolean isEnabled()
{
return true;
}
}
@@ -1,90 +0,0 @@
package net.minecraft.client.resources;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.Maps;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.InsecureTextureException;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.client.renderer.ImageBufferDownload;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
public class SkinManager
{
private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue());
private final TextureManager textureManager;
private final File skinCacheDir;
private final MinecraftSessionService sessionService;
private final LoadingCache<GameProfile, Map<Type, MinecraftProfileTexture>> skinCacheLoader;
private customskinloader.fake.FakeSkinManager fakeManager;//Fake Skin Manager
public SkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService)
{
this.textureManager = textureManagerInstance;
this.skinCacheDir = skinCacheDirectory;
this.sessionService = sessionService;
this.skinCacheLoader = CacheBuilder.newBuilder().expireAfterAccess(15L, TimeUnit.SECONDS).<GameProfile, Map<Type, MinecraftProfileTexture>>build(new CacheLoader<GameProfile, Map<Type, MinecraftProfileTexture>>()
{
public Map<Type, MinecraftProfileTexture> load(GameProfile p_load_1_) throws Exception
{
try
{
return Minecraft.getMinecraft().getSessionService().getTextures(p_load_1_, false);
}
catch (Throwable var3)
{
return Maps.<Type, MinecraftProfileTexture>newHashMap();
}
}
});
this.fakeManager=new customskinloader.fake.FakeSkinManager(textureManagerInstance,skinCacheDirectory,sessionService);
}
/**
* Used in the Skull renderer to fetch a skin. May download the skin if it's not in the cache
*/
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, Type textureType)
{
return this.loadSkin(profileTexture, textureType, (SkinManager.SkinAvailableCallback)null);
}
/**
* May download the skin if its not in the cache, can be passed a SkinManager#SkinAvailableCallback for handling
*/
public ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final Type textureType, @Nullable final SkinManager.SkinAvailableCallback skinAvailableCallback)
{
return this.fakeManager.loadSkin(profileTexture, textureType, skinAvailableCallback);
}
public void loadProfileTextures(final GameProfile profile, final SkinManager.SkinAvailableCallback skinAvailableCallback, final boolean requireSecure)
{
this.fakeManager.loadProfileTextures(profile, skinAvailableCallback, requireSecure);
}
public Map<Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile)
{
return this.fakeManager.loadSkinFromCache(profile);
}
public interface SkinAvailableCallback
{
void skinAvailable(Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture);
}
}
-6
View File
@@ -1,6 +0,0 @@
minecraft_version=1.12.1
minecraft_full_versions=1.12.1,1.12.2
#forge gradle needs forge version
forge_mc_version=1.12.2
forge_version=14.23.2.2611
mappings_version=snapshot_20180210
@@ -1,402 +0,0 @@
package net.minecraft.client.gui;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.Ordering;
import com.mojang.authlib.GameProfile;
import java.util.Comparator;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.scoreboard.IScoreCriteria;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.GameType;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiPlayerTabOverlay extends Gui
{
private static final Ordering<NetworkPlayerInfo> ENTRY_ORDERING = Ordering.from(new GuiPlayerTabOverlay.PlayerComparator());
private final Minecraft mc;
private final GuiIngame guiIngame;
private ITextComponent footer;
private ITextComponent header;
/** The last time the playerlist was opened (went from not being renderd, to being rendered) */
private long lastTimeOpened;
/** Weither or not the playerlist is currently being rendered */
private boolean isBeingRendered;
public GuiPlayerTabOverlay(Minecraft mcIn, GuiIngame guiIngameIn)
{
this.mc = mcIn;
this.guiIngame = guiIngameIn;
}
/**
* Returns the name that should be renderd for the player supplied
*/
public String getPlayerName(NetworkPlayerInfo networkPlayerInfoIn)
{
return networkPlayerInfoIn.getDisplayName() != null ? networkPlayerInfoIn.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfoIn.getPlayerTeam(), networkPlayerInfoIn.getGameProfile().getName());
}
/**
* Called by GuiIngame to update the information stored in the playerlist, does not actually render the list,
* however.
*/
public void updatePlayerList(boolean willBeRendered)
{
if (willBeRendered && !this.isBeingRendered)
{
this.lastTimeOpened = Minecraft.getSystemTime();
}
this.isBeingRendered = willBeRendered;
}
/**
* Renders the playerlist, its background, headers and footers.
*/
public void renderPlayerlist(int width, Scoreboard scoreboardIn, @Nullable ScoreObjective scoreObjectiveIn)
{
NetHandlerPlayClient nethandlerplayclient = this.mc.player.connection;
List<NetworkPlayerInfo> list = ENTRY_ORDERING.<NetworkPlayerInfo>sortedCopy(nethandlerplayclient.getPlayerInfoMap());
int i = 0;
int j = 0;
for (NetworkPlayerInfo networkplayerinfo : list)
{
int k = this.mc.fontRenderer.getStringWidth(this.getPlayerName(networkplayerinfo));
i = Math.max(i, k);
if (scoreObjectiveIn != null && scoreObjectiveIn.getRenderType() != IScoreCriteria.EnumRenderType.HEARTS)
{
k = this.mc.fontRenderer.getStringWidth(" " + scoreboardIn.getOrCreateScore(networkplayerinfo.getGameProfile().getName(), scoreObjectiveIn).getScorePoints());
j = Math.max(j, k);
}
}
list = list.subList(0, Math.min(list.size(), 80));
int l3 = list.size();
int i4 = l3;
int j4;
for (j4 = 1; i4 > 20; i4 = (l3 + j4 - 1) / j4)
{
++j4;
}
//boolean flag = this.mc.isIntegratedServerRunning() || this.mc.getConnection().getNetworkManager().isEncrypted();
boolean flag = true;//Modified
int l;
if (scoreObjectiveIn != null)
{
if (scoreObjectiveIn.getRenderType() == IScoreCriteria.EnumRenderType.HEARTS)
{
l = 90;
}
else
{
l = j;
}
}
else
{
l = 0;
}
int i1 = Math.min(j4 * ((flag ? 9 : 0) + i + l + 13), width - 50) / j4;
int j1 = width / 2 - (i1 * j4 + (j4 - 1) * 5) / 2;
int k1 = 10;
int l1 = i1 * j4 + (j4 - 1) * 5;
List<String> list1 = null;
if (this.header != null)
{
list1 = this.mc.fontRenderer.listFormattedStringToWidth(this.header.getFormattedText(), width - 50);
for (String s : list1)
{
l1 = Math.max(l1, this.mc.fontRenderer.getStringWidth(s));
}
}
List<String> list2 = null;
if (this.footer != null)
{
list2 = this.mc.fontRenderer.listFormattedStringToWidth(this.footer.getFormattedText(), width - 50);
for (String s1 : list2)
{
l1 = Math.max(l1, this.mc.fontRenderer.getStringWidth(s1));
}
}
if (list1 != null)
{
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list1.size() * this.mc.fontRenderer.FONT_HEIGHT, Integer.MIN_VALUE);
for (String s2 : list1)
{
int i2 = this.mc.fontRenderer.getStringWidth(s2);
this.mc.fontRenderer.drawStringWithShadow(s2, (float)(width / 2 - i2 / 2), (float)k1, -1);
k1 += this.mc.fontRenderer.FONT_HEIGHT;
}
++k1;
}
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + i4 * 9, Integer.MIN_VALUE);
for (int k4 = 0; k4 < l3; ++k4)
{
int l4 = k4 / i4;
int i5 = k4 % i4;
int j2 = j1 + l4 * i1 + l4 * 5;
int k2 = k1 + i5 * 9;
drawRect(j2, k2, j2 + i1, k2 + 8, 553648127);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
if (k4 < list.size())
{
NetworkPlayerInfo networkplayerinfo1 = list.get(k4);
GameProfile gameprofile = networkplayerinfo1.getGameProfile();
if (flag)
{
EntityPlayer entityplayer = ((net.minecraft.world.World)this.mc.world).getPlayerEntityByUUID(gameprofile.getId());//Modified
boolean flag1 = entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.CAPE) && ("Dinnerbone".equals(gameprofile.getName()) || "Grumm".equals(gameprofile.getName()));
this.mc.getTextureManager().bindTexture(networkplayerinfo1.getLocationSkin());
int l2 = 8 + (flag1 ? 8 : 0);
int i3 = 8 * (flag1 ? -1 : 1);
Gui.drawScaledCustomSizeModalRect(j2, k2, 8.0F, (float)l2, 8, i3, 8, 8, 64.0F, 64.0F);
if (entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.HAT))
{
int j3 = 8 + (flag1 ? 8 : 0);
int k3 = 8 * (flag1 ? -1 : 1);
Gui.drawScaledCustomSizeModalRect(j2, k2, 40.0F, (float)j3, 8, k3, 8, 8, 64.0F, 64.0F);
}
j2 += 9;
}
String s4 = this.getPlayerName(networkplayerinfo1);
if (networkplayerinfo1.getGameType() == GameType.SPECTATOR)
{
this.mc.fontRenderer.drawStringWithShadow(TextFormatting.ITALIC + s4, (float)j2, (float)k2, -1862270977);
}
else
{
this.mc.fontRenderer.drawStringWithShadow(s4, (float)j2, (float)k2, -1);
}
if (scoreObjectiveIn != null && networkplayerinfo1.getGameType() != GameType.SPECTATOR)
{
int k5 = j2 + i + 1;
int l5 = k5 + l;
if (l5 - k5 > 5)
{
this.drawScoreboardValues(scoreObjectiveIn, k2, gameprofile.getName(), k5, l5, networkplayerinfo1);
}
}
this.drawPing(i1, j2 - (flag ? 9 : 0), k2, networkplayerinfo1);
}
}
if (list2 != null)
{
k1 = k1 + i4 * 9 + 1;
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list2.size() * this.mc.fontRenderer.FONT_HEIGHT, Integer.MIN_VALUE);
for (String s3 : list2)
{
int j5 = this.mc.fontRenderer.getStringWidth(s3);
this.mc.fontRenderer.drawStringWithShadow(s3, (float)(width / 2 - j5 / 2), (float)k1, -1);
k1 += this.mc.fontRenderer.FONT_HEIGHT;
}
}
}
protected void drawPing(int p_175245_1_, int p_175245_2_, int p_175245_3_, NetworkPlayerInfo networkPlayerInfoIn)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(ICONS);
int i = 0;
int j;
if (networkPlayerInfoIn.getResponseTime() < 0)
{
j = 5;
}
else if (networkPlayerInfoIn.getResponseTime() < 150)
{
j = 0;
}
else if (networkPlayerInfoIn.getResponseTime() < 300)
{
j = 1;
}
else if (networkPlayerInfoIn.getResponseTime() < 600)
{
j = 2;
}
else if (networkPlayerInfoIn.getResponseTime() < 1000)
{
j = 3;
}
else
{
j = 4;
}
this.zLevel += 100.0F;
this.drawTexturedModalRect(p_175245_2_ + p_175245_1_ - 11, p_175245_3_, 0, 176 + j * 8, 10, 8);
this.zLevel -= 100.0F;
}
private void drawScoreboardValues(ScoreObjective objective, int p_175247_2_, String name, int p_175247_4_, int p_175247_5_, NetworkPlayerInfo info)
{
int i = objective.getScoreboard().getOrCreateScore(name, objective).getScorePoints();
if (objective.getRenderType() == IScoreCriteria.EnumRenderType.HEARTS)
{
this.mc.getTextureManager().bindTexture(ICONS);
if (this.lastTimeOpened == info.getRenderVisibilityId())
{
if (i < info.getLastHealth())
{
info.setLastHealthTime(Minecraft.getSystemTime());
info.setHealthBlinkTime((long)(this.guiIngame.getUpdateCounter() + 20));
}
else if (i > info.getLastHealth())
{
info.setLastHealthTime(Minecraft.getSystemTime());
info.setHealthBlinkTime((long)(this.guiIngame.getUpdateCounter() + 10));
}
}
if (Minecraft.getSystemTime() - info.getLastHealthTime() > 1000L || this.lastTimeOpened != info.getRenderVisibilityId())
{
info.setLastHealth(i);
info.setDisplayHealth(i);
info.setLastHealthTime(Minecraft.getSystemTime());
}
info.setRenderVisibilityId(this.lastTimeOpened);
info.setLastHealth(i);
int j = MathHelper.ceil((float)Math.max(i, info.getDisplayHealth()) / 2.0F);
int k = Math.max(MathHelper.ceil((float)(i / 2)), Math.max(MathHelper.ceil((float)(info.getDisplayHealth() / 2)), 10));
boolean flag = info.getHealthBlinkTime() > (long)this.guiIngame.getUpdateCounter() && (info.getHealthBlinkTime() - (long)this.guiIngame.getUpdateCounter()) / 3L % 2L == 1L;
if (j > 0)
{
float f = Math.min((float)(p_175247_5_ - p_175247_4_ - 4) / (float)k, 9.0F);
if (f > 3.0F)
{
for (int l = j; l < k; ++l)
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)l * f, (float)p_175247_2_, flag ? 25 : 16, 0, 9, 9);
}
for (int j1 = 0; j1 < j; ++j1)
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, flag ? 25 : 16, 0, 9, 9);
if (flag)
{
if (j1 * 2 + 1 < info.getDisplayHealth())
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, 70, 0, 9, 9);
}
if (j1 * 2 + 1 == info.getDisplayHealth())
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, 79, 0, 9, 9);
}
}
if (j1 * 2 + 1 < i)
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, j1 >= 10 ? 160 : 52, 0, 9, 9);
}
if (j1 * 2 + 1 == i)
{
this.drawTexturedModalRect((float)p_175247_4_ + (float)j1 * f, (float)p_175247_2_, j1 >= 10 ? 169 : 61, 0, 9, 9);
}
}
}
else
{
float f1 = MathHelper.clamp((float)i / 20.0F, 0.0F, 1.0F);
int i1 = (int)((1.0F - f1) * 255.0F) << 16 | (int)(f1 * 255.0F) << 8;
String s = "" + (float)i / 2.0F;
if (p_175247_5_ - this.mc.fontRenderer.getStringWidth(s + "hp") >= p_175247_4_)
{
s = s + "hp";
}
this.mc.fontRenderer.drawStringWithShadow(s, (float)((p_175247_5_ + p_175247_4_) / 2 - this.mc.fontRenderer.getStringWidth(s) / 2), (float)p_175247_2_, i1);
}
}
}
else
{
String s1 = TextFormatting.YELLOW + "" + i;
this.mc.fontRenderer.drawStringWithShadow(s1, (float)(p_175247_5_ - this.mc.fontRenderer.getStringWidth(s1)), (float)p_175247_2_, 16777215);
}
}
public void setFooter(@Nullable ITextComponent footerIn)
{
this.footer = footerIn;
}
public void setHeader(@Nullable ITextComponent headerIn)
{
this.header = headerIn;
}
public void resetFooterHeader()
{
this.header = null;
this.footer = null;
}
@SideOnly(Side.CLIENT)
static class PlayerComparator implements Comparator<NetworkPlayerInfo>
{
private PlayerComparator()
{
}
public int compare(NetworkPlayerInfo p_compare_1_, NetworkPlayerInfo p_compare_2_)
{
ScorePlayerTeam scoreplayerteam = p_compare_1_.getPlayerTeam();
ScorePlayerTeam scoreplayerteam1 = p_compare_2_.getPlayerTeam();
return ComparisonChain.start().compareTrueFirst(p_compare_1_.getGameType() != GameType.SPECTATOR, p_compare_2_.getGameType() != GameType.SPECTATOR).compare(scoreplayerteam != null ? scoreplayerteam.getName() : "", scoreplayerteam1 != null ? scoreplayerteam1.getName() : "").compare(p_compare_1_.getGameProfile().getName(), p_compare_2_.getGameProfile().getName()).result();
}
}
}
@@ -1,54 +0,0 @@
package net.minecraft.client.gui.spectator;
import com.mojang.authlib.GameProfile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.network.play.client.CPacketSpectate;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class PlayerMenuObject implements ISpectatorMenuObject
{
private final GameProfile profile;
private final ResourceLocation resourceLocation;
public PlayerMenuObject(GameProfile profileIn)
{
this.profile = profileIn;
/*
this.resourceLocation = AbstractClientPlayer.getLocationSkin(profileIn.getName());
AbstractClientPlayer.getDownloadImageSkin(this.resourceLocation, profileIn.getName());
*/
this.resourceLocation = customskinloader.fake.FakeClientPlayer.getLocationSkin(profileIn.getName());
customskinloader.fake.FakeClientPlayer.getDownloadImageSkin(this.resourceLocation, profileIn.getName());
}
public void selectItem(SpectatorMenu menu)
{
Minecraft.getMinecraft().getConnection().sendPacket(new CPacketSpectate(this.profile.getId()));
}
public ITextComponent getSpectatorName()
{
return new TextComponentString(this.profile.getName());
}
public void renderIcon(float brightness, int alpha)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
public boolean isEnabled()
{
return true;
}
}
File renamed without changes.
+498
View File
@@ -0,0 +1,498 @@
CL: net/minecraft/util/ResourceLocation qs
CL: net/minecraft/util/ResourceLocation$Serializer qs$a
CL: net/minecraft/util/StringUtils zy
CL: net/minecraft/client/renderer/texture/NativeImage cty
CL: net/minecraft/client/renderer/texture/NativeImage$1 cty$1
CL: net/minecraft/client/renderer/texture/NativeImage$PixelFormat cty$a
CL: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode cty$b
CL: net/minecraft/client/renderer/texture/NativeImage$WriteCallback cty$c
CL: net/minecraft/client/Minecraft cvk
CL: net/minecraft/client/Minecraft$1 cvk$1
CL: net/minecraft/client/Minecraft$2 cvk$2
CL: net/minecraft/client/multiplayer/ServerData dhq
CL: net/minecraft/client/multiplayer/ServerData$ServerResourceMode dhq$a
CL: net/minecraft/client/renderer/IImageBuffer dkl
CL: net/minecraft/client/renderer/ImageBufferDownload dkq
CL: net/minecraft/client/renderer/ThreadDownloadImageData dua
CL: net/minecraft/client/renderer/ThreadDownloadImageData$1 dua$1
CL: net/minecraft/client/renderer/texture/SimpleTexture duf
CL: net/minecraft/client/renderer/texture/SimpleTexture$TextureData duf$a
CL: net/minecraft/client/renderer/texture/TextureManager duk
CL: net/minecraft/client/renderer/texture/ITextureObject dul
CL: net/minecraft/client/resources/DefaultPlayerSkin dut
CL: net/minecraft/client/resources/SkinManager dvb
CL: net/minecraft/client/resources/SkinManager$1 dvb$1
CL: net/minecraft/client/resources/SkinManager$2 dvb$2
CL: net/minecraft/client/resources/SkinManager$SkinAvailableCallback dvb$a
FD: net/minecraft/util/ResourceLocation/field_110626_a qs/a
FD: net/minecraft/util/ResourceLocation/field_110625_b qs/b
FD: net/minecraft/util/ResourceLocation/field_200118_c qs/c
FD: net/minecraft/util/StringUtils/field_76339_a zy/a
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/RGBA cty$a/a
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/RGB cty$a/b
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/LUMINANCE_ALPHA cty$a/c
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/LUMINANCE cty$a/d
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211659_e cty$a/e
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211660_f cty$a/f
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211661_g cty$a/g
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211662_h cty$a/h
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211663_i cty$a/i
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211664_j cty$a/j
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211665_k cty$a/k
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211666_l cty$a/l
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211667_m cty$a/m
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211668_n cty$a/n
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211669_o cty$a/o
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211670_p cty$a/p
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/field_211671_q cty$a/q
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/$VALUES cty$a/r
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/RGBA cty$b/a
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/RGB cty$b/b
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/LUMINANCE_ALPHA cty$b/c
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/LUMINANCE cty$b/d
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/INTENSITY cty$b/e
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/field_211673_f cty$b/f
FD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/$VALUES cty$b/g
FD: net/minecraft/client/renderer/texture/NativeImage$WriteCallback/field_209268_a cty$c/a
FD: net/minecraft/client/renderer/texture/NativeImage$WriteCallback/field_209269_b cty$c/b
FD: net/minecraft/client/renderer/texture/NativeImage/field_209272_a cty/a
FD: net/minecraft/client/renderer/texture/NativeImage/field_211680_b cty/b
FD: net/minecraft/client/renderer/texture/NativeImage/field_195719_a cty/c
FD: net/minecraft/client/renderer/texture/NativeImage/field_195720_b cty/d
FD: net/minecraft/client/renderer/texture/NativeImage/field_195721_c cty/e
FD: net/minecraft/client/renderer/texture/NativeImage/field_195722_d cty/f
FD: net/minecraft/client/renderer/texture/NativeImage/field_195723_e cty/g
FD: net/minecraft/client/Minecraft$1/field_74532_a cvk$1/a
FD: net/minecraft/client/Minecraft$2/field_210222_a cvk$2/a
FD: net/minecraft/client/Minecraft$2/field_210223_b cvk$2/b
FD: net/minecraft/client/Minecraft/field_181542_y cvk/A
FD: net/minecraft/client/Minecraft/field_71426_K cvk/B
FD: net/minecraft/client/Minecraft/field_175612_E cvk/F
FD: net/minecraft/client/Minecraft/field_147123_G cvk/G
FD: net/minecraft/client/Minecraft/field_211120_F cvk/H
FD: net/minecraft/client/Minecraft/field_130070_K cvk/I
FD: net/minecraft/client/Minecraft/field_181038_N cvk/J
FD: net/minecraft/client/Minecraft/field_195556_O cvk/K
FD: net/minecraft/client/Minecraft/field_71422_O cvk/L
FD: net/minecraft/client/Minecraft/field_71446_o cvk/M
FD: net/minecraft/client/Minecraft/field_71432_P cvk/N
FD: net/minecraft/client/Minecraft/field_184131_U cvk/O
FD: net/minecraft/client/Minecraft/field_195557_T cvk/P
FD: net/minecraft/client/Minecraft/field_71434_R cvk/Q
FD: net/minecraft/client/Minecraft/field_71433_S cvk/R
FD: net/minecraft/client/Minecraft/field_181541_X cvk/S
FD: net/minecraft/client/Minecraft/field_71428_T cvk/T
FD: net/minecraft/client/Minecraft/field_71427_U cvk/U
FD: net/minecraft/client/Minecraft/field_175616_W cvk/V
FD: net/minecraft/client/Minecraft/field_175621_X cvk/W
FD: net/minecraft/client/Minecraft/field_175620_Y cvk/X
FD: net/minecraft/client/Minecraft/field_193995_ae cvk/Y
FD: net/minecraft/client/Minecraft/field_71449_j cvk/Z
FD: net/minecraft/client/Minecraft/field_142025_a cvk/a
FD: net/minecraft/client/Minecraft/field_211502_b cvk/b
FD: net/minecraft/client/Minecraft/field_71464_q cvk/c
FD: net/minecraft/client/Minecraft/field_213278_d cvk/d
FD: net/minecraft/client/Minecraft/field_71444_a cvk/e
FD: net/minecraft/client/Minecraft/field_71442_b cvk/f
FD: net/minecraft/client/Minecraft/field_195558_d cvk/g
FD: net/minecraft/client/Minecraft/field_71441_e cvk/h
FD: net/minecraft/client/Minecraft/field_71438_f cvk/i
FD: net/minecraft/client/Minecraft/field_71439_g cvk/j
FD: net/minecraft/client/Minecraft/field_175622_Z cvk/k
FD: net/minecraft/client/Minecraft/field_147125_j cvk/l
FD: net/minecraft/client/Minecraft/field_71452_i cvk/m
FD: net/minecraft/client/Minecraft/field_71466_p cvk/n
FD: net/minecraft/client/Minecraft/field_71462_r cvk/o
FD: net/minecraft/client/Minecraft/field_213279_p cvk/p
FD: net/minecraft/client/Minecraft/field_71460_t cvk/q
FD: net/minecraft/client/Minecraft/field_184132_p cvk/r
FD: net/minecraft/client/Minecraft/field_71429_W cvk/s
FD: net/minecraft/client/Minecraft/field_71456_v cvk/t
FD: net/minecraft/client/Minecraft/field_71454_w cvk/u
FD: net/minecraft/client/Minecraft/field_71476_x cvk/v
FD: net/minecraft/client/Minecraft/field_71474_y cvk/w
FD: net/minecraft/client/Minecraft/field_71417_B cvk/x
FD: net/minecraft/client/Minecraft/field_195559_v cvk/y
FD: net/minecraft/client/Minecraft/field_71412_D cvk/z
FD: net/minecraft/client/Minecraft/field_147124_at cvk/aA
FD: net/minecraft/client/Minecraft/field_147128_au cvk/aB
FD: net/minecraft/client/Minecraft/field_147127_av cvk/aC
FD: net/minecraft/client/Minecraft/field_147126_aw cvk/aD
FD: net/minecraft/client/Minecraft/field_211501_aD cvk/aE
FD: net/minecraft/client/Minecraft/field_213271_aF cvk/aF
FD: net/minecraft/client/Minecraft/field_152355_az cvk/aG
FD: net/minecraft/client/Minecraft/field_152350_aA cvk/aH
FD: net/minecraft/client/Minecraft/field_152352_aC cvk/aI
FD: net/minecraft/client/Minecraft/field_175617_aL cvk/aJ
FD: net/minecraft/client/Minecraft/field_175618_aM cvk/aK
FD: net/minecraft/client/Minecraft/field_213272_aL cvk/aL
FD: net/minecraft/client/Minecraft/field_213273_aM cvk/aM
FD: net/minecraft/client/Minecraft/field_193034_aS cvk/aN
FD: net/minecraft/client/Minecraft/field_213274_aO cvk/aO
FD: net/minecraft/client/Minecraft/field_71425_J cvk/aP
FD: net/minecraft/client/Minecraft/field_71419_L cvk/aQ
FD: net/minecraft/client/Minecraft/field_71420_M cvk/aR
FD: net/minecraft/client/Minecraft/field_193035_aW cvk/aS
FD: net/minecraft/client/Minecraft/field_195555_I cvk/aT
FD: net/minecraft/client/Minecraft/field_213275_aU cvk/aU
FD: net/minecraft/client/Minecraft/field_213276_aV cvk/aV
FD: net/minecraft/client/Minecraft/field_71465_an cvk/aW
FD: net/minecraft/client/Minecraft/field_71445_n cvk/aa
FD: net/minecraft/client/Minecraft/field_193996_ah cvk/ab
FD: net/minecraft/client/Minecraft/field_71437_Z cvk/ac
FD: net/minecraft/client/Minecraft/field_213277_ad cvk/ad
FD: net/minecraft/client/Minecraft/field_191950_u cvk/ae
FD: net/minecraft/client/Minecraft/field_110446_Y cvk/af
FD: net/minecraft/client/Minecraft/field_110447_Z cvk/ag
FD: net/minecraft/client/Minecraft/field_184130_ao cvk/ah
FD: net/minecraft/client/Minecraft/field_110453_aa cvk/ai
FD: net/minecraft/client/Minecraft/field_71469_aa cvk/aj
FD: net/minecraft/client/Minecraft/field_71470_ab cvk/ak
FD: net/minecraft/client/Minecraft/field_71467_ac cvk/al
FD: net/minecraft/client/Minecraft/field_71475_ae cvk/am
FD: net/minecraft/client/Minecraft/field_71477_af cvk/an
FD: net/minecraft/client/Minecraft/field_181543_z cvk/ao
FD: net/minecraft/client/Minecraft/field_147129_ai cvk/ap
FD: net/minecraft/client/Minecraft/field_71459_aj cvk/aq
FD: net/minecraft/client/Minecraft/field_71453_ak cvk/ar
FD: net/minecraft/client/Minecraft/field_71455_al cvk/as
FD: net/minecraft/client/Minecraft/field_71424_I cvk/at
FD: net/minecraft/client/Minecraft/field_110451_am cvk/au
FD: net/minecraft/client/Minecraft/field_195554_ax cvk/av
FD: net/minecraft/client/Minecraft/field_110448_aq cvk/aw
FD: net/minecraft/client/Minecraft/field_135017_as cvk/ax
FD: net/minecraft/client/Minecraft/field_184127_aH cvk/ay
FD: net/minecraft/client/Minecraft/field_184128_aI cvk/az
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/ENABLED dhq$a/a
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/DISABLED dhq$a/b
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/PROMPT dhq$a/c
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/field_152594_d dhq$a/d
FD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/$VALUES dhq$a/e
FD: net/minecraft/client/multiplayer/ServerData/field_78847_a dhq/a
FD: net/minecraft/client/multiplayer/ServerData/field_78845_b dhq/b
FD: net/minecraft/client/multiplayer/ServerData/field_78846_c dhq/c
FD: net/minecraft/client/multiplayer/ServerData/field_78843_d dhq/d
FD: net/minecraft/client/multiplayer/ServerData/field_78844_e dhq/e
FD: net/minecraft/client/multiplayer/ServerData/field_82821_f dhq/f
FD: net/minecraft/client/multiplayer/ServerData/field_82822_g dhq/g
FD: net/minecraft/client/multiplayer/ServerData/field_78841_f dhq/h
FD: net/minecraft/client/multiplayer/ServerData/field_147412_i dhq/i
FD: net/minecraft/client/multiplayer/ServerData/field_152587_j dhq/j
FD: net/minecraft/client/multiplayer/ServerData/field_147411_m dhq/k
FD: net/minecraft/client/multiplayer/ServerData/field_181042_l dhq/l
FD: net/minecraft/client/renderer/ThreadDownloadImageData$1/field_110932_a dua$1/a
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_147644_c dua/g
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_147643_d dua/h
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_152434_e dua/i
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_110562_b dua/j
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_110563_c dua/k
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_110561_e dua/l
FD: net/minecraft/client/renderer/ThreadDownloadImageData/field_110559_g dua/m
FD: net/minecraft/client/renderer/texture/SimpleTexture$TextureData/field_217802_a duf$a/a
FD: net/minecraft/client/renderer/texture/SimpleTexture$TextureData/field_217803_b duf$a/b
FD: net/minecraft/client/renderer/texture/SimpleTexture$TextureData/field_217804_c duf$a/c
FD: net/minecraft/client/renderer/texture/SimpleTexture/field_110568_b duf/f
FD: net/minecraft/client/renderer/texture/SimpleTexture/field_147639_c duf/g
FD: net/minecraft/client/renderer/texture/TextureManager/field_194008_a duk/a
FD: net/minecraft/client/renderer/texture/TextureManager/field_147646_a duk/b
FD: net/minecraft/client/renderer/texture/TextureManager/field_110585_a duk/c
FD: net/minecraft/client/renderer/texture/TextureManager/field_110583_b duk/d
FD: net/minecraft/client/renderer/texture/TextureManager/field_110584_c duk/e
FD: net/minecraft/client/renderer/texture/TextureManager/field_110582_d duk/f
FD: net/minecraft/client/resources/DefaultPlayerSkin/field_177337_a dut/a
FD: net/minecraft/client/resources/DefaultPlayerSkin/field_177336_b dut/b
FD: net/minecraft/client/resources/SkinManager$1/field_152787_a dvb$1/a
FD: net/minecraft/client/resources/SkinManager$2/field_152635_a dvb$2/a
FD: net/minecraft/client/resources/SkinManager$2/field_152636_b dvb$2/b
FD: net/minecraft/client/resources/SkinManager$2/field_152637_c dvb$2/c
FD: net/minecraft/client/resources/SkinManager$2/field_152638_d dvb$2/d
FD: net/minecraft/client/resources/SkinManager$2/field_177249_e dvb$2/e
FD: net/minecraft/client/resources/SkinManager$2/field_152639_e dvb$2/f
FD: net/minecraft/client/resources/SkinManager/field_152794_b dvb/a
FD: net/minecraft/client/resources/SkinManager/field_152795_c dvb/b
FD: net/minecraft/client/resources/SkinManager/field_152796_d dvb/c
FD: net/minecraft/client/resources/SkinManager/field_152797_e dvb/d
FD: net/minecraft/client/resources/SkinManager/field_152798_f dvb/e
MD: net/minecraft/util/ResourceLocation$Serializer/deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/minecraft/util/ResourceLocation; qs$a/a (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lqs;
MD: net/minecraft/util/ResourceLocation$Serializer/serialize (Lnet/minecraft/util/ResourceLocation;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement; qs$a/a (Lqs;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
MD: net/minecraft/util/ResourceLocation$Serializer/serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement; qs$a/serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
MD: net/minecraft/util/ResourceLocation$Serializer/deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object; qs$a/deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
MD: net/minecraft/util/ResourceLocation/func_110623_a ()Ljava/lang/String; qs/a ()Ljava/lang/String;
MD: net/minecraft/util/ResourceLocation/func_195824_a (C)Z qs/a (C)Z
MD: net/minecraft/util/ResourceLocation/func_217859_a (I)Z qs/a (I)Z
MD: net/minecraft/util/ResourceLocation/func_195826_a (Lcom/mojang/brigadier/StringReader;)Lnet/minecraft/util/ResourceLocation; qs/a (Lcom/mojang/brigadier/StringReader;)Lqs;
MD: net/minecraft/util/ResourceLocation/func_208304_a (Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation; qs/a (Ljava/lang/String;)Lqs;
MD: net/minecraft/util/ResourceLocation/func_195828_a (Ljava/lang/String;C)Lnet/minecraft/util/ResourceLocation; qs/a (Ljava/lang/String;C)Lqs;
MD: net/minecraft/util/ResourceLocation/compareTo (Lnet/minecraft/util/ResourceLocation;)I qs/a (Lqs;)I
MD: net/minecraft/util/ResourceLocation/func_110624_b ()Ljava/lang/String; qs/b ()Ljava/lang/String;
MD: net/minecraft/util/ResourceLocation/func_217857_b (I)Z qs/b (I)Z
MD: net/minecraft/util/ResourceLocation/func_217855_b (Ljava/lang/String;)Z qs/b (Ljava/lang/String;)Z
MD: net/minecraft/util/ResourceLocation/func_195823_b (Ljava/lang/String;C)[Ljava/lang/String; qs/b (Ljava/lang/String;C)[Ljava/lang/String;
MD: net/minecraft/util/ResourceLocation/func_217856_c (Ljava/lang/String;)Z qs/c (Ljava/lang/String;)Z
MD: net/minecraft/util/ResourceLocation/func_217858_d (Ljava/lang/String;)Z qs/d (Ljava/lang/String;)Z
MD: net/minecraft/util/ResourceLocation/equals (Ljava/lang/Object;)Z qs/equals (Ljava/lang/Object;)Z
MD: net/minecraft/util/ResourceLocation/hashCode ()I qs/hashCode ()I
MD: net/minecraft/util/ResourceLocation/toString ()Ljava/lang/String; qs/toString ()Ljava/lang/String;
MD: net/minecraft/util/ResourceLocation/compareTo (Ljava/lang/Object;)I qs/compareTo (Ljava/lang/Object;)I
MD: net/minecraft/util/StringUtils/func_76337_a (I)Ljava/lang/String; zy/a (I)Ljava/lang/String;
MD: net/minecraft/util/StringUtils/func_76338_a (Ljava/lang/String;)Ljava/lang/String; zy/a (Ljava/lang/String;)Ljava/lang/String;
MD: net/minecraft/util/StringUtils/func_151246_b (Ljava/lang/String;)Z zy/b (Ljava/lang/String;)Z
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211651_a ()I cty$a/a ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211652_a (I)Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; cty$a/a (I)Lcty$a;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211655_a (Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat;)I cty$a/a (Lcty$a;)I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211656_b ()V cty$a/b ()V
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211646_b (I)Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; cty$a/b (I)Lcty$a;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211658_c ()V cty$a/c ()V
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211650_d ()I cty$a/d ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211645_i ()Z cty$a/e ()Z
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211648_n ()I cty$a/f ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211653_r ()Z cty$a/g ()Z
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211647_v ()I cty$a/h ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/func_211654_w ()Z cty$a/i ()Z
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/values ()[Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; cty$a/values ()[Lcty$a;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormat/valueOf (Ljava/lang/String;)Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; cty$a/valueOf (Ljava/lang/String;)Lcty$a;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/func_211672_a ()I cty$b/a ()I
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/values ()[Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode; cty$b/values ()[Lcty$b;
MD: net/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode/valueOf (Ljava/lang/String;)Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormatGLCode; cty$b/valueOf (Ljava/lang/String;)Lcty$b;
MD: net/minecraft/client/renderer/texture/NativeImage$WriteCallback/func_209267_a ()V cty$c/a ()V
MD: net/minecraft/client/renderer/texture/NativeImage$WriteCallback/invoke (JJI)V cty$c/invoke (JJI)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195702_a ()I cty/a ()I
MD: net/minecraft/client/renderer/texture/NativeImage/func_195709_a (II)I cty/a (II)I
MD: net/minecraft/client/renderer/texture/NativeImage/func_195700_a (III)V cty/a (III)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195715_a (IIIII)V cty/a (IIIII)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195706_a (IIIIIIIZ)V cty/a (IIIIIIIZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195712_a (IIIIIIIZZZ)V cty/a (IIIIIIIZZZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195699_a (IIIIIIZZ)V cty/a (IIIIIIZZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195708_a (IIIILnet/minecraft/client/renderer/texture/NativeImage;)V cty/a (IIIILcty;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195697_a (IIIZ)V cty/a (IIIZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195717_a (IZ)V cty/a (IZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_211679_a (Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat;Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; cty/a (Lcty$a;Ljava/io/InputStream;)Lcty;
MD: net/minecraft/client/renderer/texture/NativeImage/func_211677_a (Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat;Ljava/nio/ByteBuffer;)Lnet/minecraft/client/renderer/texture/NativeImage; cty/a (Lcty$a;Ljava/nio/ByteBuffer;)Lcty;
MD: net/minecraft/client/renderer/texture/NativeImage/func_195703_a (Lnet/minecraft/client/renderer/texture/NativeImage;)V cty/a (Lcty;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_209271_a (Ljava/io/File;)V cty/a (Ljava/io/File;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195713_a (Ljava/io/InputStream;)Lnet/minecraft/client/renderer/texture/NativeImage; cty/a (Ljava/io/InputStream;)Lcty;
MD: net/minecraft/client/renderer/texture/NativeImage/func_216510_a (Ljava/lang/String;)V cty/a (Ljava/lang/String;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195704_a (Ljava/nio/ByteBuffer;)Lnet/minecraft/client/renderer/texture/NativeImage; cty/a (Ljava/nio/ByteBuffer;)Lcty;
MD: net/minecraft/client/renderer/texture/NativeImage/func_209270_a (Ljava/nio/file/Path;)V cty/a (Ljava/nio/file/Path;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_211676_a (Lorg/lwjgl/stb/STBTTFontinfo;IIIFFFFII)V cty/a (Lorg/lwjgl/stb/STBTTFontinfo;IIIFFFFII)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195701_a (Z)V cty/a (Z)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195705_a (ZZ)V cty/a (ZZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195714_b ()I cty/b ()I
MD: net/minecraft/client/renderer/texture/NativeImage/func_211675_e (II)B cty/b (II)B
MD: net/minecraft/client/renderer/texture/NativeImage/func_195718_b (III)V cty/b (III)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_216511_b (Ljava/lang/String;)Lnet/minecraft/client/renderer/texture/NativeImage; cty/b (Ljava/lang/String;)Lcty;
MD: net/minecraft/client/renderer/texture/NativeImage/func_195707_b (Z)V cty/b (Z)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_211678_c ()Lnet/minecraft/client/renderer/texture/NativeImage$PixelFormat; cty/c ()Lcty$a;
MD: net/minecraft/client/renderer/texture/NativeImage/func_195716_c ()[I cty/d ()[I
MD: net/minecraft/client/renderer/texture/NativeImage/func_195710_e ()V cty/e ()V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195711_f ()V cty/f ()V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195696_g ()V cty/g ()V
MD: net/minecraft/client/renderer/texture/NativeImage/close ()V cty/close ()V
MD: net/minecraft/client/renderer/texture/NativeImage/toString ()Ljava/lang/String; cty/toString ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft$1/run ()V cvk$1/run ()V
MD: net/minecraft/client/Minecraft/func_71401_C ()Lnet/minecraft/server/integrated/IntegratedServer; cvk/A ()Ldxk;
MD: net/minecraft/client/Minecraft/func_71378_E ()Lnet/minecraft/profiler/Snooper; cvk/B ()Lahk;
MD: net/minecraft/client/Minecraft/func_110432_I ()Lnet/minecraft/util/Session; cvk/C ()Lcvv;
MD: net/minecraft/client/Minecraft/func_181037_M ()Lcom/mojang/authlib/properties/PropertyMap; cvk/D ()Lcom/mojang/authlib/properties/PropertyMap;
MD: net/minecraft/client/Minecraft/func_110437_J ()Ljava/net/Proxy; cvk/E ()Ljava/net/Proxy;
MD: net/minecraft/client/Minecraft/func_110434_K ()Lnet/minecraft/client/renderer/texture/TextureManager; cvk/F ()Lduk;
MD: net/minecraft/client/Minecraft/func_195551_G ()Lnet/minecraft/resources/IResourceManager; cvk/G ()Lxe;
MD: net/minecraft/client/Minecraft/func_195548_H ()Lnet/minecraft/resources/ResourcePackList; cvk/H ()Lwt;
MD: net/minecraft/client/Minecraft/func_195541_I ()Lnet/minecraft/client/resources/DownloadingPackFinder; cvk/I ()Ldur;
MD: net/minecraft/client/Minecraft/func_195549_J ()Ljava/io/File; cvk/J ()Ljava/io/File;
MD: net/minecraft/client/Minecraft/func_135016_M ()Lnet/minecraft/client/resources/LanguageManager; cvk/K ()Ldvh;
MD: net/minecraft/client/Minecraft/func_147117_R ()Lnet/minecraft/client/renderer/texture/AtlasTexture; cvk/L ()Ldui;
MD: net/minecraft/client/Minecraft/func_147111_S ()Z cvk/M ()Z
MD: net/minecraft/client/Minecraft/func_147113_T ()Z cvk/N ()Z
MD: net/minecraft/client/Minecraft/func_147118_V ()Lnet/minecraft/client/audio/SoundHandler; cvk/O ()Ldxx;
MD: net/minecraft/client/Minecraft/func_147109_W ()Lnet/minecraft/client/audio/MusicTicker$MusicType; cvk/P ()Ldxs$a;
MD: net/minecraft/client/Minecraft/func_152347_ac ()Lcom/mojang/authlib/minecraft/MinecraftSessionService; cvk/R ()Lcom/mojang/authlib/minecraft/MinecraftSessionService;
MD: net/minecraft/client/Minecraft/func_152342_ad ()Lnet/minecraft/client/resources/SkinManager; cvk/S ()Ldvb;
MD: net/minecraft/client/Minecraft/func_175606_aa ()Lnet/minecraft/entity/Entity; cvk/T ()Laii;
MD: net/minecraft/client/Minecraft/func_175602_ab ()Lnet/minecraft/client/renderer/BlockRendererDispatcher; cvk/U ()Ldle;
MD: net/minecraft/client/Minecraft/func_175598_ae ()Lnet/minecraft/client/renderer/entity/EntityRendererManager; cvk/V ()Ldpi;
MD: net/minecraft/client/Minecraft/func_175599_af ()Lnet/minecraft/client/renderer/ItemRenderer; cvk/W ()Ldqd;
MD: net/minecraft/client/Minecraft/func_175597_ag ()Lnet/minecraft/client/renderer/FirstPersonRenderer; cvk/X ()Ldkm;
MD: net/minecraft/client/Minecraft/func_175610_ah ()I cvk/Y ()I
MD: net/minecraft/client/Minecraft/func_181539_aj ()Lnet/minecraft/util/FrameTimer; cvk/Z ()Lzl;
MD: net/minecraft/client/Minecraft/func_213226_a ()V cvk/a ()V
MD: net/minecraft/client/Minecraft/func_71383_b (I)V cvk/a (I)V
MD: net/minecraft/client/Minecraft/func_195545_a (IJ)V cvk/a (IJ)V
MD: net/minecraft/client/Minecraft/func_70000_a (Lnet/minecraft/profiler/Snooper;)V cvk/a (Lahk;)V
MD: net/minecraft/client/Minecraft/func_175607_a (Lnet/minecraft/entity/Entity;)V cvk/a (Laii;)V
MD: net/minecraft/client/Minecraft/func_213235_a (Lnet/minecraft/item/ItemStack;)Ljava/util/stream/Stream; cvk/a (Lbcb;)Ljava/util/stream/Stream;
MD: net/minecraft/client/Minecraft/func_184119_a (Lnet/minecraft/item/ItemStack;Lnet/minecraft/tileentity/TileEntity;)Lnet/minecraft/item/ItemStack; cvk/a (Lbcb;Lbtn;)Lbcb;
MD: net/minecraft/client/Minecraft/func_213244_a (Lnet/minecraft/item/crafting/IRecipe;)Lnet/minecraft/util/ResourceLocation; cvk/a (Lbej;)Lqs;
MD: net/minecraft/client/Minecraft/access$000 (Lnet/minecraft/client/Minecraft;)Z cvk/a (Lcvk;)Z
MD: net/minecraft/client/Minecraft/func_213268_a (Lnet/minecraft/client/gui/LoadingGui;)V cvk/a (Lczo;)V
MD: net/minecraft/client/Minecraft/func_147108_a (Lnet/minecraft/client/gui/screen/Screen;)V cvk/a (Lczt;)V
MD: net/minecraft/client/Minecraft/func_71404_a (Lnet/minecraft/crash/CrashReport;)V cvk/a (Ld;)V
MD: net/minecraft/client/Minecraft/func_213258_a (Lnet/minecraft/client/gui/recipebook/RecipeList;)Ljava/util/stream/Stream; cvk/a (Ldck;)Ljava/util/stream/Stream;
MD: net/minecraft/client/Minecraft/func_71403_a (Lnet/minecraft/client/world/ClientWorld;)V cvk/a (Ldhn;)V
MD: net/minecraft/client/Minecraft/func_71351_a (Lnet/minecraft/client/multiplayer/ServerData;)V cvk/a (Ldhq;)V
MD: net/minecraft/client/Minecraft/func_213232_a (Lnet/minecraft/client/util/SearchTree;Lnet/minecraft/client/util/SearchTreeReloadable;Lnet/minecraft/item/ItemStack;)V cvk/a (Ldxe;Ldxd;Lbcb;)V
MD: net/minecraft/client/Minecraft/func_213253_a (Lnet/minecraft/client/util/SearchTreeManager$Key;)Lnet/minecraft/client/util/IMutableSearchTree; cvk/a (Ldxf$a;)Ldxc;
MD: net/minecraft/client/Minecraft/func_213238_a (Ljava/lang/String;)Z cvk/a (Ljava/lang/String;)Z
MD: net/minecraft/client/Minecraft/func_71371_a (Ljava/lang/String;Ljava/lang/String;Lnet/minecraft/world/WorldSettings;)V cvk/a (Ljava/lang/String;Ljava/lang/String;Lbhm;)V
MD: net/minecraft/client/Minecraft/func_213262_a (Ljava/lang/String;ZLjava/util/function/Supplier;Lnet/minecraft/resources/IResourcePack;Lnet/minecraft/resources/data/PackMetadataSection;Lnet/minecraft/resources/ResourcePackInfo$Priority;)Lnet/minecraft/client/resources/ClientResourcePackInfo; cvk/a (Ljava/lang/String;ZLjava/util/function/Supplier;Lwh;Lwm;Lww$a;)Ldve;
MD: net/minecraft/client/Minecraft/func_213236_a (Ljava/util/List;Ljava/util/concurrent/CompletableFuture;)V cvk/a (Ljava/util/List;Ljava/util/concurrent/CompletableFuture;)V
MD: net/minecraft/client/Minecraft/func_213240_a (Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletionStage; cvk/a (Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletionStage;
MD: net/minecraft/client/Minecraft/func_213228_a (Z)V cvk/a (Z)V
MD: net/minecraft/client/Minecraft/func_99999_d ()V cvk/b ()V
MD: net/minecraft/client/Minecraft/func_213246_b (I)Lnet/minecraft/world/chunk/listener/IChunkStatusListener; cvk/b (I)Lvp;
MD: net/minecraft/client/Minecraft/func_213251_b (Lnet/minecraft/item/ItemStack;)Ljava/util/stream/Stream; cvk/b (Lbcb;)Ljava/util/stream/Stream;
MD: net/minecraft/client/Minecraft/func_213234_b (Lnet/minecraft/item/crafting/IRecipe;)Ljava/util/stream/Stream; cvk/b (Lbej;)Ljava/util/stream/Stream;
MD: net/minecraft/client/Minecraft/func_213231_b (Lnet/minecraft/client/gui/screen/Screen;)V cvk/b (Lczt;)V
MD: net/minecraft/client/Minecraft/func_71396_d (Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport; cvk/b (Ld;)Ld;
MD: net/minecraft/client/Minecraft/func_213252_b (Lnet/minecraft/client/gui/recipebook/RecipeList;)Ljava/util/stream/Stream; cvk/b (Ldck;)Ljava/util/stream/Stream;
MD: net/minecraft/client/Minecraft/func_213257_b (Lnet/minecraft/client/world/ClientWorld;)V cvk/b (Ldhn;)V
MD: net/minecraft/client/Minecraft/func_213267_b (Ljava/lang/String;)Z cvk/b (Ljava/lang/String;)Z
MD: net/minecraft/client/Minecraft/func_213265_b (Ljava/util/concurrent/CompletableFuture;)V cvk/b (Ljava/util/concurrent/CompletableFuture;)V
MD: net/minecraft/client/Minecraft/func_213270_b (Ljava/util/function/Supplier;)Lnet/minecraft/resources/IResourcePack; cvk/b (Ljava/util/function/Supplier;)Lwh;
MD: net/minecraft/client/Minecraft/func_213261_b (Lnet/minecraft/util/text/ITextComponent;)V cvk/b (Ljm;)V
MD: net/minecraft/client/Minecraft/func_213227_b (Z)V cvk/b (Z)V
MD: net/minecraft/client/Minecraft/func_147110_a ()Lnet/minecraft/client/shader/Framebuffer; cvk/c ()Lcto;
MD: net/minecraft/client/Minecraft/func_213242_c (Lnet/minecraft/item/ItemStack;)Ljava/util/stream/Stream; cvk/c (Lbcb;)Ljava/util/stream/Stream;
MD: net/minecraft/client/Minecraft/func_213241_c (Lnet/minecraft/client/gui/screen/Screen;)V cvk/c (Lczt;)V
MD: net/minecraft/client/Minecraft/func_71377_b (Lnet/minecraft/crash/CrashReport;)V cvk/c (Ld;)V
MD: net/minecraft/client/Minecraft/func_212874_c_ (Ljava/lang/Runnable;)Z cvk/c (Ljava/lang/Runnable;)Z
MD: net/minecraft/client/Minecraft/func_213264_c (Lnet/minecraft/util/text/ITextComponent;)Ljava/lang/String; cvk/c (Ljm;)Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_71385_j (Z)V cvk/c (Z)V
MD: net/minecraft/client/Minecraft/func_175600_c ()Ljava/lang/String; cvk/d ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_212875_d_ (Ljava/lang/Runnable;)Ljava/lang/Runnable; cvk/d (Ljava/lang/Runnable;)Ljava/lang/Runnable;
MD: net/minecraft/client/Minecraft/func_213230_d (Lnet/minecraft/util/text/ITextComponent;)Ljava/lang/String; cvk/d (Ljm;)Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_181537_a (Z)V cvk/d (Z)V
MD: net/minecraft/client/Minecraft/func_184123_d ()Ljava/lang/String; cvk/e ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_195542_b (Z)V cvk/e (Z)V
MD: net/minecraft/client/Minecraft/func_211821_e ()Z cvk/f ()Z
MD: net/minecraft/client/Minecraft/func_147115_a (Z)V cvk/f (Z)V
MD: net/minecraft/client/Minecraft/func_213237_g ()Ljava/util/concurrent/CompletableFuture; cvk/g ()Ljava/util/concurrent/CompletableFuture;
MD: net/minecraft/client/Minecraft/func_71359_d ()Lnet/minecraft/world/storage/SaveFormat; cvk/h ()Lcof;
MD: net/minecraft/client/Minecraft/func_71405_e ()V cvk/i ()V
MD: net/minecraft/client/Minecraft/func_71398_f ()V cvk/j ()V
MD: net/minecraft/client/Minecraft/func_71400_g ()V cvk/k ()V
MD: net/minecraft/client/Minecraft/func_181535_r ()Lnet/minecraft/client/audio/MusicTicker; cvk/l ()Ldxs;
MD: net/minecraft/client/Minecraft/func_71407_l ()V cvk/m ()V
MD: net/minecraft/client/Minecraft/func_213254_o ()V cvk/n ()V
MD: net/minecraft/client/Minecraft/func_71355_q ()Z cvk/o ()Z
MD: net/minecraft/client/Minecraft/func_147114_u ()Lnet/minecraft/client/network/play/ClientPlayNetHandler; cvk/q ()Ldhk;
MD: net/minecraft/client/Minecraft/func_71382_s ()Z cvk/r ()Z
MD: net/minecraft/client/Minecraft/func_71375_t ()Z cvk/s ()Z
MD: net/minecraft/client/Minecraft/func_71379_u ()Z cvk/t ()Z
MD: net/minecraft/client/Minecraft/func_71410_x ()Lnet/minecraft/client/Minecraft; cvk/u ()Lcvk;
MD: net/minecraft/client/Minecraft/func_213245_w ()Ljava/util/concurrent/CompletableFuture; cvk/v ()Ljava/util/concurrent/CompletableFuture;
MD: net/minecraft/client/Minecraft/func_71369_N ()I cvk/w ()I
MD: net/minecraft/client/Minecraft/func_147104_D ()Lnet/minecraft/client/multiplayer/ServerData; cvk/x ()Ldhq;
MD: net/minecraft/client/Minecraft/func_71387_A ()Z cvk/y ()Z
MD: net/minecraft/client/Minecraft/func_71356_B ()Z cvk/z ()Z
MD: net/minecraft/client/Minecraft/func_213256_aB ()V cvk/aA ()V
MD: net/minecraft/client/Minecraft/func_213243_aC ()I cvk/aB ()I
MD: net/minecraft/client/Minecraft/func_213266_aD ()Z cvk/aC ()Z
MD: net/minecraft/client/Minecraft/func_203410_as ()V cvk/aD ()V
MD: net/minecraft/client/Minecraft/func_147116_af ()V cvk/aE ()V
MD: net/minecraft/client/Minecraft/func_147121_ag ()V cvk/aF ()V
MD: net/minecraft/client/Minecraft/func_184117_aA ()V cvk/aG ()V
MD: net/minecraft/client/Minecraft/func_147112_ai ()V cvk/aH ()V
MD: net/minecraft/client/Minecraft/func_181538_aA ()Ljava/lang/String; cvk/aI ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_213255_aK ()Ljava/lang/String; cvk/aJ ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_213259_aL ()Ljava/lang/String; cvk/aK ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_211822_az ()Ljava/lang/String; cvk/aL ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_211816_aA ()Ljava/lang/String; cvk/aM ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_211112_aw ()Ljava/lang/String; cvk/aN ()Ljava/lang/String;
MD: net/minecraft/client/Minecraft/func_213249_aP ()Z cvk/aO ()Z
MD: net/minecraft/client/Minecraft/func_213233_aQ ()V cvk/aP ()V
MD: net/minecraft/client/Minecraft/func_213260_aR ()V cvk/aQ ()V
MD: net/minecraft/client/Minecraft/func_213247_aS ()I cvk/aR ()I
MD: net/minecraft/client/Minecraft/func_181540_al ()Z cvk/aa ()Z
MD: net/minecraft/client/Minecraft/func_184126_aj ()Lcom/mojang/datafixers/DataFixer; cvk/ab ()Lcom/mojang/datafixers/DataFixer;
MD: net/minecraft/client/Minecraft/func_184121_ak ()F cvk/ac ()F
MD: net/minecraft/client/Minecraft/func_193989_ak ()F cvk/ad ()F
MD: net/minecraft/client/Minecraft/func_184125_al ()Lnet/minecraft/client/renderer/color/BlockColors; cvk/ae ()Lcvx;
MD: net/minecraft/client/Minecraft/func_189648_am ()Z cvk/ag ()Z
MD: net/minecraft/client/Minecraft/func_193033_an ()Lnet/minecraft/client/gui/toasts/ToastGui; cvk/ah ()Lcxv;
MD: net/minecraft/client/Minecraft/func_193032_ao ()Lnet/minecraft/client/tutorial/Tutorial; cvk/ai ()Ldyh;
MD: net/minecraft/client/Minecraft/func_195544_aj ()Z cvk/aj ()Z
MD: net/minecraft/client/Minecraft/func_199403_al ()Lnet/minecraft/client/settings/CreativeSettings; cvk/ak ()Lcvg;
MD: net/minecraft/client/Minecraft/func_209506_al ()Lnet/minecraft/client/renderer/model/ModelManager; cvk/al ()Ldwb;
MD: net/minecraft/client/Minecraft/func_211500_ak ()Lnet/minecraft/client/gui/fonts/FontResourceManager; cvk/am ()Lcxz;
MD: net/minecraft/client/Minecraft/func_213263_ao ()Lnet/minecraft/client/renderer/texture/PaintingSpriteUploader; cvk/an ()Ldva;
MD: net/minecraft/client/Minecraft/func_213248_ap ()Lnet/minecraft/client/renderer/texture/PotionSpriteUploader; cvk/ao ()Lduz;
MD: net/minecraft/client/Minecraft/func_213239_aq ()Lnet/minecraft/profiler/IProfiler; cvk/ap ()Lagh;
MD: net/minecraft/client/Minecraft/func_213229_ar ()Lnet/minecraft/client/MinecraftGame; cvk/aq ()Lcve;
MD: net/minecraft/client/Minecraft/func_213269_at ()Lnet/minecraft/client/util/Splashes; cvk/as ()Ldvc;
MD: net/minecraft/client/Minecraft/func_213250_au ()Lnet/minecraft/client/gui/LoadingGui; cvk/at ()Lczo;
MD: net/minecraft/client/Minecraft/func_71384_a ()V cvk/au ()V
MD: net/minecraft/client/Minecraft/func_193986_ar ()V cvk/av ()V
MD: net/minecraft/client/Minecraft/func_213170_ax ()Ljava/lang/Thread; cvk/ax ()Ljava/lang/Thread;
MD: net/minecraft/client/Minecraft/func_147122_X ()Z cvk/ay ()Z
MD: net/minecraft/client/Minecraft/func_71389_H ()V cvk/az ()V
MD: net/minecraft/client/Minecraft/close ()V cvk/close ()V
MD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/func_152589_a ()Lnet/minecraft/util/text/ITextComponent; dhq$a/a ()Ljm;
MD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/values ()[Lnet/minecraft/client/multiplayer/ServerData$ServerResourceMode; dhq$a/values ()[Ldhq$a;
MD: net/minecraft/client/multiplayer/ServerData$ServerResourceMode/valueOf (Ljava/lang/String;)Lnet/minecraft/client/multiplayer/ServerData$ServerResourceMode; dhq$a/valueOf (Ljava/lang/String;)Ldhq$a;
MD: net/minecraft/client/multiplayer/ServerData/func_78836_a ()Lnet/minecraft/nbt/CompoundNBT; dhq/a ()Lib;
MD: net/minecraft/client/multiplayer/ServerData/func_152584_a (Lnet/minecraft/client/multiplayer/ServerData$ServerResourceMode;)V dhq/a (Ldhq$a;)V
MD: net/minecraft/client/multiplayer/ServerData/func_152583_a (Lnet/minecraft/client/multiplayer/ServerData;)V dhq/a (Ldhq;)V
MD: net/minecraft/client/multiplayer/ServerData/func_78837_a (Lnet/minecraft/nbt/CompoundNBT;)Lnet/minecraft/client/multiplayer/ServerData; dhq/a (Lib;)Ldhq;
MD: net/minecraft/client/multiplayer/ServerData/func_147407_a (Ljava/lang/String;)V dhq/a (Ljava/lang/String;)V
MD: net/minecraft/client/multiplayer/ServerData/func_152586_b ()Lnet/minecraft/client/multiplayer/ServerData$ServerResourceMode; dhq/b ()Ldhq$a;
MD: net/minecraft/client/multiplayer/ServerData/func_147409_e ()Ljava/lang/String; dhq/c ()Ljava/lang/String;
MD: net/minecraft/client/multiplayer/ServerData/func_181041_d ()Z dhq/d ()Z
MD: net/minecraft/client/renderer/IImageBuffer/func_152634_a ()V dkl/a ()V
MD: net/minecraft/client/renderer/IImageBuffer/func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; dkl/a (Lcty;)Lcty;
MD: net/minecraft/client/renderer/ImageBufferDownload/func_152634_a ()V dkq/a ()V
MD: net/minecraft/client/renderer/ImageBufferDownload/func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; dkq/a (Lcty;)Lcty;
MD: net/minecraft/client/renderer/ImageBufferDownload/func_195788_a (Lnet/minecraft/client/renderer/texture/NativeImage;IIII)V dkq/a (Lcty;IIII)V
MD: net/minecraft/client/renderer/ImageBufferDownload/func_195787_b (Lnet/minecraft/client/renderer/texture/NativeImage;IIII)V dkq/b (Lcty;IIII)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData$1/func_217786_a (Ljava/io/InputStream;)V dua$1/a (Ljava/io/InputStream;)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData$1/run ()V dua$1/run ()V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/func_152433_a ()V dua/a ()V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/func_195417_a (Lnet/minecraft/client/renderer/texture/NativeImage;)V dua/a (Lcty;)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/access$000 (Lnet/minecraft/client/renderer/ThreadDownloadImageData;)Ljava/lang/String; dua/a (Ldua;)Ljava/lang/String;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/func_195413_a (Lnet/minecraft/resources/IResourceManager;)V dua/a (Lxe;)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/func_195416_b (Lnet/minecraft/client/renderer/texture/NativeImage;)V dua/b (Lcty;)V
MD: net/minecraft/client/renderer/ThreadDownloadImageData/access$100 (Lnet/minecraft/client/renderer/ThreadDownloadImageData;)Ljava/io/File; dua/b (Ldua;)Ljava/io/File;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/access$300 (Lnet/minecraft/client/renderer/ThreadDownloadImageData;)Lnet/minecraft/client/renderer/IImageBuffer; dua/c (Ldua;)Ldkl;
MD: net/minecraft/client/renderer/ThreadDownloadImageData/access$200 ()Lorg/apache/logging/log4j/Logger; dua/e ()Lorg/apache/logging/log4j/Logger;
MD: net/minecraft/client/renderer/texture/SimpleTexture$TextureData/func_217798_a ()Lnet/minecraft/client/resources/data/TextureMetadataSection; duf$a/a ()Ldvu;
MD: net/minecraft/client/renderer/texture/SimpleTexture$TextureData/func_217799_a (Lnet/minecraft/resources/IResourceManager;Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/SimpleTexture$TextureData; duf$a/a (Lxe;Lqs;)Lduf$a;
MD: net/minecraft/client/renderer/texture/SimpleTexture$TextureData/func_217800_b ()Lnet/minecraft/client/renderer/texture/NativeImage; duf$a/b ()Lcty;
MD: net/minecraft/client/renderer/texture/SimpleTexture$TextureData/func_217801_c ()V duf$a/c ()V
MD: net/minecraft/client/renderer/texture/SimpleTexture$TextureData/close ()V duf$a/close ()V
MD: net/minecraft/client/renderer/texture/SimpleTexture/func_195413_a (Lnet/minecraft/resources/IResourceManager;)V duf/a (Lxe;)V
MD: net/minecraft/client/renderer/texture/SimpleTexture/func_215246_b (Lnet/minecraft/resources/IResourceManager;)Lnet/minecraft/client/renderer/texture/SimpleTexture$TextureData; duf/b (Lxe;)Lduf$a;
MD: net/minecraft/client/renderer/texture/SimpleTexture/func_215245_f ()Lorg/apache/logging/log4j/Logger; duf/f ()Lorg/apache/logging/log4j/Logger;
MD: net/minecraft/client/renderer/texture/TextureManager/func_210123_a (Lnet/minecraft/client/renderer/texture/ITextureObject;)Ljava/lang/String; duk/a (Ldul;)Ljava/lang/String;
MD: net/minecraft/client/renderer/texture/TextureManager/func_110578_a (Ljava/lang/String;Lnet/minecraft/client/renderer/texture/DynamicTexture;)Lnet/minecraft/util/ResourceLocation; duk/a (Ljava/lang/String;Ldtz;)Lqs;
MD: net/minecraft/client/renderer/texture/TextureManager/func_110577_a (Lnet/minecraft/util/ResourceLocation;)V duk/a (Lqs;)V
MD: net/minecraft/client/renderer/texture/TextureManager/func_215267_a (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/PreloadedTexture;)V duk/a (Lqs;Ldue;)V
MD: net/minecraft/client/renderer/texture/TextureManager/func_110579_a (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z duk/a (Lqs;Ldul;)Z
MD: net/minecraft/client/renderer/texture/TextureManager/func_110580_a (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITickableTextureObject;)Z duk/a (Lqs;Ldun;)Z
MD: net/minecraft/client/renderer/texture/TextureManager/func_215268_a (Lnet/minecraft/util/ResourceLocation;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture; duk/a (Lqs;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
MD: net/minecraft/client/renderer/texture/TextureManager/func_215226_a (Lnet/minecraft/resources/IFutureReloadListener$IStage;Lnet/minecraft/resources/IResourceManager;Lnet/minecraft/profiler/IProfiler;Lnet/minecraft/profiler/IProfiler;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture; duk/a (Lwz$a;Lxe;Lagh;Lagh;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
MD: net/minecraft/client/renderer/texture/TextureManager/func_215266_a (Lnet/minecraft/resources/IResourceManager;Ljava/util/concurrent/Executor;Ljava/lang/Void;)V duk/a (Lxe;Ljava/util/concurrent/Executor;Ljava/lang/Void;)V
MD: net/minecraft/client/renderer/texture/TextureManager/func_110581_b (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; duk/b (Lqs;)Ldul;
MD: net/minecraft/client/renderer/texture/TextureManager/func_147645_c (Lnet/minecraft/util/ResourceLocation;)V duk/c (Lqs;)V
MD: net/minecraft/client/renderer/texture/TextureManager/func_110550_d ()V duk/e ()V
MD: net/minecraft/client/renderer/texture/ITextureObject/func_215244_a (Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/resources/IResourceManager;Lnet/minecraft/util/ResourceLocation;Ljava/util/concurrent/Executor;)V dul/a (Lduk;Lxe;Lqs;Ljava/util/concurrent/Executor;)V
MD: net/minecraft/client/renderer/texture/ITextureObject/func_195413_a (Lnet/minecraft/resources/IResourceManager;)V dul/a (Lxe;)V
MD: net/minecraft/client/renderer/texture/ITextureObject/func_174935_a ()V dul/b ()V
MD: net/minecraft/client/renderer/texture/ITextureObject/func_174936_b (ZZ)V dul/b (ZZ)V
MD: net/minecraft/client/renderer/texture/ITextureObject/func_110552_b ()I dul/c ()I
MD: net/minecraft/client/renderer/texture/ITextureObject/func_195412_h ()V dul/h ()V
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177335_a ()Lnet/minecraft/util/ResourceLocation; dut/a ()Lqs;
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177334_a (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; dut/a (Ljava/util/UUID;)Lqs;
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177332_b (Ljava/util/UUID;)Ljava/lang/String; dut/b (Ljava/util/UUID;)Ljava/lang/String;
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177333_c (Ljava/util/UUID;)Z dut/c (Ljava/util/UUID;)Z
MD: net/minecraft/client/resources/SkinManager$1/load (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; dvb$1/a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/client/resources/SkinManager$1/load (Ljava/lang/Object;)Ljava/lang/Object; dvb$1/load (Ljava/lang/Object;)Ljava/lang/Object;
MD: net/minecraft/client/resources/SkinManager$2/func_152634_a ()V dvb$2/a ()V
MD: net/minecraft/client/resources/SkinManager$2/func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; dvb$2/a (Lcty;)Lcty;
MD: net/minecraft/client/resources/SkinManager$SkinAvailableCallback/func_180521_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V dvb$a/onSkinTextureAvailable (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lqs;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V
MD: net/minecraft/client/resources/SkinManager/func_152788_a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; dvb/a (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/client/resources/SkinManager/func_152790_a (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V dvb/a (Lcom/mojang/authlib/GameProfile;Ldvb$a;Z)V
MD: net/minecraft/client/resources/SkinManager/func_210275_a (Lcom/mojang/authlib/GameProfile;ZLnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)V dvb/a (Lcom/mojang/authlib/GameProfile;ZLdvb$a;)V
MD: net/minecraft/client/resources/SkinManager/func_152792_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;)Lnet/minecraft/util/ResourceLocation; dvb/a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;)Lqs;
MD: net/minecraft/client/resources/SkinManager/func_152789_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; dvb/a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Ldvb$a;)Lqs;
MD: net/minecraft/client/resources/SkinManager/func_210276_a (Ljava/util/Map;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)V dvb/a (Ljava/util/Map;Ldvb$a;)V
MD: net/minecraft/client/Minecraft/addScheduledTask (Ljava/lang/Runnable;)V cvk/execute (Ljava/lang/Runnable;)V
+7
View File
@@ -0,0 +1,7 @@
minecraft_version=1.14.2
minecraft_full_versions=1.14.2
#forge gradle needs forge version
forge_mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=stable_39
srg_notch_map=1.14.2.srg
@@ -0,0 +1,40 @@
package net.minecraft.client;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.SkinManager;
import net.minecraft.util.Session;
import java.io.File;
public class Minecraft {
public File gameDir = null;
public static Minecraft getMinecraft() {
return null;
}
public SkinManager getSkinManager() {
return null;
}
public TextureManager getTextureManager() {
return null;
}
public MinecraftSessionService getSessionService() {
return null;
}
public Session getSession() {
return null;
}
public ServerData getCurrentServerData() {
return null;
}
public void addScheduledTask(Runnable r) {
}
}
+97
View File
@@ -0,0 +1,97 @@
/**
* Gradle Script for COS
* It can be used to upload or download file from Tencent Cloud COS.
* COS: https://cloud.tencent.com/document/product/436
*/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.qcloud:cos_api:5.4.6'
}
}
import com.qcloud.cos.COSClient
import com.qcloud.cos.ClientConfig
import com.qcloud.cos.auth.BasicCOSCredentials
import com.qcloud.cos.auth.COSCredentials
import com.qcloud.cos.model.PutObjectRequest
import com.qcloud.cos.model.GetObjectRequest
import com.qcloud.cos.region.Region
String getMcVersion(String filename) {
if (filename.endsWith(".json"))
return filename.substring(0, filename.indexOf('-'))
return filename.substring(filename.indexOf('_') + 1, filename.indexOf('-'))
}
String getKey(String filename) {
String name = filename.substring(0, filename.lastIndexOf('.'))
if (name.indexOf('-') == -1) return null;
if (filename.endsWith(".json"))
return String.format(
"versions/%s/%s",
name,
filename
)
if (filename.endsWith(".jar")){
if (filename.contains("Fabric") || filename.contains("Forge")){
return String.format(
"mods/%s",
filename
)
}else{
return String.format(
"libraries/customskinloader/%s/%s/%s",
name.substring(0, name.indexOf('-')),
name.substring(name.indexOf('-') + 1),
filename
)
}
}
return filename
}
ext.bucketName = System.getenv("COS_BUCKET")
ext.cosUrl = "https://csl.littleservice.cn/"
ext.cosClient0 = null
COSClient getCosClient() {
if (cosClient0 != null) return cosClient0
COSCredentials cred = new BasicCOSCredentials(System.getenv("COS_SECRET_ID"), System.getenv("COS_SECRET_KEY"))
ClientConfig clientConfig = new ClientConfig(new Region("ap-shanghai"))
cosClient0 = new COSClient(cred, clientConfig)
}
void uploadFile(String key, File file) {
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, key, file)
getCosClient().putObject(putObjectRequest)
}
void downloadFile(String key, File file) {
GetObjectRequest getObjectRequest = new GetObjectRequest(bucketName, key)
getCosClient().getObject(getObjectRequest, file)
}
void uploadArtifacts(String shortVersion) {
String cslversion = shortVersion.replace(".", "")
File dir = rootProject.file("build/libs")
if (!dir.isDirectory()) return
File[] files = dir.listFiles()
for (file in files) {
String key = getKey(file.getName())
if (key == null) continue;
uploadFile(key, file)
String url = cosUrl + key
String mcversion = getMcVersion(file.getName()).replace(".", "").toLowerCase()
println(String.format("csl-%s-%s\t%s", mcversion, cslversion, url))
}
}
ext {
uploadArtifacts = this.&uploadArtifacts
}
+62
View File
@@ -0,0 +1,62 @@
/**
* Gradle Script for Remap
* Designed for remapping jar.
* Remap Jar: mcp<->srg<->notch
*/
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
import net.md_5.specialsource.JarMapping
import net.md_5.specialsource.JarRemapper
import net.md_5.specialsource.provider.JarProvider
import net.md_5.specialsource.provider.JointProvider
void reobfSrgToNotch() {
def srgName = "${archivesBaseName}-${version}-srg.jar"
def notchName = srgName.replace('-srg', '')
if (config.srg_notch_map == null) {
//Default Map
def mcpName = srgName.replace('-srg', '-dev')
applySpecialSource(srgName, mcpName, getDefaultMap("srg-mcp"))
applySpecialSource(mcpName, notchName, getDefaultMap("mcp-notch"))
} else {
//Custom Map
applySpecialSource(srgName, notchName, config.srg_notch_map)
}
}
void applySpecialSource(String inputName, String outputName, String mapFile) {
def mapping = new JarMapping()
def srgFile = file(mapFile)
def inputFile = file("build/libs/${inputName}")
def outputFile = file("build/libs/${outputName}")
def remapper = new JarRemapper(null, mapping)
def inputJar = net.md_5.specialsource.Jar.init(inputFile)
def inheritanceProviders = new JointProvider()
def jarProvider = new JarProvider(inputJar)
inheritanceProviders.add(jarProvider)
mapping.loadMappings(srgFile)
mapping.setFallbackInheritanceProvider(inheritanceProviders)
remapper.remapJar(inputJar, outputFile)
}
String getDefaultMap(String srgType) {
def mcpVersion = minecraft.mappings.replace('_', "/")
return System.getProperty('user.home') + "/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_${mcpVersion}/${config.forge_mc_version}/srgs/${srgType}.srg"
}
ext {
reobfSrgToNotch = this.&reobfSrgToNotch
}
+35
View File
@@ -0,0 +1,35 @@
/**
* Gradle Script for Version
* Format Version String
*/
boolean isRelease() {
String s = rootProject.ext.config.snapshot
return s == null || s == "" || s == "0"
}
boolean isSnapshot() {
return !isRelease()
}
String getBuildNum() {
if (System.getenv("CIRCLE_BUILD_NUM") != null)
return System.getenv("CIRCLE_BUILD_NUM")
return "00"
}
//Example: 14.10a-SNAPSHOT-33
String getCSLVersion() {
return rootProject.ext.config.version + rootProject.ext.config.dev_version +
(isRelease() ? '' : ('-SNAPSHOT-' + getBuildNum()))
}
//Example: 14.10a-s33
String getShortVersion() {
return getCSLVersion().replace("SNAPSHOT-", "s")
}
ext {
getCSLVersion = this.&getCSLVersion
getShortVersion = this.&getShortVersion
}
+24
View File
@@ -0,0 +1,24 @@
{
"id": "${mcVersion}-CSL-${modShortFullVersion}",
"inheritsFrom": "${mcVersion}",
"jar": "${mcVersion}",
"releaseTime": "2013-01-02T21:10:00+08:00",
"time": "2013-01-02T21:10:00+08:00",
"type": "release",
"arguments": {
"game": [
"--tweakClass",
"customskinloader.tweaker.Tweaker"
]
},
"mainClass": "net.minecraft.launchwrapper.Launch",
"libraries": [
{
"name": "customskinloader:CustomSkinLoader_${mcVersion}:${modFullVersion}",
"url": "https://csl.littleservice.cn/libraries/"
},
{
"name": "net.minecraft:launchwrapper:1.12"
}
]
}
@@ -33,14 +33,16 @@ public class CustomSkinLoader {
CONFIG_FILE=new File(DATA_DIR,"CustomSkinLoader.json");
public static final SkinSiteProfile[] DEFAULT_LOAD_LIST={
SkinSiteProfile.createMojangAPI("Mojang"),
SkinSiteProfile.createCustomSkinAPI("LittleSkin","https://mcskin.littleservice.cn/"),
SkinSiteProfile.createCustomSkinAPI("LittleSkin","https://littleskin.cn/"),
SkinSiteProfile.createCustomSkinAPI("BlessingSkin","http://skin.prinzeugen.net/"),
//OneSkin has been removed temporarily
//SkinSiteProfile.createCustomSkinAPI("OneSkin","http://fleey.cn/skin/skin_user/skin_json.php/"),
//Minecrack could not load skin correctly
//SkinSiteProfile.creatLegacy("Minecrack","http://minecrack.fr.nf/mc/skinsminecrackd/{USERNAME}.png","http://minecrack.fr.nf/mc/cloaksminecrackd/{USERNAME}.png",null),
SkinSiteProfile.createElyByAPI("ElyBy"),
SkinSiteProfile.createUniSkinAPI("SkinMe","http://www.skinme.cc/uniskin/"),
SkinSiteProfile.createLegacy("LocalSkin","LocalSkin/skins/{USERNAME}.png","LocalSkin/capes/{USERNAME}.png","LocalSkin/elytras/{USERNAME}.png")};
SkinSiteProfile.createLegacy("LocalSkin","LocalSkin/skins/{USERNAME}.png","LocalSkin/capes/{USERNAME}.png","LocalSkin/elytras/{USERNAME}.png"),
SkinSiteProfile.createGlitchlessAPI("GlitchlessGames","https://games.glitchless.ru/api/minecraft/users/profiles/textures/?nickname=")};
public static final Gson GSON=new GsonBuilder().setPrettyPrinting().create();
public static final Logger logger=initLogger();
@@ -50,7 +52,7 @@ public class CustomSkinLoader {
private static final DynamicSkullManager dynamicSkullManager=new DynamicSkullManager();
//For User Skin
public static Map loadProfile(GameProfile gameProfile){
public static Map<Type, MinecraftProfileTexture> loadProfile(GameProfile gameProfile){
String username=gameProfile.getName();
String credential=MinecraftUtil.getCredential(gameProfile);
//Fix: http://hopper.minecraft.net/crashes/minecraft/MCX-2773713
@@ -60,7 +62,7 @@ public class CustomSkinLoader {
}
String tempName=Thread.currentThread().getName();
Thread.currentThread().setName(username);//Change Thread Name
UserProfile profile=null;
UserProfile profile;
if(profileCache.isReady(credential)){
logger.info("Cached profile will be used.");
profile=profileCache.getProfile(credential);
@@ -122,6 +124,8 @@ public class CustomSkinLoader {
}
if(!profile0.isEmpty()){
logger.info(username+"'s profile loaded.");
if(!config.enableCape)
profile0.capeUrl = null;
profileCache.updateCache(credential, profile0);
profileCache.setLoading(credential, false);
logger.info(profile0.toString(profileCache.getExpiry(credential)));
@@ -150,7 +154,7 @@ public class CustomSkinLoader {
String username=gameProfile.getName();
String credential=MinecraftUtil.getCredential(gameProfile);
if(credential==null)
if(username == null || credential == null)
return dynamicSkullManager.getTexture(gameProfile);
if(config.enableUpdateSkull?profileCache.isReady(credential):profileCache.isExist(credential)){
UserProfile profile=profileCache.getProfile(credential);
+19 -8
View File
@@ -7,6 +7,7 @@ import java.io.OutputStreamWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
@SuppressWarnings("ResultOfMethodCallIgnored")
public class Logger {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public enum Level{
@@ -32,6 +33,9 @@ public class Logger {
public Logger(){
//Logger isn't created.
}
public Logger(String logFile) {
this(new File(logFile));
}
public Logger(File logFile){
try {
if(!logFile.getParentFile().exists()){
@@ -42,6 +46,8 @@ public class Logger {
writer = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(logFile), "UTF-8"));
System.out.println("Log Path: " + logFile.getAbsolutePath());
} catch (Exception e) {
e.printStackTrace();
}
@@ -59,18 +65,14 @@ public class Logger {
public void log(Level level,String msg){
if(!level.display()&&writer==null)
return;
StringBuilder sb=new StringBuilder();
sb.append("[").append(Thread.currentThread().getName()).append(" ").append(level.getName()).append("] ");
sb.append(msg);
String sb = String.format("[%s %s] %s", Thread.currentThread().getName(), level.getName(), msg);
if(level.display())
System.out.println(sb.toString());
System.out.println(sb);
if(writer==null)
return;
try {
StringBuilder sb2=new StringBuilder();
sb2.append("[").append(DATE_FORMAT.format(new Date())).append("] ");
sb2.append(sb.toString()).append("\r\n");
writer.write(sb2.toString());
String sb2 = String.format("[%s] %s\r\n", DATE_FORMAT.format(new Date()), sb);
writer.write(sb2);
writer.flush();
} catch (Exception e) {
e.printStackTrace();
@@ -79,12 +81,21 @@ public class Logger {
public void debug(String msg){
log(Level.DEBUG,msg);
}
public void debug(String format, Object... objs) {
debug(String.format(format, objs));
}
public void info(String msg){
log(Level.INFO,msg);
}
public void info(String format, Object... objs){
info(String.format(format, objs));
}
public void warning(String msg){
log(Level.WARNING,msg);
}
public void warning(String format, Object... objs){
warning(String.format(format, objs));
}
public void warning(Throwable e){
log(Level.WARNING,"Exception: "+e.toString());
StackTraceElement[] stes=e.getStackTrace();
@@ -1,11 +1,12 @@
package customskinloader.config;
import java.io.File;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.io.Charsets;
import customskinloader.utils.Version;
import org.apache.commons.io.FileUtils;
import customskinloader.CustomSkinLoader;
@@ -14,33 +15,34 @@ import customskinloader.utils.HttpRequestUtil;
import customskinloader.utils.HttpTextureUtil;
import customskinloader.utils.HttpUtil0;
@SuppressWarnings("ResultOfMethodCallIgnored")
public class Config {
//Program
public String version;
public List<SkinSiteProfile> loadlist;
//Function
public boolean enableDynamicSkull=true;
public boolean enableTransparentSkin=true;
public boolean ignoreHttpsCertificate=false;
public boolean forceLoadAllTextures=false;
public boolean enableCape = true;
//Cache
public int cacheExpiry=20;
public int cacheExpiry=30;
public boolean enableUpdateSkull=false;
public boolean enableLocalProfileCache=false;
public boolean enableCacheAutoClean=false;
//Init config
public Config(SkinSiteProfile[] loadlist){
this.version=CustomSkinLoader.CustomSkinLoader_VERSION;
this.loadlist=Arrays.asList(loadlist);
}
public static Config loadConfig0() {
Config config=loadConfig();
//LoadList null checker
if(config.loadlist==null){
config.loadlist=new ArrayList<SkinSiteProfile>();
@@ -50,7 +52,7 @@ public class Config {
config.loadlist.remove(i--);
}
}
//Init program
config.loadExtraList();
config.initLocalFolder();
@@ -65,34 +67,29 @@ public class Config {
CustomSkinLoader.logger.warning("Exception occurs while cleaning cache: "+e.toString());
}
}
//Output config
CustomSkinLoader.logger.info("EnableDynamicSkull:"+config.enableDynamicSkull+
", EnableTranSkin:"+config.enableTransparentSkin+
", IgnoreHttpsCertificate:"+config.ignoreHttpsCertificate+
", CacheExpiry:"+config.cacheExpiry+
", EnableUpdateSkull:"+config.enableUpdateSkull+
", EnableLocalProfileCache:"+config.enableLocalProfileCache+
", EnableCacheAutoClean:"+config.enableCacheAutoClean+
", LoadList:"+(config.loadlist==null?0:config.loadlist.size()));
//Check config version
float floatVersion=0f;
float configVersion=0f;
try{
floatVersion=Float.parseFloat(CustomSkinLoader.CustomSkinLoader_VERSION);
configVersion=Float.parseFloat(config.version);
if(configVersion==15.1f)//To avoid some bug
configVersion=14.6f;
}catch (Exception e){
CustomSkinLoader.logger.warning("Exception occurs while parsing version: "+e.toString());
Version configVersion = Version.of(config.version);
if (configVersion.compareTo(CustomSkinLoader.CustomSkinLoader_VERSION) < 0) {
CustomSkinLoader.logger.info("Config File is out of date: " + config.version);
config.version = CustomSkinLoader.CustomSkinLoader_VERSION;
//Update some config
if (configVersion.compareTo("14.10") < 0)//Lower than 14.10
config.enableCape = true;
writeConfig(config, true);
}
if(config.version==null || configVersion==0f || floatVersion > configVersion){
CustomSkinLoader.logger.info("Config File is out of date: "+config.version);
config.version=CustomSkinLoader.CustomSkinLoader_VERSION;
writeConfig(config,true);
//Output config
for (Field field : config.getClass().getDeclaredFields()) {
try {
Object value = field.get(config);
if (value instanceof String || value instanceof Integer || value instanceof Boolean)
CustomSkinLoader.logger.info(field.getName() + " : " + value);
} catch (Exception ignored) { }
}
CustomSkinLoader.logger.info("loadList : " + (config.loadlist == null ? 0 : config.loadlist.size()));
return config;
}
@@ -104,7 +101,7 @@ public class Config {
}
try {
CustomSkinLoader.logger.info("Try to load config.");
String json=FileUtils.readFileToString(CustomSkinLoader.CONFIG_FILE,Charsets.UTF_8);
String json=FileUtils.readFileToString(CustomSkinLoader.CONFIG_FILE, "UTF-8");
Config config=CustomSkinLoader.GSON.fromJson(json, Config.class);
CustomSkinLoader.logger.info("Successfully load config.");
return config;
@@ -117,7 +114,7 @@ public class Config {
return initConfig();
}
}
private void loadExtraList(){
File listAddition=new File(CustomSkinLoader.DATA_DIR,"ExtraList");
if(!listAddition.isDirectory()){
@@ -126,12 +123,12 @@ public class Config {
}
List<SkinSiteProfile> adds=new ArrayList<SkinSiteProfile>();
File[] files=listAddition.listFiles();
for(File file:files){
for(File file: files != null ? files : new File[0]){
if(!file.getName().toLowerCase().endsWith(".json")&&!file.getName().toLowerCase().endsWith(".txt"))
continue;
try {
CustomSkinLoader.logger.info("Try to load Extra List.("+file.getName()+")");
String json=FileUtils.readFileToString(file,Charsets.UTF_8);
String json=FileUtils.readFileToString(file, "UTF-8");
SkinSiteProfile ssp=CustomSkinLoader.GSON.fromJson(json, SkinSiteProfile.class);
CustomSkinLoader.logger.info("Successfully load Extra List.");
file.delete();
@@ -165,7 +162,7 @@ public class Config {
writeConfig(this,true);
}
}
private void initLocalFolder(){
for(SkinSiteProfile ssp:this.loadlist){
ProfileLoader.IProfileLoader loader=ProfileLoader.LOADERS.get(ssp.type.toLowerCase());
@@ -186,7 +183,7 @@ public class Config {
CustomSkinLoader.CONFIG_FILE.delete();
try {
CustomSkinLoader.CONFIG_FILE.createNewFile();
FileUtils.write(CustomSkinLoader.CONFIG_FILE, json, Charsets.UTF_8);
FileUtils.write(CustomSkinLoader.CONFIG_FILE, json, "UTF-8");
CustomSkinLoader.logger.info("Successfully "+(update?"update":"create")+" config.");
} catch (Exception e) {
CustomSkinLoader.logger.info("Failed to "+(update?"update":"create")+" config.("+e.toString()+")");
@@ -1,14 +1,11 @@
package customskinloader.config;
import customskinloader.loader.jsonapi.CustomSkinAPIPlus.CustomSkinAPIPlusPrivacy;
public class SkinSiteProfile {
public String name;
public String type;
public String userAgent;
public String root;
public CustomSkinAPIPlusPrivacy privacy;
public Boolean checkPNG;//Not suitable for local skin
public String skin;
@@ -34,14 +31,22 @@ public class SkinSiteProfile {
ssp.name=name;
ssp.type="CustomSkinAPIPlus";
ssp.root=root;
ssp.privacy=new CustomSkinAPIPlusPrivacy();
return ssp;
}
public static SkinSiteProfile createUniSkinAPI(String name,String root){
SkinSiteProfile ssp=new SkinSiteProfile();
ssp.name=name;
ssp.type="UniSkinAPI";
ssp.root=root;
public static SkinSiteProfile createGlitchlessAPI(String name, String root) {
SkinSiteProfile ssp = new SkinSiteProfile();
ssp.name = name;
ssp.type = "GlitchlessAPI";
ssp.root = root;
return ssp;
}
public static SkinSiteProfile createUniSkinAPI(String name, String root) {
SkinSiteProfile ssp = new SkinSiteProfile();
ssp.name = name;
ssp.type = "UniSkinAPI";
ssp.root = root;
return ssp;
}
public static SkinSiteProfile createLegacy(String name,String skin,String cape,String elytra){
@@ -50,15 +55,16 @@ public class SkinSiteProfile {
ssp.type="Legacy";
ssp.checkPNG=false;
ssp.skin=skin;
ssp.model="default";
ssp.model="auto";
ssp.cape=cape;
ssp.elytra=elytra;
return ssp;
}
public static SkinSiteProfile createElfSkin(String name){
SkinSiteProfile ssp=new SkinSiteProfile();
ssp.name=name;
ssp.type="ElfSkin";
public static SkinSiteProfile createElyByAPI(String name) {
SkinSiteProfile ssp = new SkinSiteProfile();
ssp.name = name;
ssp.type = "ElyByAPI";
return ssp;
}
}
@@ -1,7 +1,9 @@
package customskinloader.fake;
import java.util.Map;
import java.util.UUID;
import com.google.common.collect.Maps;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
@@ -15,72 +17,73 @@ import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.DefaultPlayerSkin;
import net.minecraft.client.resources.SkinManager;
import net.minecraft.client.resources.SkinManager.SkinAvailableCallback;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StringUtils;
public class FakeClientPlayer {
//For Legacy Skin
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation resourceLocationIn, String username)
{
//CustomSkinLoader.logger.debug("FakeClientPlayer/getDownloadImageSkin "+username);
//For Legacy Skin
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation resourceLocationIn, String username) {
//CustomSkinLoader.logger.debug("FakeClientPlayer/getDownloadImageSkin "+username);
TextureManager textman = Minecraft.getMinecraft().getTextureManager();
ITextureObject ito = textman.getTexture(resourceLocationIn);
if (ito == null || !(ito instanceof ThreadDownloadImageData)) {
//if Legacy Skin for username not loaded yet
SkinManager skinman = Minecraft.getMinecraft().getSkinManager();
UUID offlineUUID = getOfflineUUID(username);
GameProfile offlineProfile = new GameProfile(offlineUUID, username);
//Load Default Skin
ResourceLocation defaultSkin = DefaultPlayerSkin.getDefaultSkin(offlineUUID);
ITextureObject defaultSkinObj = new SimpleTexture(defaultSkin);
textman.loadTexture(resourceLocationIn, defaultSkinObj);
//Load Skin from SkinManager
skinman.loadProfileTextures(offlineProfile, new LegacyBuffer(resourceLocationIn), false);
}
if (ito instanceof ThreadDownloadImageData)
return (ThreadDownloadImageData) ito;
else
return null;
}
public static ResourceLocation getLocationSkin(String username) {
//CustomSkinLoader.logger.debug("FakeClientPlayer/getLocationSkin "+username);
return new ResourceLocation("skins/legacy-" + StringUtils.stripControlCodes(username));
}
public static UUID getOfflineUUID(String username)
{
return UUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes());
}
public static Map<ResourceLocation, ITextureObject> textureCache = Maps.newHashMap();
public static class LegacyBuffer implements SkinAvailableCallback {
ResourceLocation resourceLocationIn;
boolean loaded = false;
public LegacyBuffer(ResourceLocation resourceLocationIn) {
CustomSkinLoader.logger.debug("Loading Legacy Texture (" + resourceLocationIn + ")");
this.resourceLocationIn = resourceLocationIn;
}
@Override
public void skinAvailable(Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture) {
if (typeIn != Type.SKIN || loaded)
return;
TextureManager textman = Minecraft.getMinecraft().getTextureManager();
ITextureObject ito = textman.getTexture(resourceLocationIn);
ITextureObject ito = textman.getTexture(location);
if (ito == null)
ito = textureCache.get(location);
if (ito == null)
return;
if (ito == null || !(ito instanceof ThreadDownloadImageData))
{
//if Legacy Skin for username not loaded yet
SkinManager skinman = Minecraft.getMinecraft().getSkinManager();
UUID offlineUUID=EntityPlayer.getOfflineUUID(username);
GameProfile offlineProfile=new GameProfile(offlineUUID,username);
//Load Default Skin
ResourceLocation defaultSkin=DefaultPlayerSkin.getDefaultSkin(offlineUUID);
ITextureObject defaultSkinObj=new SimpleTexture(defaultSkin);
textman.loadTexture(resourceLocationIn, defaultSkinObj);
//Load Skin from SkinManager
skinman.loadProfileTextures(offlineProfile, new LegacyBuffer(resourceLocationIn), false);
}
if(ito instanceof ThreadDownloadImageData)
return (ThreadDownloadImageData)ito;
else
return null;
}
public static ResourceLocation getLocationSkin(String username)
{
//CustomSkinLoader.logger.debug("FakeClientPlayer/getLocationSkin "+username);
return new ResourceLocation("skins/legacy-" + StringUtils.stripControlCodes(username));
}
private static class LegacyBuffer implements SkinAvailableCallback{
ResourceLocation resourceLocationIn;
boolean loaded=false;
public LegacyBuffer(ResourceLocation resourceLocationIn) {
CustomSkinLoader.logger.debug("Loading Legacy Texture ("+resourceLocationIn+")");
this.resourceLocationIn=resourceLocationIn;
}
@Override
public void skinAvailable(Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture) {
if(typeIn!=Type.SKIN || loaded)
return;
loaded=true;
TextureManager textman = Minecraft.getMinecraft().getTextureManager();
ITextureObject ito = textman.getTexture(location);
if(ito!=null)
textman.loadTexture(resourceLocationIn, ito);
CustomSkinLoader.logger.debug("Legacy Texture ("+resourceLocationIn+") Loaded as "+
ito==null?null:ito.toString()+" ("+location+")");
//textman.bindTexture(resourceLocationIn);
}
loaded = true;
textman.loadTexture(resourceLocationIn, ito);
CustomSkinLoader.logger.debug("Legacy Texture (" + resourceLocationIn + ") Loaded as " +
ito.toString() + " (" + location + ")");
}
}
}
@@ -1,117 +1,151 @@
package customskinloader.fake;
import java.awt.Color;
import java.awt.Graphics;
import customskinloader.CustomSkinLoader;
import customskinloader.fake.texture.FakeBufferedImage;
import customskinloader.fake.texture.FakeImage;
import customskinloader.fake.texture.FakeNativeImage;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;
import java.awt.image.ImageObserver;
public class FakeSkinBuffer implements net.minecraft.client.renderer.IImageBuffer {
private int[] imageData;
private int ratio=1;
@Override
public BufferedImage parseUserSkin(BufferedImage image) {
if(image==null)
private int ratio = 1;
private FakeImage image = null;
//parseUserSkin for 1.13+
public net.minecraft.client.renderer.texture.NativeImage func_195786_a(net.minecraft.client.renderer.texture.NativeImage image) {
if (image == null)
return null;
ratio = image.getWidth() / 64;
BufferedImage bufferedimage = new BufferedImage(64 * ratio, 64 * ratio, 2);
Graphics graphics = bufferedimage.getGraphics();
graphics.setColor(new Color(0,0,0,0));
graphics.fillRect(0,0,64,64);
graphics.drawImage(image,0,0,(ImageObserver)null);
if (image.getHeight() == 32 * ratio){//Single Layer
//Revert to original algorithm
//Right Leg -> Left Leg
graphics.drawImage(bufferedimage, 24 * ratio, 48 * ratio, 20 * ratio, 52 * ratio, 4 * ratio, 16 * ratio, 8 * ratio, 20 * ratio, (ImageObserver)null);//Top
graphics.drawImage(bufferedimage, 28 * ratio, 48 * ratio, 24 * ratio, 52 * ratio, 8 * ratio, 16 * ratio, 12 * ratio, 20 * ratio, (ImageObserver)null);//Bottom
graphics.drawImage(bufferedimage, 20 * ratio, 52 * ratio, 16 * ratio, 64 * ratio, 8 * ratio, 20 * ratio, 12 * ratio, 32 * ratio, (ImageObserver)null);//Left
graphics.drawImage(bufferedimage, 24 * ratio, 52 * ratio, 20 * ratio, 64 * ratio, 4 * ratio, 20 * ratio, 8 * ratio, 32 * ratio, (ImageObserver)null);//Front
graphics.drawImage(bufferedimage, 28 * ratio, 52 * ratio, 24 * ratio, 64 * ratio, 0 * ratio, 20 * ratio, 4 * ratio, 32 * ratio, (ImageObserver)null);//Right
graphics.drawImage(bufferedimage, 32 * ratio, 52 * ratio, 28 * ratio, 64 * ratio, 12 * ratio, 20 * ratio, 16 * ratio, 32 * ratio, (ImageObserver)null);//Back
//Right Arm -> Left Arm
graphics.drawImage(bufferedimage, 40 * ratio, 48 * ratio, 36 * ratio, 52 * ratio, 44 * ratio, 16 * ratio, 48 * ratio, 20 * ratio, (ImageObserver)null);//Top
graphics.drawImage(bufferedimage, 44 * ratio, 48 * ratio, 40 * ratio, 52 * ratio, 48 * ratio, 16 * ratio, 52 * ratio, 20 * ratio, (ImageObserver)null);//Bottom
graphics.drawImage(bufferedimage, 36 * ratio, 52 * ratio, 32 * ratio, 64 * ratio, 48 * ratio, 20 * ratio, 52 * ratio, 32 * ratio, (ImageObserver)null);//Left
graphics.drawImage(bufferedimage, 40 * ratio, 52 * ratio, 36 * ratio, 64 * ratio, 44 * ratio, 20 * ratio, 48 * ratio, 32 * ratio, (ImageObserver)null);//Front
graphics.drawImage(bufferedimage, 44 * ratio, 52 * ratio, 40 * ratio, 64 * ratio, 40 * ratio, 20 * ratio, 44 * ratio, 32 * ratio, (ImageObserver)null);//Right
graphics.drawImage(bufferedimage, 48 * ratio, 52 * ratio, 44 * ratio, 64 * ratio, 52 * ratio, 20 * ratio, 56 * ratio, 32 * ratio, (ImageObserver)null);//Back
}
graphics.dispose();
this.imageData = ((DataBufferInt)bufferedimage.getRaster().getDataBuffer()).getData();
setAreaDueToConfig( 0 * ratio, 0 * ratio,32 * ratio,16 * ratio);//Head - 1
setAreaTransparent(32 * ratio, 0 * ratio,64 * ratio,16 * ratio);//Head - 2
setAreaDueToConfig( 0 * ratio,16 * ratio,16 * ratio,32 * ratio);//Right Leg - 1
setAreaDueToConfig(16 * ratio,16 * ratio,40 * ratio,32 * ratio);//Body - 1
setAreaDueToConfig(40 * ratio,16 * ratio,56 * ratio,32 * ratio);//Right Arm - 1
setAreaTransparent( 0 * ratio,32 * ratio,16 * ratio,48 * ratio);//Right Leg - 2
setAreaTransparent(16 * ratio,32 * ratio,40 * ratio,48 * ratio);//Body - 2
setAreaTransparent(40 * ratio,32 * ratio,56 * ratio,48 * ratio);//Right Arm - 2
setAreaTransparent( 0 * ratio,48 * ratio,16 * ratio,64 * ratio);//Left Leg - 2
setAreaDueToConfig(16 * ratio,48 * ratio,32 * ratio,64 * ratio);//Left Leg - 1
setAreaDueToConfig(32 * ratio,48 * ratio,48 * ratio,64 * ratio);//Left Arm - 1
setAreaTransparent(48 * ratio,48 * ratio,64 * ratio,64 * ratio);//Left Arm - 2
return bufferedimage;
FakeImage img = parseUserSkin(new FakeNativeImage(image));
if (img instanceof FakeNativeImage)
return ((FakeNativeImage) img).getImage();
CustomSkinLoader.logger.warning("Failed to parseUserSkin(func_195786_a).");
return null;
}
/* 2^24-1
//parseUserSkin for 1.12.2-
public BufferedImage parseUserSkin(BufferedImage image) {
if (image == null)
return null;
FakeImage img = parseUserSkin(new FakeBufferedImage(image));
if (img instanceof FakeBufferedImage)
return ((FakeBufferedImage) img).getImage();
CustomSkinLoader.logger.warning("Failed to parseUserSkin.");
return null;
}
public FakeImage parseUserSkin(FakeImage image) {
if (image == null) return null;
this.ratio = image.getWidth() / 64;
if (image.getHeight() != image.getWidth()) {//Single Layer
//Create a new image and copy origin image data
FakeImage img = image.createImage(64 * ratio, 64 * ratio);
img.copyImageData(image); image.close(); image = img;
image.fillArea(0 * ratio, 32 * ratio, 64 * ratio, 32 * ratio);
//Right Leg -> Left Leg
image.copyArea( 4 * ratio, 16 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Top
image.copyArea( 8 * ratio, 16 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Bottom
image.copyArea( 0 * ratio, 20 * ratio, 24 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Right
image.copyArea( 4 * ratio, 20 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Front
image.copyArea( 8 * ratio, 20 * ratio, 8 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Left
image.copyArea(12 * ratio, 20 * ratio, 16 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Back
//Right Arm -> Left Arm
image.copyArea(44 * ratio, 16 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Top
image.copyArea(48 * ratio, 16 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 4 * ratio, true, false);//Bottom
image.copyArea(40 * ratio, 20 * ratio, 0 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Right
image.copyArea(44 * ratio, 20 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Front
image.copyArea(48 * ratio, 20 * ratio,-16 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Left
image.copyArea(52 * ratio, 20 * ratio, -8 * ratio, 32 * ratio, 4 * ratio, 12 * ratio, true, false);//Back
}
this.image = image;
setAreaDueToConfig( 0 * ratio, 0 * ratio, 32 * ratio, 16 * ratio);//Head - 1
setAreaTransparent(32 * ratio, 0 * ratio, 64 * ratio, 16 * ratio);//Head - 2
setAreaDueToConfig(16 * ratio, 16 * ratio, 40 * ratio, 32 * ratio);//Body - 1
setAreaTransparent(16 * ratio, 32 * ratio, 40 * ratio, 48 * ratio);//Body - 2
setAreaDueToConfig(40 * ratio, 16 * ratio, 56 * ratio, 32 * ratio);//Right Arm - 1
setAreaTransparent(40 * ratio, 32 * ratio, 56 * ratio, 48 * ratio);//Right Arm - 2
setAreaDueToConfig( 0 * ratio, 16 * ratio, 16 * ratio, 32 * ratio);//Right Leg - 1
setAreaTransparent( 0 * ratio, 32 * ratio, 16 * ratio, 48 * ratio);//Right Leg - 2
setAreaDueToConfig(32 * ratio, 48 * ratio, 48 * ratio, 64 * ratio);//Left Arm - 1
setAreaTransparent(48 * ratio, 48 * ratio, 64 * ratio, 64 * ratio);//Left Arm - 2
setAreaDueToConfig(16 * ratio, 48 * ratio, 32 * ratio, 64 * ratio);//Left Leg - 1
setAreaTransparent( 0 * ratio, 48 * ratio, 16 * ratio, 64 * ratio);//Left Leg - 2
return image;
}
/**
* Judge the type of skin
* Must be called after parseUserSkin
*
* @return type of skin (slim / default)
* @since 14.9
*/
public String judgeType() {
if (this.image == null)
return null;
if (((image.getRGBA(55 * ratio, 20 * ratio) & B) >>> 24) == 0)//if (55,20) is transparent
return "slim";
return "default";
}
/* 2^24-1
* 00000000 11111111 11111111 11111111 */
private static final int A=16777215;
private static final int WHITE=getARGB(255,255,255,255);
private static final int BLACK=getARGB(255,0,0,0);
private boolean isFilled(int x0,int y0,int x1,int y1){
int data=this.imageData[getPosition(x0,y0)];
if(data!=WHITE && data!=BLACK)
private static final int A = 16777215;
private static final int WHITE = getARGB(255, 255, 255, 255);
private static final int BLACK = getARGB(255, 0, 0, 0);
private boolean isFilled(int x0, int y0, int x1, int y1) {
int data = image.getRGBA(x0, y0);
if (data != WHITE && data != BLACK)
return false;
for (int x=x0;x<x1;++x)
for (int y=y0;y<y1;++y)
if(this.imageData[getPosition(x,y)]!=data)
for (int x = x0; x < x1; ++x)
for (int y = y0; y < y1; ++y)
if (image.getRGBA(x, y) != data)
return false;
return true;
}
private void setAreaTransparent(int x0,int y0,int x1,int y1){
if(!isFilled(x0,y0,x1,y1))
private void setAreaTransparent(int x0, int y0, int x1, int y1) {
if (!isFilled(x0, y0, x1, y1))
return;
for (int x=x0;x<x1;++x)
for (int y=y0;y<y1;++y)
this.imageData[getPosition(x,y)] &= A;
for (int x = x0; x < x1; ++x)
for (int y = y0; y < y1; ++y)
image.setRGBA(x, y, image.getRGBA(x,y) & A);
}
/* -2^24
* 00000001 00000000 00000000 00000000 ->
* 11111110 11111111 11111111 11111111 ->
* 11111111 00000000 00000000 00000000 */
private static final int B=-16777216;
private void setAreaOpaque(int x0,int y0,int x1,int y1){
for (int x=x0;x<x1;++x)
for (int y=y0;y<y1;++y)
this.imageData[getPosition(x,y)] |= B;
private static final int B = -16777216;
private void setAreaOpaque(int x0, int y0, int x1, int y1) {
for (int x = x0; x < x1; ++x)
for (int y = y0; y < y1; ++y)
image.setRGBA(x, y, image.getRGBA(x,y) | B);
}
private void setAreaDueToConfig(int x0,int y0,int x1,int y1){
if(customskinloader.CustomSkinLoader.config.enableTransparentSkin)
setAreaTransparent(x0,y0,x1,y1);
private void setAreaDueToConfig(int x0, int y0, int x1, int y1) {
if (customskinloader.CustomSkinLoader.config.enableTransparentSkin)
setAreaTransparent(x0, y0, x1, y1);
else
setAreaOpaque(x0,y0,x1,y1);
setAreaOpaque(x0, y0, x1, y1);
}
@Override
public void skinAvailable(){
//A callback when skin loaded
public void skinAvailable() {
//A callback when skin loaded, nothing to do
}
private static int getARGB(int a,int r,int g,int b){
private static int getARGB(int a, int r, int g, int b) {
return (a << 24) | (r << 16) | (g << 8) | b;
}
private int getPosition(int x,int y){
return x+y*64*ratio;
}
}
@@ -27,81 +27,103 @@ import net.minecraft.client.resources.DefaultPlayerSkin;
import net.minecraft.client.resources.SkinManager.SkinAvailableCallback;
import net.minecraft.util.ResourceLocation;
public class FakeSkinManager{
private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue());
public class FakeSkinManager {
private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>());
private final TextureManager textureManager;
public FakeSkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService) {
this.textureManager=textureManagerInstance;
HttpTextureUtil.defaultCacheDir=skinCacheDirectory;
this.textureManager = textureManagerInstance;
HttpTextureUtil.defaultCacheDir = skinCacheDirectory;
}
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, Type textureType){
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, Type textureType) {
return this.loadSkin(profileTexture, textureType, null);
}
public ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final Type textureType, final SkinAvailableCallback skinAvailableCallback){
HttpTextureInfo info=HttpTextureUtil.toHttpTextureInfo(profileTexture.getUrl());
public ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final Type textureType, final SkinAvailableCallback skinAvailableCallback) {
HttpTextureInfo info = HttpTextureUtil.toHttpTextureInfo(profileTexture.getUrl());
final ResourceLocation resourcelocation = new ResourceLocation("skins/" + info.hash);
ITextureObject itextureobject = this.textureManager.getTexture(resourcelocation);
if (itextureobject != null)//Have already loaded
makeCallback(skinAvailableCallback,textureType, resourcelocation, profileTexture);
else{
ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(info.cacheFile, info.url, DefaultPlayerSkin.getDefaultSkinLegacy(),
new BaseBuffer(skinAvailableCallback, textureType, resourcelocation, profileTexture));
makeCallback(skinAvailableCallback, textureType, resourcelocation, profileTexture);
else {
ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(info.cacheFile, info.url, DefaultPlayerSkin.getDefaultSkinLegacy(),
new BaseBuffer(skinAvailableCallback, textureType, resourcelocation, profileTexture));
if (skinAvailableCallback instanceof FakeClientPlayer.LegacyBuffer)//Cache for client player
FakeClientPlayer.textureCache.put(resourcelocation, threaddownloadimagedata);
this.textureManager.loadTexture(resourcelocation, threaddownloadimagedata);
}
return resourcelocation;
}
public void loadProfileTextures(final GameProfile profile, final SkinAvailableCallback skinAvailableCallback, final boolean requireSecure){
THREAD_POOL.submit(new Runnable(){
public void run(){
final Map<Type, MinecraftProfileTexture> map = Maps.<Type, MinecraftProfileTexture>newHashMap();
public void loadProfileTextures(final GameProfile profile, final SkinAvailableCallback skinAvailableCallback, final boolean requireSecure) {
THREAD_POOL.submit(new Runnable() {
public void run() {
final Map<Type, MinecraftProfileTexture> map = Maps.newHashMap();
map.putAll(customskinloader.CustomSkinLoader.loadProfile(profile));
Minecraft.getMinecraft().addScheduledTask(new Runnable(){
public void run(){
for(Type type:Type.values())
if(map.containsKey(type))
FakeSkinManager.this.loadSkin((MinecraftProfileTexture)map.get(type), type, skinAvailableCallback);
Minecraft.getMinecraft().addScheduledTask(new Runnable() {
public void run() {
for (Type type : Type.values()) {
if (map.containsKey(type)) {
CustomSkinLoader.logger.debug("Loading type:" + type);
FakeSkinManager.this.loadSkin(map.get(type), type, skinAvailableCallback);
}
}
}
});
}
});
}
public Map<Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile){
public Map<Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile) {
return CustomSkinLoader.loadProfileFromCache(profile);
}
private static void makeCallback(SkinAvailableCallback callback,Type type, ResourceLocation location, MinecraftProfileTexture texture){
if(callback!=null)
private static void makeCallback(SkinAvailableCallback callback, Type type, ResourceLocation location, MinecraftProfileTexture texture) {
if (callback != null)
callback.skinAvailable(type, location, texture);
}
private class BaseBuffer implements IImageBuffer{
private class BaseBuffer implements IImageBuffer {
private IImageBuffer buffer;
private SkinAvailableCallback callback;
private Type type;
private ResourceLocation location;
private MinecraftProfileTexture texture;
public BaseBuffer(SkinAvailableCallback callback,Type type,ResourceLocation location,MinecraftProfileTexture texture){
this.buffer=(type==Type.SKIN?new FakeSkinBuffer():null);
this.callback=callback;
this.type=type;
this.location=location;
this.texture=texture;
}
public BufferedImage parseUserSkin(BufferedImage image){
return buffer==null?image:buffer.parseUserSkin(image);
}
public void skinAvailable(){
if (buffer != null)
buffer.skinAvailable();
FakeSkinManager.makeCallback(callback,type, location, texture);
public BaseBuffer(SkinAvailableCallback callback, Type type, ResourceLocation location, MinecraftProfileTexture texture) {
this.buffer = (type == Type.SKIN ? new FakeSkinBuffer() : null);
this.callback = callback;
this.type = type;
this.location = location;
this.texture = texture;
}
public net.minecraft.client.renderer.texture.NativeImage func_195786_a(net.minecraft.client.renderer.texture.NativeImage image) {
return buffer instanceof FakeSkinBuffer ? ((FakeSkinBuffer) buffer).func_195786_a(image) : image;
}
public BufferedImage parseUserSkin(BufferedImage image) {
return buffer == null ? image : buffer.parseUserSkin(image);
}
public void skinAvailable() {
if (buffer != null) {
buffer.skinAvailable();
if ("auto".equals(texture.getMetadata("model")) && buffer instanceof FakeSkinBuffer) {
//Auto judge skin type
Map<String, String> metadata = Maps.newHashMap();
metadata.put("model", ((FakeSkinBuffer) buffer).judgeType());
texture = new MinecraftProfileTexture(texture.getUrl(), metadata);
}
}
FakeSkinManager.makeCallback(callback, type, location, texture);
}
}
}
@@ -0,0 +1,67 @@
package customskinloader.fake.texture;
import java.awt.*;
import java.awt.image.BufferedImage;
public class FakeBufferedImage implements FakeImage {
private BufferedImage image;
private Graphics graphics;
public FakeBufferedImage(int width, int height) {
this(new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB));
}
public FakeBufferedImage(BufferedImage image) {
this.image = image;
graphics = image.getGraphics();
}
public BufferedImage getImage() {
graphics.dispose();
return image;
}
public FakeImage createImage(int width, int height) {
return new FakeBufferedImage(width, height);
}
public int getWidth() {
return image.getWidth();
}
public int getHeight() {
return image.getHeight();
}
public int getRGBA(int x, int y) {
return image.getRGB(x, y);
}
public void setRGBA(int x, int y, int rgba) {
image.setRGB(x, y, rgba);
}
public void copyImageData(FakeImage image) {
if (!(image instanceof FakeBufferedImage)) return;
BufferedImage img = ((FakeBufferedImage) image).getImage();
graphics.drawImage(img, 0, 0, null);
}
public void fillArea(int x0, int y0, int width, int height) {
graphics.setColor(new Color(0, 0, 0, 0));
graphics.fillRect(x0, y0, width, height);
}
public void copyArea(int x0, int y0, int dx, int dy, int width, int height, boolean reversex, boolean reversey) {
int x1 = x0 + width, x2 = x0 + dx, x3 = x2 + width;
int y1 = y0 + height, y2 = y0 + dy, y3 = y2 + height;
graphics.drawImage(image,
reversex ? x3 : x2, reversey ? y3 : y2,
reversex ? x2 : x3, reversey ? y2 : y3,
x0, y0, x1, y1, null);
}
public void close() {
graphics.dispose();
}
}
@@ -0,0 +1,21 @@
package customskinloader.fake.texture;
public interface FakeImage {
FakeImage createImage(int width, int height);
int getWidth();
int getHeight();
int getRGBA(int x, int y);
void setRGBA(int x, int y, int rgba);
void copyImageData(FakeImage image);
void fillArea(int x0, int y0, int width, int height);
void copyArea(int x0, int y0, int dx, int dy, int width, int height, boolean reversex, boolean reversey);
void close();
}
@@ -0,0 +1,55 @@
package customskinloader.fake.texture;
import net.minecraft.client.renderer.texture.NativeImage;
public class FakeNativeImage implements FakeImage {
private NativeImage image;
public FakeNativeImage(int width, int height) {
this(new NativeImage(width, height, true));
}
public FakeNativeImage(NativeImage image) {
this.image = image;
}
public NativeImage getImage() {
return image;
}
public FakeImage createImage(int width, int height) {
return new FakeNativeImage(width, height);
}
public int getWidth() {
return image.func_195702_a();
}
public int getHeight() {
return image.func_195714_b();
}
public int getRGBA(int x, int y) {
return image.func_195709_a(x, y);
}
public void setRGBA(int x, int y, int rgba) {
image.func_195700_a(x, y, rgba);
}
public void copyImageData(FakeImage image) {
if (!(image instanceof FakeNativeImage)) return;
this.image.func_195703_a(((FakeNativeImage) image).getImage());
}
public void fillArea(int x0, int y0, int width, int height) {
image.func_195715_a(x0, y0, width, height, 0);
}
public void copyArea(int x0, int y0, int dx, int dy, int width, int height, boolean reversex, boolean reversey) {
image.func_195699_a(x0, y0, dx, dy, width, height, reversex, reversey);
}
public void close() {
}
}
@@ -20,19 +20,23 @@ import customskinloader.utils.HttpRequestUtil.HttpResponce;
public class JsonAPILoader implements ProfileLoader.IProfileLoader {
public interface IJsonAPI {
public String toJsonUrl(String root,String username);
public String getPayload(SkinSiteProfile ssp);
public UserProfile toUserProfile(String root,String json,boolean local);
public String getName();
String toJsonUrl(String root, String username);
String getPayload(SkinSiteProfile ssp);
UserProfile toUserProfile(String root, String json, boolean local);
String getName();
}
public static class ErrorProfile{
public int errno;
public String msg;
}
public static enum Type{
CustomSkinAPI(new CustomSkinAPI()),CustomSkinAPIPlus(new CustomSkinAPIPlus()),UniSkinAPI(new UniSkinAPI());
public enum Type{
CustomSkinAPI(new CustomSkinAPI()),
CustomSkinAPIPlus(new CustomSkinAPIPlus()),
UniSkinAPI(new UniSkinAPI()),
ElyByAPI(new ElyByAPI()),
GlitchlessAPI(new GlitchlessAPI());
public IJsonAPI jsonAPI;
private Type(IJsonAPI jsonAPI){
Type(IJsonAPI jsonAPI){
this.jsonAPI=jsonAPI;
}
}
@@ -45,20 +49,20 @@ public class JsonAPILoader implements ProfileLoader.IProfileLoader {
@Override
public UserProfile loadProfile(SkinSiteProfile ssp, GameProfile gameProfile) throws Exception {
String username=gameProfile.getName();
boolean local=HttpUtil0.isLocal(ssp.root);
if(ssp.root==null||ssp.root.equals("")){
if(StringUtils.isEmpty(ssp.root) && type!=Type.ElyByAPI){
CustomSkinLoader.logger.info("Root not defined.");
return null;
}
boolean local = HttpUtil0.isLocal(ssp.root);
String jsonUrl=type.jsonAPI.toJsonUrl(ssp.root, username);
String json;
if(local){
File jsonFile=new File(jsonUrl);
File jsonFile = new File(CustomSkinLoader.DATA_DIR, jsonUrl);
if(!jsonFile.exists()){
CustomSkinLoader.logger.info("Profile File not found.");
return null;
}
json=IOUtils.toString(new FileInputStream(jsonFile));
json=IOUtils.toString(new FileInputStream(jsonFile), "UTF-8");
}else{
HttpResponce responce=HttpRequestUtil.makeHttpRequest(new HttpRequest(jsonUrl).setCacheTime(90).setUserAgent(ssp.userAgent).setPayload(type.jsonAPI.getPayload(ssp)));
json=responce.content;
@@ -84,12 +88,13 @@ public class JsonAPILoader implements ProfileLoader.IProfileLoader {
}
@Override
public boolean compare(SkinSiteProfile ssp0, SkinSiteProfile ssp1) {
return StringUtils.isNoneEmpty(ssp0.root)?ssp0.root.equalsIgnoreCase(ssp1.root):true;
return !StringUtils.isNoneEmpty(ssp0.root) || ssp0.root.equalsIgnoreCase(ssp1.root);
}
@Override
public String getName() {
return type.jsonAPI.getName();
}
@SuppressWarnings("ResultOfMethodCallIgnored")
@Override
public void initLocalFolder(SkinSiteProfile ssp) {
if(HttpUtil0.isLocal(ssp.root)){
@@ -17,45 +17,45 @@ import customskinloader.utils.HttpTextureUtil;
import customskinloader.utils.HttpUtil0;
public class LegacyLoader implements ProfileLoader.IProfileLoader {
public static final String USERNAME_REGEX="\\{USERNAME\\}";
public static final String USERNAME_PLACEHOLDER="{USERNAME}";
@Override
public UserProfile loadProfile(SkinSiteProfile ssp, GameProfile gameProfile) throws Exception {
String username=gameProfile.getName();
UserProfile profile=new UserProfile();
if(StringUtils.isNoneEmpty(ssp.skin)){
String skin=ssp.skin.replaceAll(USERNAME_REGEX, username);
String skin=ssp.skin.replace(USERNAME_PLACEHOLDER, username);
if(HttpUtil0.isLocal(ssp.skin)){
File skinFile=new File(CustomSkinLoader.DATA_DIR,skin);
if(skinFile.exists()&&skinFile.isFile())
profile.skinUrl=HttpTextureUtil.getLocalLegacyFakeUrl(skin, HttpTextureUtil.getHash(skin, skinFile.length(), skinFile.lastModified()));
}else{
HttpResponce responce=HttpRequestUtil.makeHttpRequest(new HttpRequest(skin).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG!=null&&ssp.checkPNG!=false).setLoadContent(false).setCacheTime(90));
HttpResponce responce = HttpRequestUtil.makeHttpRequest(new HttpRequest(skin).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG!=null && ssp.checkPNG).setLoadContent(false).setCacheTime(90));
if(responce.success)
profile.skinUrl=HttpTextureUtil.getLegacyFakeUrl(skin);
}
profile.model=profile.hasSkinUrl()?ssp.model:null;
}
if(StringUtils.isNoneEmpty(ssp.cape)){
String cape=ssp.cape.replaceAll(USERNAME_REGEX, username);
String cape=ssp.cape.replace(USERNAME_PLACEHOLDER, username);
if(HttpUtil0.isLocal(ssp.cape)){
File capeFile=new File(CustomSkinLoader.DATA_DIR,cape);
if(capeFile.exists()&&capeFile.isFile())
profile.capeUrl=HttpTextureUtil.getLocalLegacyFakeUrl(cape, HttpTextureUtil.getHash(cape, capeFile.length(), capeFile.lastModified()));
}else{
HttpResponce responce=HttpRequestUtil.makeHttpRequest(new HttpRequest(cape).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG!=null&&ssp.checkPNG!=false).setLoadContent(false).setCacheTime(90));
HttpResponce responce = HttpRequestUtil.makeHttpRequest(new HttpRequest(cape).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG!=null && ssp.checkPNG).setLoadContent(false).setCacheTime(90));
if(responce.success)
profile.capeUrl=HttpTextureUtil.getLegacyFakeUrl(cape);
}
}
if(ModelManager0.isElytraSupported()&&StringUtils.isNoneEmpty(ssp.elytra)){
String elytra=ssp.elytra.replaceAll(USERNAME_REGEX, username);
String elytra=ssp.elytra.replace(USERNAME_PLACEHOLDER, username);
if(HttpUtil0.isLocal(ssp.elytra)){
File elytraFile=new File(CustomSkinLoader.DATA_DIR,elytra);
if(elytraFile.exists()&&elytraFile.isFile())
profile.elytraUrl=HttpTextureUtil.getLocalLegacyFakeUrl(elytra, HttpTextureUtil.getHash(elytra, elytraFile.length(), elytraFile.lastModified()));
}else{
HttpResponce responce=HttpRequestUtil.makeHttpRequest(new HttpRequest(elytra).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG!=null&&ssp.checkPNG!=false).setLoadContent(false).setCacheTime(90));
HttpResponce responce=HttpRequestUtil.makeHttpRequest(new HttpRequest(elytra).setUserAgent(ssp.userAgent).setCheckPNG(ssp.checkPNG!=null && ssp.checkPNG).setLoadContent(false).setCacheTime(90));
if(responce.success)
profile.elytraUrl=HttpTextureUtil.getLegacyFakeUrl(elytra);
}
@@ -69,7 +69,7 @@ public class LegacyLoader implements ProfileLoader.IProfileLoader {
@Override
public boolean compare(SkinSiteProfile ssp0, SkinSiteProfile ssp1) {
return (StringUtils.isNoneEmpty(ssp0.skin)?ssp0.skin.equalsIgnoreCase(ssp1.skin):true) || (StringUtils.isNoneEmpty(ssp0.cape)?ssp0.cape.equalsIgnoreCase(ssp1.cape):true);
return (!StringUtils.isNoneEmpty(ssp0.skin) || ssp0.skin.equalsIgnoreCase(ssp1.skin)) || (!StringUtils.isNoneEmpty(ssp0.cape) || ssp0.cape.equalsIgnoreCase(ssp1.cape));
}
@Override
public String getName() {
@@ -85,8 +85,9 @@ public class LegacyLoader implements ProfileLoader.IProfileLoader {
if(HttpUtil0.isLocal(ssp.elytra))
initFolder(ssp.elytra);
}
@SuppressWarnings("ResultOfMethodCallIgnored")
private void initFolder(String target){
String file=target.replaceAll(USERNAME_REGEX, "init");
String file=target.replace(USERNAME_PLACEHOLDER, "init");
File folder=new File(CustomSkinLoader.DATA_DIR,file).getParentFile();
if(folder!=null&&!folder.exists())
folder.mkdirs();
@@ -1,9 +1,9 @@
package customskinloader.loader;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import com.google.common.collect.Maps;
import org.apache.commons.codec.Charsets;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
@@ -56,7 +56,7 @@ public class MojangAPILoader implements ProfileLoader.IProfileLoader {
}
//Username -> UUID
public static GameProfile loadGameProfile(String username) throws Exception{
public static GameProfile loadGameProfile(String username) {
//Doc (http://wiki.vg/Mojang_API#Username_-.3E_UUID_at_time)
HttpResponce responce=HttpRequestUtil.makeHttpRequest(new HttpRequest("https://api.mojang.com/users/profiles/minecraft/"+username).setCacheTime(0));
if(StringUtils.isEmpty(responce.content))
@@ -70,9 +70,11 @@ public class MojangAPILoader implements ProfileLoader.IProfileLoader {
return new GameProfile(gameProfile.getId(),gameProfile.getName());
}
//UUID -> Profile
public static GameProfile fillGameProfile(GameProfile profile) throws Exception{
public static GameProfile fillGameProfile(GameProfile profile) {
//Doc (http://wiki.vg/Mojang_API#UUID_-.3E_Profile_.2B_Skin.2FCape)
HttpResponce responce=HttpRequestUtil.makeHttpRequest(new HttpRequest("https://sessionserver.mojang.com/session/minecraft/profile/"+UUIDTypeAdapter.fromUUID(profile.getId())).setCacheTime(90));
HttpResponce responce = HttpRequestUtil.makeHttpRequest(
new HttpRequest("https://sessionserver.mojang.com/session/minecraft/profile/"
+ UUIDTypeAdapter.fromUUID(profile.getId())).setCacheTime(90));
if(StringUtils.isEmpty(responce.content))
return profile;
@@ -87,20 +89,20 @@ public class MojangAPILoader implements ProfileLoader.IProfileLoader {
return newGameProfile;
}
public static Map<MinecraftProfileTexture.Type,MinecraftProfileTexture> getTextures(GameProfile gameProfile) throws Exception{
public static Map<MinecraftProfileTexture.Type,MinecraftProfileTexture> getTextures(GameProfile gameProfile) {
if(gameProfile==null)
return new HashMap();
Property textureProperty=(Property)Iterables.getFirst(gameProfile.getProperties().get("textures"), null);
return Maps.newHashMap();
Property textureProperty=Iterables.getFirst(gameProfile.getProperties().get("textures"), null);
if (textureProperty==null)
return new HashMap();
return Maps.newHashMap();
String value=textureProperty.getValue();
if(StringUtils.isBlank(value))
return new HashMap();
String json=new String(Base64.decodeBase64(value),Charsets.UTF_8);
return Maps.newHashMap();
@SuppressWarnings("deprecation") String json = new String(Base64.decodeBase64(value), Charsets.UTF_8);
Gson gson=new GsonBuilder().registerTypeAdapter(UUID.class,new UUIDTypeAdapter()).create();
MinecraftTexturesPayload result=gson.fromJson(json,MinecraftTexturesPayload.class);
if (result==null||result.getTextures()==null)
return new HashMap();
return Maps.newHashMap();
return result.getTextures();
}
@@ -5,6 +5,7 @@ import java.util.HashMap;
import com.mojang.authlib.GameProfile;
import customskinloader.config.SkinSiteProfile;
import customskinloader.plugin.PluginLoader;
import customskinloader.profile.UserProfile;
public class ProfileLoader {
@@ -12,8 +13,10 @@ public class ProfileLoader {
new MojangAPILoader(),
new JsonAPILoader(JsonAPILoader.Type.CustomSkinAPI),
new JsonAPILoader(JsonAPILoader.Type.CustomSkinAPIPlus),
new LegacyLoader(),
new JsonAPILoader(JsonAPILoader.Type.UniSkinAPI)};
new JsonAPILoader(JsonAPILoader.Type.UniSkinAPI),
new JsonAPILoader(JsonAPILoader.Type.ElyByAPI),
new JsonAPILoader(JsonAPILoader.Type.GlitchlessAPI),
new LegacyLoader()};
public static final HashMap<String,IProfileLoader> LOADERS=initLoaders();
@@ -22,13 +25,14 @@ public class ProfileLoader {
for(IProfileLoader loader:DEFAULT_LOADERS){
loaders.put(loader.getName().toLowerCase(), loader);
}
loaders.putAll(PluginLoader.loadPlugins());
return loaders;
}
public interface IProfileLoader {
public UserProfile loadProfile(SkinSiteProfile ssp,GameProfile gameProfile) throws Exception;
public boolean compare(SkinSiteProfile ssp0,SkinSiteProfile ssp1);
public String getName();
public void initLocalFolder(SkinSiteProfile ssp);
UserProfile loadProfile(SkinSiteProfile ssp,GameProfile gameProfile) throws Exception;
boolean compare(SkinSiteProfile ssp0,SkinSiteProfile ssp1);
String getName();
void initLocalFolder(SkinSiteProfile ssp);
}
}
@@ -19,7 +19,7 @@ public class CustomSkinAPI implements IJsonAPI {
@Override
public String toJsonUrl(String root, String username) {
return new StringBuilder().append(root).append(username).append(SUFFIX).toString();
return root + username + SUFFIX;
}
@Override
@@ -22,14 +22,14 @@ public class CustomSkinAPIPlus implements IJsonAPI {
if(clientIDFile.isFile())
try{
clientID=FileUtils.readFileToString(clientIDFile);
clientID=FileUtils.readFileToString(clientIDFile, "UTF-8");
}catch(Exception e){
e.printStackTrace();
}
if(clientID==null){
clientID=UUID.randomUUID().toString();
try {
FileUtils.write(clientIDFile, clientID);
FileUtils.write(clientIDFile, clientID, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
}
@@ -42,9 +42,7 @@ public class CustomSkinAPIPlus implements IJsonAPI {
@Override
public String getPayload(SkinSiteProfile ssp) {
if(ssp.privacy==null)
ssp.privacy=new CustomSkinAPIPlusPrivacy();
return new Gson().toJson(new CustomSkinAPIPlusPayload(ssp.privacy));
return new Gson().toJson(new CustomSkinAPIPlusPayload());
}
@Override
@@ -58,25 +56,15 @@ public class CustomSkinAPIPlus implements IJsonAPI {
}
public static class CustomSkinAPIPlusPayload{
public String gameVersion;//minecraft version
public String modVersion;//mod version
public String serverAddress;//ip:port
public String clientID;//Minecraft Client ID
public CustomSkinAPIPlusPayload(CustomSkinAPIPlusPrivacy privacy){
if(privacy.gameVersion)
gameVersion=MinecraftUtil.getMinecraftMainVersion();
if(privacy.modVersion)
modVersion=CustomSkinLoader.CustomSkinLoader_VERSION;
if(privacy.serverAddress)
serverAddress=MinecraftUtil.isLanServer()?null:MinecraftUtil.getStandardServerAddress();
if(privacy.clientID)
clientID=CustomSkinAPIPlus.clientID;
String gameVersion;//minecraft version
String modVersion;//mod version
String serverAddress;//ip:port
String clientID;//Minecraft Client ID
CustomSkinAPIPlusPayload(){
gameVersion = MinecraftUtil.getMinecraftMainVersion();
modVersion = CustomSkinLoader.CustomSkinLoader_VERSION;
serverAddress = MinecraftUtil.isLanServer() ? null : MinecraftUtil.getStandardServerAddress();
clientID = CustomSkinAPIPlus.clientID;
}
}
public static class CustomSkinAPIPlusPrivacy{
public boolean gameVersion=true;
public boolean modVersion=true;
public boolean serverAddress=true;
public boolean clientID=true;
}
}
@@ -0,0 +1,50 @@
package customskinloader.loader.jsonapi;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.JsonAPILoader;
import customskinloader.profile.ModelManager0;
import customskinloader.profile.UserProfile;
import customskinloader.utils.MinecraftUtil;
import java.net.URI;
import java.util.Map;
public class ElyByAPI implements JsonAPILoader.IJsonAPI {
@Override
public String toJsonUrl(String root, String username) {
return "http://skinsystem.ely.by/textures/" + username + "?version=2&minecraft_version=" + MinecraftUtil.getMinecraftMainVersion();
}
@Override
public UserProfile toUserProfile(String root, String json, boolean local) {
Map<Type, MinecraftProfileTexture> result = new Gson().fromJson(json, new TypeToken<Map<Type, MinecraftProfileTexture>>() {
}.getType());
if (!result.containsKey(Type.SKIN))
return null;
//Check URL
try {
URI uri = new URI(result.get(Type.SKIN).getUrl());
if (!uri.getHost().endsWith("ely.by"))
return null;
} catch (Exception e) {
return null;
}
return ModelManager0.toUserProfile(result);
}
@Override
public String getPayload(SkinSiteProfile ssp) {
return null;
}
@Override
public String getName() {
return "ElyByAPI";
}
}
@@ -0,0 +1,40 @@
package customskinloader.loader.jsonapi;
import com.google.gson.Gson;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import customskinloader.config.SkinSiteProfile;
import customskinloader.loader.JsonAPILoader;
import customskinloader.profile.ModelManager0;
import customskinloader.profile.UserProfile;
import java.util.Map;
public class GlitchlessAPI implements JsonAPILoader.IJsonAPI {
@Override
public String toJsonUrl(String root, String username) {
return root + username;
}
@Override
public UserProfile toUserProfile(String root, String json, boolean local) {
GlitchlessApiResponse result = new Gson().fromJson(json, GlitchlessApiResponse.class);
if (!result.textures.containsKey(MinecraftProfileTexture.Type.SKIN))
return null;
return ModelManager0.toUserProfile(result.textures);
}
@Override
public String getPayload(SkinSiteProfile ssp) {
return null;
}
@Override
public String getName() {
return "GlitchlessAPI";
}
public static class GlitchlessApiResponse {
protected Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> textures;
}
}
@@ -19,7 +19,7 @@ public class UniSkinAPI implements IJsonAPI {
@Override
public String toJsonUrl(String root, String username) {
return new StringBuilder().append(root).append(username).append(SUFFIX).toString();
return root + username + SUFFIX;
}
@Override
@@ -0,0 +1,7 @@
package customskinloader.plugin;
import customskinloader.loader.ProfileLoader;
public interface ICustomSkinLoaderPlugin {
ProfileLoader.IProfileLoader getProfileLoader();
}
@@ -0,0 +1,39 @@
package customskinloader.plugin;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.ServiceLoader;
import org.apache.commons.io.FileUtils;
import customskinloader.CustomSkinLoader;
import customskinloader.loader.ProfileLoader;
public class PluginLoader {
public static HashMap<String, ProfileLoader.IProfileLoader> loadPlugins() {
File pluginsDir = new File(CustomSkinLoader.DATA_DIR, "Plugins");
ArrayList<URL> urls = new ArrayList<URL>();
if (!pluginsDir.isDirectory()) {
pluginsDir.mkdirs();
} else {
for (File plugin : FileUtils.listFiles(pluginsDir, new String[] {"jar", "zip"}, false)) {
try {
urls.add(plugin.toURI().toURL());
CustomSkinLoader.logger.info("Found a jar or zip file: " + plugin.getName());
} catch (MalformedURLException ignored) {}
}
}
ServiceLoader<ICustomSkinLoaderPlugin> sl = ServiceLoader.load(ICustomSkinLoaderPlugin.class, new URLClassLoader(urls.toArray(new URL[0]), PluginLoader.class.getClassLoader()));
HashMap<String, ProfileLoader.IProfileLoader> profileLoaders = new HashMap<String, ProfileLoader.IProfileLoader>();
for (ICustomSkinLoaderPlugin cslPlugin : sl) {
ProfileLoader.IProfileLoader profileLoader = cslPlugin.getProfileLoader();
profileLoaders.put(profileLoader.getName().toLowerCase(), profileLoader);
CustomSkinLoader.logger.info("Add profile loader: " + profileLoader.getName());
}
return profileLoaders;
}
}
@@ -1,12 +1,9 @@
package customskinloader.profile;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import com.google.common.collect.Lists;
import org.apache.commons.codec.Charsets;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
@@ -46,33 +43,34 @@ public class DynamicSkullManager {
private List<GameProfile> loadingList=new ArrayList<GameProfile>();
private void parseGameProfile(GameProfile profile){
Property textureProperty=(Property)Iterables.getFirst(profile.getProperties().get("textures"), null);
Property textureProperty = Iterables.getFirst(profile.getProperties().get("textures"), null);
if (textureProperty==null){
staticTextures.put(profile, new HashMap());
staticTextures.put(profile, Maps.<Type, MinecraftProfileTexture>newHashMap());
return;
}
String value=textureProperty.getValue();
if(StringUtils.isBlank(value)){
staticTextures.put(profile, new HashMap());
staticTextures.put(profile, Maps.<Type, MinecraftProfileTexture>newHashMap());
return;
}
String json=new String(Base64.decodeBase64(value),Charsets.UTF_8);
@SuppressWarnings("deprecation") String json = new String(Base64.decodeBase64(value), Charsets.UTF_8);
Gson gson=new GsonBuilder().registerTypeAdapter(UUID.class,new UUIDTypeAdapter()).create();
SkullTexture result=gson.fromJson(json,SkullTexture.class);
if(result==null){
staticTextures.put(profile, new HashMap());
staticTextures.put(profile, Maps.<Type, MinecraftProfileTexture>newHashMap());
return;
}
staticTextures.put(profile, (result.textures==null||!result.textures.containsKey(Type.SKIN))?new HashMap():parseTextures(result.textures));
staticTextures.put(profile, (result.textures==null || !result.textures.containsKey(Type.SKIN)) ?
Maps.<Type, MinecraftProfileTexture>newHashMap() : parseTextures(result.textures));
if(StringUtils.isNotEmpty(result.index)){
File indexFile=new File(CustomSkinLoader.DATA_DIR,result.index);
try{
String index=FileUtils.readFileToString(indexFile, Charsets.UTF_8);
String index=FileUtils.readFileToString(indexFile, "UTF-8");
if(StringUtils.isNotEmpty(index)){
ArrayList<String> skins=CustomSkinLoader.GSON.fromJson(index, ArrayList.class);
if(skins!=null&&!skins.isEmpty())
result.skins=skins;
String[] skins = CustomSkinLoader.GSON.fromJson(index, String[].class);
if(skins != null && skins.length != 0)
result.skins = Lists.newArrayList(skins);
}
}catch(Exception e){
CustomSkinLoader.logger.warning("Exception occurs while parsing index file: "+e.toString());
@@ -96,7 +94,6 @@ public class DynamicSkullManager {
}else{
//Could not find skin
result.skins.remove(i--);
continue;
}
}else{
//Online Skin
@@ -104,7 +101,6 @@ public class DynamicSkullManager {
if(!responce.success){
//Could not load skin
result.skins.remove(i--);
continue;
}
}
}
@@ -130,7 +126,7 @@ public class DynamicSkullManager {
return textures;
File skinFile=new File(CustomSkinLoader.DATA_DIR,skinUrl);
if(!skinFile.isFile())
return new HashMap();
return Maps.newHashMap();
textures.put(Type.SKIN, ModelManager0.getProfileTexture(HttpTextureUtil.getLocalFakeUrl(skinUrl), null));
return textures;
}
@@ -139,7 +135,7 @@ public class DynamicSkullManager {
if(staticTextures.get(profile)!=null)
return staticTextures.get(profile);
if(loadingList.contains(profile))
return new HashMap();
return Maps.newHashMap();
if(dynamicTextures.containsKey(profile)){
SkullTexture texture=dynamicTextures.get(profile);
long time=System.currentTimeMillis()-texture.startTime;
@@ -158,6 +154,6 @@ public class DynamicSkullManager {
};
loadThread.setName("Skull "+profile.hashCode());
loadThread.start();
return new HashMap();
return Maps.newHashMap();
}
}
@@ -16,7 +16,7 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
* @since 13.1
*/
public class ModelManager0 {
public static enum Model{
public enum Model{
SKIN_DEFAULT,
SKIN_SLIM,
CAPE,
@@ -67,17 +67,17 @@ public class ModelManager0 {
* @return profile - UserProfile instance
* @since 13.1
*/
public static UserProfile toUserProfile(Map profile){
public static UserProfile toUserProfile(Map<Type, MinecraftProfileTexture> profile){
UserProfile userProfile=new UserProfile();
if(profile==null)
return userProfile;
MinecraftProfileTexture skin=(MinecraftProfileTexture)profile.get(Type.SKIN);
MinecraftProfileTexture skin = profile.get(Type.SKIN);
userProfile.skinUrl= skin==null?null:skin.getUrl();//Avoid NullPointerException
userProfile.model= skin==null?null:skin.getMetadata("model");
if(StringUtils.isEmpty(userProfile.model))
userProfile.model="default";
MinecraftProfileTexture cape=(MinecraftProfileTexture)profile.get(Type.CAPE);
MinecraftProfileTexture cape = profile.get(Type.CAPE);
userProfile.capeUrl= cape==null?null:cape.getUrl();
return userProfile;
}
@@ -88,15 +88,15 @@ public class ModelManager0 {
* @return profile - hashMapProfile (HashMap<String,MinecraftProfileTexture>)
* @since 13.1
*/
public static Map fromUserProfile(UserProfile profile){
Map map=Maps.newHashMap();
public static Map<Type, MinecraftProfileTexture> fromUserProfile(UserProfile profile){
Map<Type, MinecraftProfileTexture> map=Maps.newHashMap();
if(profile==null)
return map;
if(profile.skinUrl!=null){
Map metadata=null;
if(profile.model!=null&&profile.model.equals("slim")){
Map<String,String> metadata = null;
if("slim".equals(profile.model) || "auto".equals(profile.model)){
metadata = Maps.newHashMap();
metadata.put("model", "slim");
metadata.put("model", profile.model);
}
map.put(Type.SKIN, getProfileTexture(profile.skinUrl,metadata));
}
@@ -115,7 +115,7 @@ public class ModelManager0 {
* @return MinecraftProfileTexture
* @since 14.5
*/
public static MinecraftProfileTexture getProfileTexture(String url,Map metadata){
public static MinecraftProfileTexture getProfileTexture(String url,Map<String,String> metadata){
return new MinecraftProfileTexture(url,metadata);
}
}
@@ -1,11 +1,9 @@
package customskinloader.profile;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.HashMap;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.FileUtils;
import customskinloader.CustomSkinLoader;
import customskinloader.utils.TimeUtil;
@@ -16,6 +14,7 @@ public class ProfileCache {
private HashMap<String,CachedProfile> cachedProfiles=new HashMap<String,CachedProfile>();
private HashMap<String,UserProfile> localProfiles=new HashMap<String,UserProfile>();
@SuppressWarnings("ResultOfMethodCallIgnored")
public ProfileCache(){
if(!PROFILE_CACHE_DIR.exists())
PROFILE_CACHE_DIR.mkdir();
@@ -26,11 +25,11 @@ public class ProfileCache {
}
public boolean isReady(String username){
CachedProfile cp=cachedProfiles.get(username.toLowerCase());
return cp==null?false:(cp.loading||cp.expiryTime>TimeUtil.getCurrentUnixTimestamp());
return cp != null && (cp.loading || cp.expiryTime > TimeUtil.getCurrentUnixTimestamp());
}
public boolean isExpired(String username){
CachedProfile cp=cachedProfiles.get(username.toLowerCase());
return cp==null?true:(cp.expiryTime<=TimeUtil.getCurrentUnixTimestamp());
return cp == null || (cp.expiryTime <= TimeUtil.getCurrentUnixTimestamp());
}
public UserProfile getProfile(String username){
@@ -74,7 +73,7 @@ public class ProfileCache {
localProfiles.put(username.toLowerCase(), null);
}
try{
String json=IOUtils.toString(new FileInputStream(localProfile));
String json = FileUtils.readFileToString(localProfile, "UTF-8");
UserProfile profile=CustomSkinLoader.GSON.fromJson(json, UserProfile.class);
localProfiles.put(username.toLowerCase(), profile);
CustomSkinLoader.logger.info("Successfully load LocalProfile.");
@@ -85,14 +84,14 @@ public class ProfileCache {
}
return null;
}
private void saveLocalProfile(String username,UserProfile profile){
@SuppressWarnings("ResultOfMethodCallIgnored")
private void saveLocalProfile(String username, UserProfile profile){
String json=CustomSkinLoader.GSON.toJson(profile);
File localProfile=new File(PROFILE_CACHE_DIR,username+".json");
if(localProfile.exists())
localProfile.delete();
try {
localProfile.createNewFile();
IOUtils.write(json, new FileOutputStream(localProfile));
FileUtils.write(localProfile, json, "UTF-8");
CustomSkinLoader.logger.info("Successfully save LocalProfile.");
} catch (Exception e) {
CustomSkinLoader.logger.info("Failed to save LocalProfile.("+e.toString()+")");
@@ -52,7 +52,6 @@ public class UserProfile {
return;
case ELYTRA:
this.capeUrl=url;
return;
}
}
@@ -92,8 +91,10 @@ public class UserProfile {
public void mix(UserProfile profile){
if(profile==null)
return;
if(StringUtils.isEmpty(this.skinUrl))
this.skinUrl=profile.skinUrl;
if(StringUtils.isEmpty(this.skinUrl)) {
this.skinUrl = profile.skinUrl;
this.model = profile.model;
}
if(StringUtils.isEmpty(this.capeUrl))
this.capeUrl=profile.capeUrl;
if(StringUtils.isEmpty(this.elytraUrl))
@@ -12,7 +12,6 @@ import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.Charsets;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@@ -74,6 +73,10 @@ public class HttpRequestUtil {
public static final File CACHE_DIR=new File(CustomSkinLoader.DATA_DIR,"caches");
public static HttpResponce makeHttpRequest(HttpRequest request){
return makeHttpRequest(request, 0);
}
public static HttpResponce makeHttpRequest(HttpRequest request, int redirectTime){
try{
CustomSkinLoader.logger.debug("Try to request '"+request.url+(request.userAgent==null?"'.":"' with user agent '"+request.userAgent+"'."));
//Check Cache
@@ -89,7 +92,7 @@ public class HttpRequestUtil {
if(request.cacheTime==0 && request.cacheFile.isFile())
return loadFromCache(request,new HttpResponce());
if(cacheInfoFile!=null&&cacheInfoFile.isFile()){
String json=FileUtils.readFileToString(cacheInfoFile);
String json=FileUtils.readFileToString(cacheInfoFile, "UTF-8");
if(StringUtils.isNotEmpty(json))
cacheInfo=CustomSkinLoader.GSON.fromJson(json, CacheInfo.class);
if(cacheInfo==null)
@@ -121,7 +124,7 @@ public class HttpRequestUtil {
CustomSkinLoader.logger.info("Payload: "+request.payload);
c.setDoOutput(true);
OutputStream os=c.getOutputStream();
IOUtils.write(request.payload, os);
IOUtils.write(request.payload, os, "UTF-8");
IOUtils.closeQuietly(os);
}
c.connect();
@@ -129,15 +132,31 @@ public class HttpRequestUtil {
//Check Connection
HttpResponce responce=new HttpResponce();
responce.responceCode=c.getResponseCode();
int res=c.getResponseCode()/100;
if(res==4||res==5){//Failed
CustomSkinLoader.logger.debug("Failed to request (Response Code: "+c.getResponseCode()+")");
int res = c.getResponseCode();
if (res / 100 == 4 || res / 100 == 5) {//Failed
CustomSkinLoader.logger.debug("Failed to request (Response Code: " + res + ")");
return responce;
}
if (res == HttpURLConnection.HTTP_MOVED_PERM || res == HttpURLConnection.HTTP_MOVED_TEMP) {
//Redirect
if (redirectTime >= 4) {
CustomSkinLoader.logger.debug("Failed to request (Too many redirection)");
return responce;
}
request.url = c.getHeaderField("Location");//Get redirecting location
if (request.url == null) {
CustomSkinLoader.logger.debug("Failed to request (Redirecting location not found)");
return responce;
}
CustomSkinLoader.logger.debug("Redirect to: " + request.url);
return makeHttpRequest(request, redirectTime + 1);//Recursion
}
responce.success=true;
CustomSkinLoader.logger.debug("Successfully request (Response Code: "+c.getResponseCode()+" , Content Length: "+c.getContentLength()+")");
CustomSkinLoader.logger.debug("Successfully request (Response Code: " + res + " , Content Length: " + c.getContentLength() + ")");
if(responce.responceCode==HttpURLConnection.HTTP_NOT_MODIFIED)
return loadFromCache(request,responce);
if (responce.responceCode == HttpURLConnection.HTTP_NO_CONTENT)
request.cacheTime = 3600;
//Load Content
InputStream is="gzip".equals(c.getContentEncoding())?new GZIPInputStream(c.getInputStream()):c.getInputStream();
@@ -154,13 +173,13 @@ public class HttpRequestUtil {
cacheInfo.etag=c.getHeaderField("ETag");
cacheInfo.lastModified=c.getLastModified();
cacheInfo.expire=getExpire(c,request.cacheTime);
FileUtils.write(cacheInfoFile, CustomSkinLoader.GSON.toJson(cacheInfo));
FileUtils.write(cacheInfoFile, CustomSkinLoader.GSON.toJson(cacheInfo), "UTF-8");
}
CustomSkinLoader.logger.debug("Saved to cache (Length: "+request.cacheFile.length()+" , Path: '"+request.cacheFile.getAbsolutePath()+"' , Expire: "+cacheInfo.expire+")");
}
if(!request.loadContent)
return responce;
responce.content=new String(bytes,Charsets.UTF_8);
responce.content=new String(bytes, "UTF-8");
CustomSkinLoader.logger.debug("Content: "+responce.content);
return responce;
@@ -187,7 +206,7 @@ public class HttpRequestUtil {
CustomSkinLoader.logger.info("Try to load from cache '"+request.cacheFile.getAbsolutePath()+"'.");
try {
responce.content=FileUtils.readFileToString(request.cacheFile);
responce.content=FileUtils.readFileToString(request.cacheFile, "UTF-8");
CustomSkinLoader.logger.debug("Successfully load from cache");
CustomSkinLoader.logger.debug("Content: "+responce.content);
} catch (IOException e) {
@@ -201,7 +220,7 @@ public class HttpRequestUtil {
String cacheControl=connection.getHeaderField("Cache-Control");
if(StringUtils.isNotEmpty(cacheControl)){
Matcher m=MAX_AGE_PATTERN.matcher(cacheControl);
if(m!=null && m.matches())
if(m.matches())
return TimeUtil.getUnixTimestamp(Long.parseLong(m.group(m.groupCount())));
}
long expires=connection.getExpiration();
@@ -18,6 +18,7 @@ public class HttpTextureUtil {
LOCAL_MARK="(LOCAL)",
LOCAL_LEGACY_MARK="(LOCAL_LEGACY)";
public static File defaultCacheDir;
@SuppressWarnings("ResultOfMethodCallIgnored")
public static void cleanCacheDir(){
if(defaultCacheDir!=null){
defaultCacheDir.delete();
@@ -54,13 +55,13 @@ public class HttpTextureUtil {
if(fakeUrl.startsWith(LEGACY_MARK)){
fakeUrl=fakeUrl.replace(LEGACY_MARK, "");
info.url=fakeUrl;
info.hash=DigestUtils.sha1Hex(info.url);;
info.cacheFile=HttpTextureUtil.getCacheFile(info.hash);
info.hash=DigestUtils.sha1Hex(info.url);
info.cacheFile = HttpRequestUtil.getCacheFile(info.hash);
return info;
}
return info;
}
public static String getLegacyFakeUrl(String url){
return LEGACY_MARK+url;
}
@@ -1,21 +1,18 @@
package customskinloader.utils;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.*;
import org.apache.commons.lang3.StringUtils;
public class HttpUtil0 {
public static boolean isLocal(String url){
return url==null? false : !url.startsWith("http");
return url != null && !url.startsWith("http");
}
//From: http://blog.csdn.net/xiyushiyi/article/details/46685387
@@ -37,7 +34,8 @@ public class HttpUtil0 {
try {
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
//HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
HttpsURLConnection.setDefaultSSLSocketFactory(new SSLSocketFactoryFacade());
HttpsURLConnection.setDefaultHostnameVerifier(doNotVerify);
} catch (Exception e) {
e.printStackTrace();
@@ -76,4 +74,49 @@ public class HttpUtil0 {
num+=Integer.parseInt(ips[i])*(256^(3-i));
return num;
}
//https://stackoverflow.com/questions/30817934/extended-server-name-sni-extension-not-sent-with-jdk1-8-0-but-send-with-jdk1-7
public static class SSLSocketFactoryFacade extends SSLSocketFactory {
SSLSocketFactory sslsf;
public SSLSocketFactoryFacade() {
sslsf = (SSLSocketFactory) SSLSocketFactory.getDefault();;
}
@Override
public String[] getDefaultCipherSuites() {
return sslsf.getDefaultCipherSuites();
}
@Override
public String[] getSupportedCipherSuites() {
return sslsf.getSupportedCipherSuites();
}
@Override
public Socket createSocket(Socket socket, String s, int i, boolean b) throws IOException {
return sslsf.createSocket(socket, s, i, b);
}
@Override
public Socket createSocket(String s, int i) throws IOException, UnknownHostException {
return sslsf.createSocket(s, i);
}
@Override
public Socket createSocket(String s, int i, InetAddress inetAddress, int i1) throws IOException, UnknownHostException {
return sslsf.createSocket(s, i, inetAddress, i1);
}
@Override
public Socket createSocket(InetAddress inetAddress, int i) throws IOException {
return createSocket(inetAddress, i);
}
@Override
public Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress1, int i1) throws IOException {
return createSocket(inetAddress, i, inetAddress1, i1);
}
}
}
@@ -0,0 +1,34 @@
package customskinloader.utils;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.LinkedList;
public class JavaUtil {
public static URL[] getClasspath() {
if (JavaUtil.class.getClassLoader() instanceof URLClassLoader) {
//Java 8-
//Use URLClassLoader Directly
URLClassLoader ucl = (URLClassLoader) JavaUtil.class.getClassLoader();
return ucl.getURLs();
} else {
//Java 9+
//It uses APPClassLoader instead of URLClassLoader
//Get Classpath from properties and parse it to URL array
String classpath = System.getProperty("java.class.path");
String[] elements = classpath.split(File.pathSeparator);
if (elements.length == 0)
return new URL[0];
LinkedList<URL> urls = new LinkedList<URL>();
for (String ele : elements) {
try {
urls.add(new File(ele).toURI().toURL());
} catch (Exception ignored) {
}
}
return urls.toArray(new URL[0]);
}
}
}
@@ -2,7 +2,6 @@ package customskinloader.utils;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.regex.Matcher;
@@ -13,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureManager;
/**
@@ -22,13 +22,13 @@ import net.minecraft.client.renderer.texture.TextureManager;
*/
public class MinecraftUtil {
public static File getMinecraftDataDir(){
return net.minecraft.client.Minecraft.getMinecraft().mcDataDir;
return Minecraft.getMinecraft().gameDir;
}
public static MinecraftSessionService getSessionService(){
return net.minecraft.client.Minecraft.getMinecraft().getSessionService();
return Minecraft.getMinecraft().getSessionService();
}
public static TextureManager getTextureManager(){
return net.minecraft.client.Minecraft.getMinecraft().getTextureManager();
return Minecraft.getMinecraft().getTextureManager();
}
private static ArrayList<String> minecraftVersion=new ArrayList<String>();
@@ -66,7 +66,7 @@ public class MinecraftUtil {
// (domain|ip)(:port)
public static String getServerAddress(){
net.minecraft.client.multiplayer.ServerData data=net.minecraft.client.Minecraft.getMinecraft().getCurrentServerData();
net.minecraft.client.multiplayer.ServerData data = Minecraft.getMinecraft().getCurrentServerData();
if(data==null)//Single Player
return null;
return data.serverIP;
@@ -79,14 +79,13 @@ public class MinecraftUtil {
return HttpUtil0.isLanServer(getStandardServerAddress());
}
public static String getCurrentUsername(){
return net.minecraft.client.Minecraft.getMinecraft().getSession().getProfile().getName();
return Minecraft.getMinecraft().getSession().getProfile().getName();
}
private final static Pattern MINECRAFT_CORE_FILE_PATTERN = Pattern.compile("^(.*?)/versions/([^\\/\\\\]*?)/([^\\/\\\\]*?).jar$");
private static void testProbe(){
minecraftVersion.clear();
URLClassLoader ucl = (URLClassLoader)new MinecraftUtil().getClass().getClassLoader();
URL urls[] = ucl.getURLs();
URL urls[] = JavaUtil.getClasspath();
for(URL url:urls){
Matcher m = null;
try{
@@ -100,27 +99,23 @@ public class MinecraftUtil {
}
}
public static boolean isCoreFile(URL url){
Matcher m = null;
try{
m=MINECRAFT_CORE_FILE_PATTERN.matcher(URLDecoder.decode(url.getPath(),"UTF-8"));
}catch(Exception e){
e.printStackTrace();
return false;
}
return m!=null && m.matches();
public static boolean isCoreFile(URL url) {
return regexMatch(url, MINECRAFT_CORE_FILE_PATTERN);
}
private final static Pattern LIBRARY_FILE_PATTERN = Pattern.compile("^(.*?)/libraries/(.*?)/([^\\/\\\\]*?).jar$");
public static boolean isLibraryFile(URL url){
Matcher m = null;
try{
m=LIBRARY_FILE_PATTERN.matcher(URLDecoder.decode(url.getPath(),"UTF-8"));
}catch(Exception e){
public static boolean isLibraryFile(URL url) {
return regexMatch(url, LIBRARY_FILE_PATTERN);
}
private static boolean regexMatch(URL url, Pattern p) {
Matcher m;
try {
m=p.matcher(URLDecoder.decode(url.getPath(), "UTF-8"));
} catch (Exception e) {
e.printStackTrace();
return false;
}
return m!=null && m.matches();
return m.matches();
}
public static String getCredential(GameProfile profile) {
@@ -2,7 +2,7 @@ package customskinloader.utils;
public class TimeUtil {
public static long getCurrentUnixTimestamp(){
return System.currentTimeMillis()/1000l;
return System.currentTimeMillis() / 1000L;
}
public static long getUnixTimestamp(long offset){
return getCurrentUnixTimestamp()+offset;
@@ -0,0 +1,50 @@
package customskinloader.utils;
import org.apache.commons.lang3.StringUtils;
public class Version implements Comparable {
private String version;
private int sub[];
public Version(String version) {
if (version == null) version = "";
this.version = version;
//Parse Subversion
String[] split = version.split("\\.");
sub = new int[split.length];
for (int i = 0; i < split.length; i++) {
if (StringUtils.isNumeric(split[i]))
sub[i] = Integer.parseInt(split[i]);
}
}
public static Version of(String version) {
return new Version(version);
}
public static int compare(String version, String anotherVersion) {
return Version.of(version).compareTo(anotherVersion);
}
@Override
public String toString() {
return version;
}
@Override
public int compareTo(Object o) {
if (o instanceof String) o = Version.of((String) o);//Parse String version
if (!(o instanceof Version)) throw new IllegalArgumentException(String.format("'%s' is not a Version.", o));
Version v = (Version) o;
int i = 0;
//Skip same subversion
while (i < sub.length && i < v.sub.length && sub[i] == v.sub[i]) i++;
//Compare first non-equal number
if (i < sub.length && i < v.sub.length)
return (sub[i] < v.sub[i]) ? -1 : ((sub[i] == v.sub[i]) ? 0 : 1); //Integer.compare(sub[i], v.sub[i]);
//Compare length if all subversion is same
return Integer.signum(sub.length - v.sub.length);
}
}
@@ -0,0 +1,57 @@
package net.minecraft.client.renderer.texture;
/**
* Empty stack for NativeImage
*/
public class NativeImage {
public NativeImage(int p_i48122_1_, int p_i48122_2_, boolean p_i48122_3_) {
}
/**
* getWidth
*/
public int func_195702_a() {
return 0;
}
/**
* getHeight
*/
public int func_195714_b() {
return 0;
}
/**
* copyImage image
*/
public void func_195703_a(NativeImage p_195703_1_) {
}
/**
* fillAreaRGBA x0 y0 weight height rgba
*/
public void func_195715_a(int p_195715_1_, int p_195715_2_, int p_195715_3_, int p_195715_4_, int p_195715_5_) {
}
/**
* copyAreaRGBA x0 y0 dx dy weight height reversex reversey
*/
public void func_195699_a(int p_195699_1_, int p_195699_2_, int p_195699_3_, int p_195699_4_, int p_195699_5_, int p_195699_6_, boolean p_195699_7_, boolean p_195699_8_) {
}
/**
* getPixelRGBA x y
*/
public int func_195709_a(int p_195709_1_, int p_195709_2_) {
return 0;
}
/**
* setPixelRGBA x y rgba
*/
public void func_195700_a(int p_195700_1_, int p_195700_2_, int p_195700_3_) {
}
public void close() {
}
}
+44
View File
@@ -0,0 +1,44 @@
CL: net/minecraft/client/Minecraft net/minecraft/class_310
CL: net/minecraft/client/multiplayer/ServerData net/minecraft/class_642
CL: net/minecraft/client/renderer/IImageBuffer net/minecraft/class_760
CL: net/minecraft/client/renderer/ThreadDownloadImageData net/minecraft/class_1046
CL: net/minecraft/client/renderer/texture/ITextureObject net/minecraft/class_1062
CL: net/minecraft/client/renderer/texture/NativeImage net/minecraft/class_1011
CL: net/minecraft/client/renderer/texture/SimpleTexture net/minecraft/class_1049
CL: net/minecraft/client/renderer/texture/TextureManager net/minecraft/class_1060
CL: net/minecraft/client/resources/DefaultPlayerSkin net/minecraft/class_1068
CL: net/minecraft/client/resources/SkinManager net/minecraft/class_1071
CL: net/minecraft/client/resources/SkinManager$SkinAvailableCallback net/minecraft/class_1071$class_1072
CL: net/minecraft/client/texture/PlayerSkinProvider net/minecraft/class_1071
CL: net/minecraft/util/ResourceLocation net/minecraft/class_2960
CL: net/minecraft/util/Session net/minecraft/class_320
CL: net/minecraft/util/StringUtils net/minecraft/class_3544
FD: net/minecraft/client/Minecraft/field_71412_D net/minecraft/class_310/field_1697
FD: net/minecraft/client/multiplayer/ServerData/field_78845_b net/minecraft/class_642/field_3761
MD: net/minecraft/client/Minecraft/addScheduledTask (Ljava/lang/Runnable;)V net/minecraft/class_310/execute (Ljava/lang/Runnable;)V
MD: net/minecraft/client/Minecraft/func_110432_I ()Lnet/minecraft/util/Session; net/minecraft/class_310/method_1548 ()Lnet/minecraft/class_320;
MD: net/minecraft/client/Minecraft/func_110434_K ()Lnet/minecraft/client/renderer/texture/TextureManager; net/minecraft/class_310/method_1531 ()Lnet/minecraft/class_1060;
MD: net/minecraft/client/Minecraft/func_147104_D ()Lnet/minecraft/client/multiplayer/ServerData; net/minecraft/class_310/method_1558 ()Lnet/minecraft/class_642;
MD: net/minecraft/client/Minecraft/func_152342_ad ()Lnet/minecraft/client/resources/SkinManager; net/minecraft/class_310/method_1582 ()Lnet/minecraft/class_1071;
MD: net/minecraft/client/Minecraft/func_152347_ac ()Lcom/mojang/authlib/minecraft/MinecraftSessionService; net/minecraft/class_310/method_1495 ()Lcom/mojang/authlib/minecraft/MinecraftSessionService;
MD: net/minecraft/client/Minecraft/func_71410_x ()Lnet/minecraft/client/Minecraft; net/minecraft/class_310/method_1551 ()Lnet/minecraft/class_310;
MD: net/minecraft/client/renderer/IImageBuffer/func_152634_a ()V net/minecraft/class_760/method_3238 ()V
MD: net/minecraft/client/renderer/IImageBuffer/func_195786_a (Lnet/minecraft/client/renderer/texture/NativeImage;)Lnet/minecraft/client/renderer/texture/NativeImage; net/minecraft/class_760/method_3237 (Lnet/minecraft/class_1011;)Lnet/minecraft/class_1011;
MD: net/minecraft/client/renderer/texture/NativeImage/func_195699_a (IIIIIIZZ)V net/minecraft/class_1011/method_4304 (IIIIIIZZ)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195700_a (III)V net/minecraft/class_1011/method_4305 (III)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195702_a ()I net/minecraft/class_1011/method_4307 ()I
MD: net/minecraft/client/renderer/texture/NativeImage/func_195703_a (Lnet/minecraft/client/renderer/texture/NativeImage;)V net/minecraft/class_1011/method_4317 (Lnet/minecraft/class_1011;)V
MD: net/minecraft/client/renderer/texture/NativeImage/func_195709_a (II)I net/minecraft/class_1011/method_4315 (II)I
MD: net/minecraft/client/renderer/texture/NativeImage/func_195714_b ()I net/minecraft/class_1011/method_4323 ()I
MD: net/minecraft/client/renderer/texture/NativeImage/func_195715_a (IIIII)V net/minecraft/class_1011/method_4326 (IIIII)V
MD: net/minecraft/client/renderer/texture/TextureManager/func_110579_a (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z net/minecraft/class_1060/method_4616 (Lnet/minecraft/class_2960;Lnet/minecraft/class_1062;)Z
MD: net/minecraft/client/renderer/texture/TextureManager/func_110581_b (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; net/minecraft/class_1060/method_4619 (Lnet/minecraft/class_2960;)Lnet/minecraft/class_1062;
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177334_a (Ljava/util/UUID;)Lnet/minecraft/util/ResourceLocation; net/minecraft/class_1068/method_4648 (Ljava/util/UUID;)Lnet/minecraft/class_2960;
MD: net/minecraft/client/resources/DefaultPlayerSkin/func_177335_a ()Lnet/minecraft/util/ResourceLocation; net/minecraft/class_1068/method_4649 ()Lnet/minecraft/class_2960;
MD: net/minecraft/client/resources/SkinManager/func_152790_a (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V net/minecraft/class_1071/method_4652 (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/class_1071$class_1072;Z)V
MD: net/minecraft/client/resources/SkinManager$SkinAvailableCallback/func_180521_a (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/util/ResourceLocation;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V net/minecraft/class_1071$class_1072/onSkinTextureAvailable (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/class_2960;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;)V
MD: net/minecraft/client/texture/PlayerSkinProvider/loadSkin (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation; net/minecraft/class_1071/method_4651 (Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/class_1071$class_1072;)Lnet/minecraft/class_2960;
MD: net/minecraft/client/texture/PlayerSkinProvider/loadSkin (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V net/minecraft/class_1071/method_4652 (Lcom/mojang/authlib/GameProfile;Lnet/minecraft/class_1071$class_1072;Z)V
MD: net/minecraft/client/texture/PlayerSkinProvider/getTextures (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map; net/minecraft/class_1071/method_4654 (Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;
MD: net/minecraft/util/Session/func_148256_e ()Lcom/mojang/authlib/GameProfile; net/minecraft/class_320/method_1677 ()Lcom/mojang/authlib/GameProfile;
MD: net/minecraft/util/StringUtils/func_76338_a (Ljava/lang/String;)Ljava/lang/String; net/minecraft/class_3544/method_15440 (Ljava/lang/String;)Ljava/lang/String;
+105
View File
@@ -0,0 +1,105 @@
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
apply from: rootProject.file("BuildScripts/version.gradle")
version = getCSLVersion()
group = "customskinloader"
archivesBaseName = "CustomSkinLoader_Fabric"
ext.shortVersion = getShortVersion()
sourceCompatibility = targetCompatibility = 1.6
compileJava {
sourceCompatibility = targetCompatibility = 1.6
}
minecraft {
version = config.forge_mc_version + "-" + config.forge_version
runDir = "run"
mappings = config.mappings_version
replace '@MOD_VERSION@', rootProject.ext.config.version
replace '@MOD_FULL_VERSION@', project.version
replaceIn 'CustomSkinLoader.java'
}
jar {
exclude 'net/**'
}
repositories {
maven {
name = "sponge"
url = "https://repo.spongepowered.org/maven"
}
}
dependencies {
implementation 'org.spongepowered:mixin:0.7.11-SNAPSHOT'
}
mixin {
add sourceSets.main, "customskinloader.refmap.json"
reobfSrgFile = config.srg_notch_map
}
sourceSets {
main {
java {
//Common
srcDir '../Common/source'
//Fabric
srcDir 'source'
}
resources {
//Common
srcDir '../Common/resource'
exclude 'Profile.json'
//Fabric
srcDir 'resource'
}
}
}
processResources {
expand([
modVersion : rootProject.ext.config.version,
modFullVersion : project.version,
modShortFullVersion: shortVersion,
mcVersion : config.minecraft_version,
mcFullVersions : config.minecraft_full_versions,
forgeVersion : config.forge_version,
gitVersion : System.getenv("CIRCLE_SHA1"),
buildUrl : System.getenv("CIRCLE_BUILD_URL")
])
}
apply from: rootProject.file("BuildScripts/remap.gradle")
task afterBuild {
doLast {
//renameSrgJar
def file0 = file("build/libs/${archivesBaseName}-${version}.jar")
def file1 = file("build/libs/${archivesBaseName}-${version}-srg.jar")
file0.renameTo(file1)
//reobfSrgToNotch
reobfSrgToNotch()
//copyBuildFile
copy {
from 'build/libs'
into '../build/libs'
include '**/*.jar'
exclude '**/*-dev.jar'
exclude '**/*-srg.jar'
exclude '**/*-sources.jar'
}
}
}
build.finalizedBy afterBuild
+7
View File
@@ -0,0 +1,7 @@
minecraft_version=1.14
minecraft_full_versions=1.14,1.14.1,1.14.2
#forge gradle needs forge version
forge_mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=stable_39
srg_notch_map=Fabric.srg
@@ -0,0 +1,13 @@
{
"required": true,
"package": "customskinloader.fabric.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [
],
"client": [
"MixinPlayerSkinProvider"
],
"injectors": {
"defaultRequire": 1
}
}
+34
View File
@@ -0,0 +1,34 @@
{
"schemaVersion": 1,
"id": "customskinloader",
"version": "${modFullVersion}",
"name": "CustomSkinLoader",
"description": "Custom Skin Loader for Minecraft",
"authors": ["xfl03", "JLChnToZ"],
"contact": {
"homepage": "https://github.com/xfl03/MCCustomSkinLoader",
"issues": "https://github.com/xfl03/MCCustomSkinLoader/issues",
"sources": "https://github.com/xfl03/MCCustomSkinLoader"
},
"license": "GPLv3",
"environment": "client",
"entrypoints": {
"main": [
]
},
"mixins": [
"customskinloader.mixins.json"
],
"requires": {
"fabricloader": ">=0.4.0",
"fabric": "*"
},
"suggests": {
"flamingo": "*"
}
}
@@ -0,0 +1,43 @@
package customskinloader.fabric.mixin;
import java.io.File;
import java.util.Map;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import customskinloader.fake.FakeSkinManager;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.SkinManager;
import net.minecraft.client.texture.PlayerSkinProvider;
import net.minecraft.util.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = {PlayerSkinProvider.class})
public abstract class MixinPlayerSkinProvider {
private FakeSkinManager fakeManager;
@Inject(method = "<init>", at = @At("RETURN"))
private void initFakeSkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService, CallbackInfo callbackInfo) {
this.fakeManager = new FakeSkinManager(textureManagerInstance, skinCacheDirectory, sessionService);
}
@Overwrite
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, MinecraftProfileTexture.Type textureType, SkinManager.SkinAvailableCallback skinAvailableCallback) {
return this.fakeManager.loadSkin(profileTexture, textureType, skinAvailableCallback);
}
@Overwrite
public void loadSkin(GameProfile profile, SkinManager.SkinAvailableCallback skinAvailableCallback, boolean requireSecure) {
this.fakeManager.loadProfileTextures(profile, skinAvailableCallback, requireSecure);
}
@Overwrite
public Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> getTextures(GameProfile profile) {
return this.fakeManager.loadSkinFromCache(profile);
}
}
@@ -0,0 +1,40 @@
package net.minecraft.client;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.SkinManager;
import net.minecraft.util.Session;
import java.io.File;
public class Minecraft {
public File gameDir = null;
public static Minecraft getMinecraft() {
return null;
}
public SkinManager getSkinManager() {
return null;
}
public TextureManager getTextureManager() {
return null;
}
public MinecraftSessionService getSessionService() {
return null;
}
public Session getSession() {
return null;
}
public ServerData getCurrentServerData() {
return null;
}
public void addScheduledTask(Runnable r) {
}
}
@@ -0,0 +1,21 @@
package net.minecraft.client.texture;
import java.util.Map;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import net.minecraft.client.resources.SkinManager;
import net.minecraft.util.ResourceLocation;
public class PlayerSkinProvider {
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, MinecraftProfileTexture.Type textureType, SkinManager.SkinAvailableCallback skinAvailableCallback) {
return null;
}
public void loadSkin(GameProfile profile, SkinManager.SkinAvailableCallback skinAvailableCallback, boolean requireSecure) {
}
public Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> getTextures(GameProfile profile) {
return null;
}
}
+1
View File
@@ -1,2 +1,3 @@
/bin/
/build/
/run/
Binary file not shown.
+75 -66
View File
@@ -1,11 +1,11 @@
buildscript {
repositories {
/*maven {
name = "fmm"
url = "http://forgemavenmirror.sinaapp.com/maven"
}*/
mavenCentral()
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
@@ -13,96 +13,105 @@ buildscript {
}
apply plugin: 'net.minecraftforge.gradle.forge'
ext.MINECRAFT_VERSION="1.12.2"
ext.FORGE_VERSION="14.23.2.2611"
ext.MAPPING_VERSION="snapshot_20180210"
ext.MINECRAFT_FULL_VERSIONS="1.8,1.8.8,1.8.9,1.9,1.9.4,1.10,1.10.2,1.11,1.11.2,1.12,1.12.1,1.12.2"
ext.snapshot = !(rootProject.ext.config.snapshot==""||rootProject.ext.config.snapshot=="0"||rootProject.ext.config.snapshot==0)
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
apply from: rootProject.file("BuildScripts/version.gradle")
archivesBaseName = "CustomSkinLoader_Forge"
version = rootProject.ext.config.version + rootProject.ext.config.dev_version + (snapshot?"-SNAPSHOT-"+System.getenv("CIRCLE_BUILD_NUM"):"")
version = getCSLVersion()
group = "customskinloader"
sourceCompatibility = targetCompatibility = "1.6"
sourceCompatibility = targetCompatibility = 1.6
compileJava {
sourceCompatibility = targetCompatibility = "1.6"
sourceCompatibility = targetCompatibility = 1.6
}
jar {
manifest {
attributes 'FMLCorePlugin': 'customskinloader.forge.ForgePlugin'
attributes 'FMLCorePluginContainsFMLMod': true
attributes([
"FMLCorePlugin" : "customskinloader.forge.ForgePlugin",
"FMLCorePluginContainsFMLMod": true,
"Specification-Title" : "CustomSkinLoader",
"Specification-Vendor" : "xfl03",
"Specification-Version" : "1",
"Implementation-Title" : "CustomSkinLoader",
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "xfl03",
"Implementation-Timestamp" : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
exclude 'net/minecraft/client/renderer/**'
exclude 'net/minecraftforge/**'
}
sourceSets {
main {
java {
srcDir 'MergedSource'//Merge source
//Common
srcDir '../Common/source'
//Forge
srcDir 'source'
}
resources {
srcDir 'MergedResource'
//Common
srcDir '../Common/resource'
exclude 'Profile.json'
//Forge
srcDir 'resource'
}
}
}
minecraft {
version = MINECRAFT_VERSION+"-"+FORGE_VERSION
version = config.forge_mc_version + "-" + config.forge_version
runDir = "run"
mappings = MAPPING_VERSION
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
mappings = config.mappings_version
clientJvmArgs += "-Dfml.coreMods.load=customskinloader.forge.ForgePlugin"
replace '@MOD_VERSION@', rootProject.ext.config.version
replace '@MOD_FULL_VERSION@', project.version
replaceIn 'CustomSkinLoader.java'
replaceIn 'ForgeMod.java'
}
task mergeSource { doLast {
copy {
from '../Common/source'
exclude '**/tweaker/**'
from 'source'
into 'MergedSource'
}
}}
sourceMainJava.dependsOn mergeSource
task mergeResources { doLast {
copy {
from '../Common/resource'
from 'resource'
into 'MergedResource'
}
}}
processResources.dependsOn mergeResources
processResources
{
expand ([
modVersion :rootProject.ext.config.version,
modFullVersion :project.version,
mcVersion :MINECRAFT_VERSION,
mcFullVersions :MINECRAFT_FULL_VERSIONS,
forgeVersion :FORGE_VERSION,
gitVersion :System.getenv("CIRCLE_SHA1"),
buildUrl :System.getenv("CIRCLE_BUILD_URL")
])
processResources {
filesNotMatching("**/*.js"){
expand([
modVersion : rootProject.ext.config.version,
modFullVersion: project.version,
mcVersion : config.minecraft_version,
mcFullVersions: config.minecraft_full_versions,
forgeVersion : config.forge_version,
gitVersion : System.getenv("CIRCLE_SHA1"),
buildUrl : System.getenv("CIRCLE_BUILD_URL")
])}
}
task afterBuild { doLast {
//Clean Up
def sourceDir = file("MergedSource")
sourceDir.deleteDir()
def resourceDir = file("MergedResource")
resourceDir.deleteDir()
task signJar(type: SignJar, dependsOn: reobfJar) {
onlyIf { System.getenv("KEY_PASS") != null }
doLast { System.out.println("Jar will be signed.") }
//copyBuildFile
copy {
from 'build/libs'
into '../build/libs'
include '**/*.jar'
exclude '**/*-sources.jar'
inputFile = jar.archivePath
outputFile = jar.archivePath
keyStore = 'CustomSkinLoader.jks'
alias = 'CustomSkinLoader'
storePass = System.getenv("KEY_PASS")
keyPass = System.getenv("KEY_PASS")
}
build.dependsOn signJar
task afterBuild {
doLast {
//copyBuildFile
copy {
from 'build/libs'
into '../build/libs'
include '**/*.jar'
exclude '**/*-sources.jar'
}
}
}}
}
build.finalizedBy afterBuild
+7
View File
@@ -0,0 +1,7 @@
minecraft_version=1.12.2
minecraft_full_versions=1.8,1.8.8,1.8.9,1.9,1.9.4,1.10,1.10.2,1.11,1.11.2,1.12,1.12.1,1.12.2,1.13.2
#forge gradle needs forge version
forge_mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=stable_39
srg_notch_map=Fabric.srg
+3
View File
@@ -0,0 +1,3 @@
{
"transformers": "transformers.js"
}
+18
View File
@@ -0,0 +1,18 @@
modLoader="javafml"
loaderVersion="[25,)"
[[mods]]
modId="customskinloader"
version="${modFullVersion}"
displayName="CustomSkinLoader"
description='''
Custom Skin Loader for Minecraft
'''
issueTrackerURL="https://github.com/xfl03/MCCustomSkinLoader/issues"
displayURL="https://github.com/xfl03/MCCustomSkinLoader"
authors=["xfl03", "JLChnToZ"]
[[dependencies.customskinloader]]
modId="forge"
mandatory=true
versionRange="[25,)"
ordering="NONE"
side="CLIENT"
+8 -9
View File
@@ -1,11 +1,10 @@
[
{
"modid": "customskinloader",
"name": "CustomSkinLoader",
"description": "Custom Skin Loader for Minecraft",
"version": "${modFullVersion}",
"url": "https://github.com/xfl03/MCCustomSkinLoader",
"authorList": ["xfl03"],
"credits": "GPLv3"
}
{
"modid": "customskinloader",
"name": "CustomSkinLoader",
"description": "Custom Skin Loader for Minecraft",
"version": "${modFullVersion}",
"url": "https://github.com/xfl03/MCCustomSkinLoader",
"authorList": ["xfl03", "JLChnToZ"]
}
]
+6
View File
@@ -0,0 +1,6 @@
{
"pack": {
"description": "CustomSkinLoader resources",
"pack_format": 4
}
}
+202
View File
@@ -0,0 +1,202 @@
var AbstractInsnNode = Java.type('org.objectweb.asm.tree.AbstractInsnNode');
var FieldInsnNode = Java.type('org.objectweb.asm.tree.FieldInsnNode');
var FieldNode = Java.type('org.objectweb.asm.tree.FieldNode');
var InsnNode = Java.type('org.objectweb.asm.tree.InsnNode');
var MethodInsnNode = Java.type('org.objectweb.asm.tree.MethodInsnNode');
var MethodNode = Java.type('org.objectweb.asm.tree.MethodNode');
var TypeInsnNode = Java.type('org.objectweb.asm.tree.TypeInsnNode');
var VarInsnNode = Java.type('org.objectweb.asm.tree.VarInsnNode');
var Opcodes = Java.type('org.objectweb.asm.Opcodes');
function SkinManagerTransformer() {
return {
'InitTransformer': function (cn, mn) {
cn.fields.add(new FieldNode(Opcodes.ACC_PRIVATE, "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;", null, null));
mn.instructions.clear();
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new TypeInsnNode(Opcodes.NEW, "customskinloader/fake/FakeSkinManager"));
mn.instructions.add(new InsnNode(Opcodes.DUP));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 2));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 3));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, "customskinloader/fake/FakeSkinManager", "<init>",
"(Lnet/minecraft/client/renderer/texture/TextureManager;Ljava/io/File;Lcom/mojang/authlib/minecraft/MinecraftSessionService;)V", false));
mn.instructions.add(new FieldInsnNode(Opcodes.PUTFIELD, "net/minecraft/client/resources/SkinManager", "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;"));
mn.instructions.add(new InsnNode(Opcodes.RETURN));
},
'LoadSkinTransformer': function (cn, mn) {
mn.instructions.clear();
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "net/minecraft/client/resources/SkinManager", "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;"));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 2));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 3));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "customskinloader/fake/FakeSkinManager", "loadSkin",
"(Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation;", false));
mn.instructions.add(new InsnNode(Opcodes.ARETURN));
},
'LoadProfileTexturesTransformer': function (cn, mn) {
mn.instructions.clear();
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "net/minecraft/client/resources/SkinManager", "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;"));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 2));
mn.instructions.add(new VarInsnNode(Opcodes.ILOAD, 3));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "customskinloader/fake/FakeSkinManager", "loadProfileTextures",
"(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V", false));
mn.instructions.add(new InsnNode(Opcodes.RETURN));
},
'LoadSkinFromCacheTransformer': function (cn, mn) {
mn.instructions.clear();
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
mn.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "net/minecraft/client/resources/SkinManager", "fakeManager", "Lcustomskinloader/fake/FakeSkinManager;"));
mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
mn.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "customskinloader/fake/FakeSkinManager", "loadSkinFromCache",
"(Lcom/mojang/authlib/GameProfile;)Ljava/util/Map;", false));
mn.instructions.add(new InsnNode(Opcodes.ARETURN));
}
};
}
function PlayerTabTransformer(cn, mn) {
var iterator = mn.instructions.iterator();
while (iterator.hasNext()) {
var node = iterator.next();
if (node instanceof VarInsnNode) {
var varNode = node;
if (varNode.getOpcode() === Opcodes.ISTORE && varNode.var === 11) {
mn.instructions.set(varNode.getPrevious(), new InsnNode(Opcodes.ICONST_1));
}
}
}
}
var hasDownloadingTexture = false;
function FakeSkinManagerTransformer(cn, mn) {
var TARGET_CLASS = "net/minecraft/client/renderer/ThreadDownloadImageData";
var NEW_TARGET_CLASS = hasDownloadingTexture ? "net/minecraft/client/renderer/texture/DownloadingTexture" : "net/minecraft/client/renderer/texture/ThreadDownloadImageData";
var CALLBACK_CLASS = "net/minecraft/client/resources/SkinManager$SkinAvailableCallback";
var il = mn.instructions;
var li = il.iterator();
while (li.hasNext()) {
var ain = li.next();
if (ain instanceof MethodInsnNode) {
var min = ain;
if (min.owner.equals(TARGET_CLASS)) {
min.owner = NEW_TARGET_CLASS;
//il.set(min, new MethodInsnNode(min.getOpcode(), NEW_TARGET_CLASS, min.name, min.desc, false));
}
if (min.owner.equals(CALLBACK_CLASS) && min.name.equals("func_180521_a")) {
min.name = "onSkinTextureAvailable";
//il.set(min, new MethodInsnNode(min.getOpcode(), min.owner, "onSkinTextureAvailable", min.desc, false));
}
} else if (ain instanceof TypeInsnNode) {
var tin = ain;
if (tin.desc.equals(TARGET_CLASS)) {
tin.desc = NEW_TARGET_CLASS;
}
}
}
}
function initializeCoreMod() {
return {
'SkinManagerTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/resources/SkinManager'
},
'transformer': function (cn) {
cn.methods.forEach(function (mn) {
if (mn.name === '<init>')
SkinManagerTransformer()['InitTransformer'](cn, mn);
else if(mn.name === 'func_152789_a')
SkinManagerTransformer()['LoadSkinTransformer'](cn, mn);
else if(mn.name === 'func_152790_a')
SkinManagerTransformer()['LoadProfileTexturesTransformer'](cn, mn);
else if(mn.name === 'func_152788_a')
SkinManagerTransformer()['LoadSkinFromCacheTransformer'](cn, mn);
});
return cn;
}
},
'PlayerTabTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/gui/GuiPlayerTabOverlay'
},
'transformer': function (cn) {
cn.methods.forEach(function (mn) {
if (mn.name === 'func_175249_a')
PlayerTabTransformer(cn, mn);
});
return cn;
}
},
'FakeSkinManagerTransformer': {
'target': {
'type': 'CLASS',
'name': 'customskinloader/fake/FakeSkinManager'
},
'transformer': function (cn) {
cn.methods.forEach(function (mn) {
//if (mn.name === '<init>')
FakeSkinManagerTransformer(cn, mn);
});
return cn;
}
},
// For 1.14+
'MinecraftTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/Minecraft'
},
'transformer': function (cn) {
if (!cn.methods.stream().anyMatch(function(mn) {
return mn.name.equals("func_152344_a");
})) {
var methodNode = new MethodNode(Opcodes.ACC_PUBLIC, "func_152344_a", "(Ljava/lang/Runnable;)Lcom/google/common/util/concurrent/ListenableFuture;", "(Ljava/lang/Runnable;)Lcom/google/common/util/concurrent/ListenableFuture<Ljava/lang/Object;>;", null);
methodNode.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
methodNode.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1));
methodNode.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "net/minecraft/util/concurrent/ThreadTaskExecutor", "execute", "(Ljava/lang/Runnable;)V", false));
methodNode.instructions.add(new InsnNode(Opcodes.ACONST_NULL));
methodNode.instructions.add(new InsnNode(Opcodes.ARETURN));
cn.methods.add(methodNode);
}
return cn;
}
},
'DownloadingTextureTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/renderer/texture/DownloadingTexture'
},
'transformer': function (cn) {
hasDownloadingTexture = true;
return cn;
}
},
'SkinAvailableCallbackTransformer': {
'target': {
'type': 'CLASS',
'name': 'net/minecraft/client/resources/SkinManager$SkinAvailableCallback'
},
'transformer': function (cn) {
cn.methods.forEach(function (mn) {
if (mn.name.equals("func_180521_a")) {
mn.name = "onSkinTextureAvailable";
}
});
return cn;
}
}
};
}
@@ -1,12 +1,40 @@
package customskinloader.forge;
import net.minecraftforge.fml.common.Mod;
import customskinloader.CustomSkinLoader;
@Mod(modid = "customskinloader",
name = "CustomSkinLoader",
version = "@MOD_FULL_VERSION@",
clientSideOnly=true,
acceptedMinecraftVersions="[1.8,)")
public class ForgeMod{
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent;
/**
* Forge Mod Container
*/
@Mod(
value = "customskinloader",
modid = "customskinloader",
name = "CustomSkinLoader",
version = "@MOD_FULL_VERSION@",
clientSideOnly = true,
acceptedMinecraftVersions = "[1.8,)",
certificateFingerprint = "52885f395e68f42e9b3b629ba56ecf606f7d4269"
)//1.13-
public class ForgeMod {
@EventHandler
public void fingerprintError(FMLFingerprintViolationEvent event) {
if (event.isDirectory()) return;//Development Environment
CustomSkinLoader.logger.warning("!!!Fingerprint ERROR!!!");
CustomSkinLoader.logger.warning("Failed to check fingerprint in file '" + event.getSource().getAbsolutePath() + "'.");
CustomSkinLoader.logger.warning("Excepted Fingerprint: " + event.getExpectedFingerprint());
if (event.getFingerprints().isEmpty()) {
CustomSkinLoader.logger.warning("No Fingerprint Founded.");
} else {
CustomSkinLoader.logger.warning("Founded Fingerprint: ");
for (String s : event.getFingerprints())
CustomSkinLoader.logger.warning(s);
}
throw new RuntimeException("Fingerprint ERROR, please **DO NOT MODIFY** any mod.");
}
}
@@ -3,12 +3,14 @@ package customskinloader.forge;
import java.util.Map;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.Name;
@Name("CustomSkinLoader")
public class ForgePlugin implements IFMLLoadingPlugin {
@Override
public String[] getASMTransformerClass() {
return new String[] {TransformerManager.class.getName()};
return new String[]{"customskinloader.forge.loader.LaunchWrapper"};//LaunchWrapper
}
@Override
@@ -1,48 +0,0 @@
package customskinloader.forge;
import java.util.ListIterator;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import customskinloader.forge.TransformerManager.IMethodTransformer;
import customskinloader.forge.TransformerManager.TransformTarget;
public class SpectatorMenuTransformer {
@TransformTarget(className="net.minecraft.client.gui.spectator.PlayerMenuObject",
methodNames={"<init>"},
desc="(Lcom/mojang/authlib/GameProfile;)V")
public static class PlayerMenuObjectTransformer implements IMethodTransformer{
@Override
public void transform(ClassNode cn, MethodNode mn) {
InsnList il=mn.instructions;
ListIterator<AbstractInsnNode> li=il.iterator();
boolean flag=false;
while(li.hasNext()) {
AbstractInsnNode ain=li.next();
if(ain.getOpcode()!=Opcodes.INVOKESTATIC)
continue;
//MethodInsnNode min=(MethodInsnNode)nn;
//min.owner="customskinloader/fake/FakeClientPlayer";
if(!flag) {
//First InvokeStatic
il.set(ain, new MethodInsnNode(Opcodes.INVOKESTATIC,"customskinloader/fake/FakeClientPlayer","getLocationSkin",
"(Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation;",false));
flag=true;
}else {
//Second InvokeStatic
il.set(ain, new MethodInsnNode(Opcodes.INVOKESTATIC,"customskinloader/fake/FakeClientPlayer","getDownloadImageSkin",
"(Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData;",false));
break;
}
}
}
}
}
@@ -1,97 +1,69 @@
package customskinloader.forge;
import java.io.File;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import net.minecraftforge.fml.relauncher.FMLRelaunchLog;
import customskinloader.forge.PlayerTabTransformer.ScoreObjectiveTransformer;
import customskinloader.forge.SkinManagerTransformer.*;
import customskinloader.forge.SpectatorMenuTransformer.PlayerMenuObjectTransformer;
import customskinloader.Logger;
public class TransformerManager {
public static Logger logger = new Logger(new File("./CustomSkinLoader/ForgePlugin.log"));
public class TransformerManager implements IClassTransformer {
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface TransformTarget{
public String className();
public String[] methodNames();
public String desc();
public @interface TransformTarget {
String className();
String[] methodNames();
String desc();
}
public interface IMethodTransformer{
public void transform(ClassNode cn,MethodNode mn);
public interface IMethodTransformer {
void transform(ClassNode cn, MethodNode mn);
}
private static final IMethodTransformer[] TRANFORMERS={
new InitTransformer(),
new LoadSkinTransformer(),
new LoadProfileTexturesTransformer(),
new LoadSkinFromCacheTransformer(),
new ScoreObjectiveTransformer(),
new PlayerMenuObjectTransformer()};
private Map<String, Map<String, IMethodTransformer>> map;
public TransformerManager(){
public Map<String, Map<String, IMethodTransformer>> map;
public TransformerManager(IMethodTransformer... transformers) {
map = new HashMap<String, Map<String, IMethodTransformer>>();
for(IMethodTransformer t:TRANFORMERS){
FMLRelaunchLog.info("[CSL DEBUG] REGISTERING TRANSFORMER %s",t.getClass().getName());
if(!t.getClass().isAnnotationPresent(TransformTarget.class)){
FMLRelaunchLog.info("[CSL DEBUG] ERROR occurs while parsing Annotation.");
for (IMethodTransformer t : transformers) {
logger.info("[CSL DEBUG] REGISTERING TRANSFORMER %s", t.getClass().getName());
if (!t.getClass().isAnnotationPresent(TransformTarget.class)) {
logger.info("[CSL DEBUG] ERROR occurs while parsing Annotation.");
continue;
}
addMethodTransformer(t.getClass().getAnnotation(TransformTarget.class),t);
addMethodTransformer(t.getClass().getAnnotation(TransformTarget.class), t);
}
}
private void addMethodTransformer(TransformTarget target, IMethodTransformer transformer) {
if (!map.containsKey(target.className()))
map.put(target.className(), new HashMap<String, IMethodTransformer>());
for(String methodName:target.methodNames()){
for (String methodName : target.methodNames()) {
map.get(target.className()).put(methodName + target.desc(), transformer);
FMLRelaunchLog.info("[CSL DEBUG] REGISTERING METHOD %s(%s)",target.className(),methodName + target.desc());
logger.info("[CSL DEBUG] REGISTERING METHOD %s(%s)", target.className(), methodName + target.desc());
}
}
//From: https://github.com/RecursiveG/UniSkinMod/blob/1.9.4/src/main/java/org/devinprogress/uniskinmod/coremod/BaseAsmTransformer.java#L83-L114
@Override
public byte[] transform(String obfClassName, String className, byte[] bytes) {
if (!map.containsKey(className)) return bytes;
FMLRelaunchLog.info("[CSL DEBUG] CLASS %s will be transformed", className);
Map<String, IMethodTransformer> transMap = map.get(className);
ClassReader cr = new ClassReader(bytes);
ClassNode cn = new ClassNode();
cr.accept(cn, 0);
// NOTE: `map` = convert obfuscated name to srgName;
List<MethodNode> ml = new ArrayList<MethodNode>();
ml.addAll(cn.methods);
for (MethodNode mn : ml) {
String methodName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodName(obfClassName, mn.name, mn.desc);
String methodDesc = FMLDeobfuscatingRemapper.INSTANCE.mapMethodDesc(mn.desc);
if (transMap.containsKey(methodName + methodDesc)) {
try {
FMLRelaunchLog.info("[CSL DEBUG] Transforming method %s in class %s(%s)", methodName + methodDesc, obfClassName, className);
transMap.get(methodName + methodDesc).transform(cn,mn);
FMLRelaunchLog.info("[CSL DEBUG] Successfully transformed method %s in class %s(%s)", methodName + methodDesc, obfClassName, className);
} catch (Exception e) {
FMLRelaunchLog.warning("[CSL DEBUG] An error happened when transforming method %s in class %s(%s). The whole class was not modified.", methodName + methodDesc, obfClassName, className);
e.printStackTrace();
return bytes;
}
public MethodNode transform(ClassNode classNode, MethodNode methodNode, String className, String methodName, String methodDesc) {
Map<String, IMethodTransformer> transMap = map.get(className);
String methodTarget = methodName + methodDesc;
if (transMap.containsKey(methodTarget)) {
try {
transMap.get(methodTarget).transform(classNode, methodNode);
logger.info("[CSL DEBUG] Successfully transformed method %s in class %s", methodName, className);
} catch (Exception e) {
logger.warning("[CSL DEBUG] An error happened when transforming method %s in class %s.", methodTarget, className);
logger.warning(e);
}
}
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
cn.accept(cw);
return cw.toByteArray();
return methodNode;
}
}
@@ -0,0 +1,49 @@
package customskinloader.forge.loader;
import customskinloader.forge.TransformerManager;
import customskinloader.forge.transformer.PlayerTabTransformer;
import customskinloader.forge.transformer.SkinManagerTransformer;
import customskinloader.forge.transformer.SpectatorMenuTransformer;
import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
//LaunchWrapper for 1.13-
public class LaunchWrapper implements IClassTransformer {
private static final TransformerManager.IMethodTransformer[] TRANFORMERS = {
new SkinManagerTransformer.InitTransformer(),
new SkinManagerTransformer.LoadSkinTransformer(),
new SkinManagerTransformer.LoadProfileTexturesTransformer(),
new SkinManagerTransformer.LoadSkinFromCacheTransformer(),
new PlayerTabTransformer.ScoreObjectiveTransformer(),
new SpectatorMenuTransformer.PlayerMenuObjectTransformer()
};
private TransformerManager transformerManager = new TransformerManager(TRANFORMERS);
//From: https://github.com/RecursiveG/UniSkinMod/blob/1.9.4/src/main/java/org/devinprogress/uniskinmod/coremod/BaseAsmTransformer.java#L83-L114
public byte[] transform(String obfClassName, String className, byte[] bytes) {
if (!transformerManager.map.containsKey(className)) return bytes;//Check if should be transformed
//Parse bytes to ClassNode
ClassReader cr = new ClassReader(bytes);
ClassNode cn = new ClassNode();
cr.accept(cn, 0);
//Transform ClassNode
for (MethodNode mn : cn.methods) {
String methodName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodName(obfClassName, mn.name, mn.desc);
String methodDesc = FMLDeobfuscatingRemapper.INSTANCE.mapMethodDesc(mn.desc);
transformerManager.transform(cn, mn, className, methodName, methodDesc);
}
//Parse Class Node to bytes
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
cn.accept(cw);
return cw.toByteArray();
}
}
@@ -0,0 +1,49 @@
package customskinloader.forge.loader;
import customskinloader.forge.TransformerManager;
import customskinloader.forge.transformer.FakeSkinManagerTransformer;
import customskinloader.forge.transformer.PlayerTabTransformer;
import customskinloader.forge.transformer.SkinManagerTransformer;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
/**
* ModLauncher for 1.13+
* @deprecated Use JavaScript Instead
*/
@Deprecated
public class ModLauncher {
private static final TransformerManager.IMethodTransformer[] TRANFORMERS = {
new SkinManagerTransformer.InitTransformer(),
new SkinManagerTransformer.LoadSkinTransformer(),
new SkinManagerTransformer.LoadProfileTexturesTransformer(),
new SkinManagerTransformer.LoadSkinFromCacheTransformer(),
new PlayerTabTransformer.ScoreObjectiveTransformer(),
new FakeSkinManagerTransformer.InitTransformer()
};
private TransformerManager transformerManager = new TransformerManager(TRANFORMERS);
public ClassNode transform(ClassNode input) {
for (MethodNode mn : input.methods) {
transformerManager.transform(input, mn, input.name, mn.name, mn.desc);
}
return input;
}
//Singleton
private volatile static ModLauncher INSTANCE = null;
public static ModLauncher instance() {
if (INSTANCE == null) {
synchronized (ModLauncher.class) {
if (INSTANCE == null) {
INSTANCE = new ModLauncher();
}
}
}
return INSTANCE;
}
}
@@ -0,0 +1,57 @@
package customskinloader.forge.transformer;
import customskinloader.forge.TransformerManager;
import customskinloader.forge.TransformerManager.IMethodTransformer;
import customskinloader.forge.TransformerManager.TransformTarget;
import org.objectweb.asm.tree.*;
import java.util.ListIterator;
/**
* Transformer of FakeSkinManager for 1.13+
* @deprecated Use JavaScript Instead
*/
@Deprecated
public class FakeSkinManagerTransformer {
private final static String TARGET_CLASS = "net/minecraft/client/renderer/ThreadDownloadImageData";
private final static String NEW_TARGET_CLASS = "net/minecraft/client/renderer/texture/ThreadDownloadImageData";
private final static String CALLBACK_CLASS = "net/minecraft/client/resources/SkinManager$SkinAvailableCallback";
@TransformTarget(className = "customskinloader.fake.FakeSkinManager",
methodNames = {"<init>"},
desc = "(Lnet/minecraft/client/renderer/texture/TextureManager;Ljava/io/File;Lcom/mojang/authlib/minecraft/MinecraftSessionService;)V")
public static class InitTransformer implements IMethodTransformer {
@Override
public void transform(ClassNode cn, MethodNode mn) {
TransformerManager.logger.info("1.13 detected, FakeSkinManager will be transformed.");
//ClassNameRemapper.remapClassName(cn, TARGET_CLASS, NEW_TARGET_CLASS);
//MethodNameRemapper.remapMethodName(cn, CALLBACK_CLASS, "func_180521_a", "onSkinTextureAvailable");
InsnList il = mn.instructions;
ListIterator<AbstractInsnNode> li = il.iterator();
while (li.hasNext()) {
AbstractInsnNode ain = li.next();
if (ain instanceof MethodInsnNode) {
MethodInsnNode min = (MethodInsnNode) ain;
if (min.owner.equals(TARGET_CLASS)) {
min.owner = NEW_TARGET_CLASS;
//il.set(min, new MethodInsnNode(min.getOpcode(), NEW_TARGET_CLASS, min.name, min.desc, false));
}
if (min.owner.equals(CALLBACK_CLASS) && min.name.equals("func_180521_a")) {
min.name = "onSkinTextureAvailable";
//il.set(min, new MethodInsnNode(min.getOpcode(), min.owner, "onSkinTextureAvailable", min.desc, false));
}
} else if (ain instanceof TypeInsnNode) {
TypeInsnNode tin = (TypeInsnNode) ain;
if (tin.desc.equals(TARGET_CLASS)) {
tin.desc = NEW_TARGET_CLASS;
}
}
}
}
}
}
@@ -1,4 +1,4 @@
package customskinloader.forge;
package customskinloader.forge.transformer;
import java.util.ListIterator;
@@ -13,23 +13,22 @@ import customskinloader.forge.TransformerManager.IMethodTransformer;
import customskinloader.forge.TransformerManager.TransformTarget;
public class PlayerTabTransformer {
@TransformTarget(className="net.minecraft.client.gui.GuiPlayerTabOverlay",
methodNames={"func_175249_a","renderPlayerlist"},
desc="(ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V")
public static class ScoreObjectiveTransformer implements IMethodTransformer{
@TransformTarget(className = "net.minecraft.client.gui.GuiPlayerTabOverlay",
methodNames = {"func_175249_a", "renderPlayerlist"},
desc = "(ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreObjective;)V")
public static class ScoreObjectiveTransformer implements IMethodTransformer {
//From: http://git.oschina.net/AsteriskTeam/TabIconHackForge/blob/master/src/main/java/kengxxiao/tabiconhack/coremod/TabIconHackForgeClassTransformer.java#L30-L43
@Override
public void transform(ClassNode cn, MethodNode mn) {
ListIterator<AbstractInsnNode> iterator = mn.instructions.iterator();
while (iterator.hasNext())
{
AbstractInsnNode node = iterator.next();
if (node instanceof VarInsnNode)
{
VarInsnNode varNode = (VarInsnNode) node;
if (varNode.getOpcode() == Opcodes.ISTORE && varNode.var == 11)
mn.instructions.set(varNode.getPrevious(), new InsnNode(Opcodes.ICONST_1));
}
while (iterator.hasNext()) {
AbstractInsnNode node = iterator.next();
if (node instanceof VarInsnNode) {
VarInsnNode varNode = (VarInsnNode) node;
if (varNode.getOpcode() == Opcodes.ISTORE && varNode.var == 11) {
mn.instructions.set(varNode.getPrevious(), new InsnNode(Opcodes.ICONST_1));
}
}
}
}
}
@@ -1,4 +1,4 @@
package customskinloader.forge;
package customskinloader.forge.transformer;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
@@ -0,0 +1,56 @@
package customskinloader.forge.transformer;
import java.util.ListIterator;
import customskinloader.forge.TransformerManager;
import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import customskinloader.forge.TransformerManager.IMethodTransformer;
import customskinloader.forge.TransformerManager.TransformTarget;
/**
* Transformer of Spectator Menu for 1.13-
*/
public class SpectatorMenuTransformer {
@TransformTarget(className = "net.minecraft.client.gui.spectator.PlayerMenuObject",
methodNames = {"<init>"},
desc = "(Lcom/mojang/authlib/GameProfile;)V")
public static class PlayerMenuObjectTransformer implements IMethodTransformer {
@Override
public void transform(ClassNode cn, MethodNode mn) {
InsnList il = mn.instructions;
ListIterator<AbstractInsnNode> li = il.iterator();
boolean flag = false;
while (li.hasNext()) {
AbstractInsnNode ain = li.next();
if (ain.getOpcode() != Opcodes.INVOKESTATIC)
continue;
if (!flag) {
//First InvokeStatic
il.set(ain, new MethodInsnNode(Opcodes.INVOKESTATIC,
"customskinloader/fake/FakeClientPlayer",
"getLocationSkin",
"(Ljava/lang/String;)Lnet/minecraft/util/ResourceLocation;", false));
flag = true;
} else {
//Second InvokeStatic
il.set(ain, new MethodInsnNode(Opcodes.INVOKESTATIC,
"customskinloader/fake/FakeClientPlayer",
"getDownloadImageSkin",
"(Lnet/minecraft/util/ResourceLocation;Ljava/lang/String;)Lnet/minecraft/client/renderer/ThreadDownloadImageData;", false));
break;
}
}
}
}
}
@@ -0,0 +1,60 @@
package net.minecraft.client.resources;
import java.io.File;
import java.util.Map;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.versions.mcp.MCPVersion;
public class SkinManager {
static {
if (!MCPVersion.getMCVersion().startsWith("1.13")) {
try {
// Make sure that DownloadingTexture is initialized earlier than FakeSkinManager.
Class.forName("net.minecraft.client.renderer.texture.DownloadingTexture");
} catch (ClassNotFoundException e) {}
}
}
public SkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService) {
throw new RuntimeException("This method must be transformed!");
}
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, MinecraftProfileTexture.Type textureType) {
return this.loadSkin(profileTexture, textureType, null);
}
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, MinecraftProfileTexture.Type textureType, SkinManager.SkinAvailableCallback skinAvailableCallback) {
throw new RuntimeException("This method must be transformed!");
}
// For 1.14+
public ResourceLocation func_152789_a(MinecraftProfileTexture profileTexture, MinecraftProfileTexture.Type textureType, SkinManager.ISkinAvailableCallback skinAvailableCallback) {
return this.loadSkin(profileTexture, textureType, skinAvailableCallback);
}
public void loadProfileTextures(GameProfile profile, SkinManager.SkinAvailableCallback skinAvailableCallback, boolean requireSecure) {
throw new RuntimeException("This method must be transformed!");
}
// For 1.14+
public void func_152790_a(GameProfile profile, SkinManager.ISkinAvailableCallback skinAvailableCallback, boolean requireSecure) {
this.loadProfileTextures(profile, skinAvailableCallback, requireSecure);
}
public Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile) {
throw new RuntimeException("This method must be transformed!");
}
public interface SkinAvailableCallback {
void skinAvailable(MinecraftProfileTexture.Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture);
}
public interface ISkinAvailableCallback extends SkinAvailableCallback {
void onSkinTextureAvailable(MinecraftProfileTexture.Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture);
}
}
@@ -0,0 +1,32 @@
package net.minecraftforge.fml.common;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
//https://github.com/MinecraftForge/MinecraftForge/blob/1.13.x/src/main/java/net/minecraftforge/fml/common/Mod.java
//https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/src/main/java/net/minecraftforge/fml/common/Mod.java
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Mod {
String value();
String modid();
String name() default "";
String version() default "";
boolean clientSideOnly() default false;
String acceptedMinecraftVersions() default "";
String certificateFingerprint() default "";
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface EventHandler {
}
}
@@ -0,0 +1,7 @@
package net.minecraftforge.versions.mcp;
public class MCPVersion {
public static String getMCVersion() {
return null;
}
}
+31 -24
View File
@@ -1,65 +1,70 @@
# CustomSkinLoader
## What's this?
Custom Skin Loader mod for Minecraft.
You can use it to load any skin from any website.
It's a mod which can load skins and capes from any online source or from your local.
## Download
Build Server : [CircleCI](https://circleci.com/gh/xfl03/MCCustomSkinLoader) & [~~Infinity Studio CI~~](https://ci.infstudio.net/job/CustomSkinLoader/)
Build Server : [CircleCI](https://circleci.com/gh/xfl03/MCCustomSkinLoader) & ~~[Infinity Studio CI](https://ci.infstudio.net/job/CustomSkinLoader/)~~
Release Page : [MCBBS](http://www.mcbbs.net/thread-269807-1-1.html) & [GitHub](https://github.com/xfl03/MCCustomSkinLoader/releases) & [CurseForge](https://minecraft.curseforge.com/projects/customskinloader)
## Feature
### Plenty of Skin Load API Support and Customizable Skin Load List
Skin Load API Supported:
### Support Plenty of Skin Load API and Customizable Skin Load List
Supported Skin Load APIs:
- [Mojang API](http://wiki.vg/Mojang_API)
- [CustomSkinAPI](https://github.com/xfl03/CustomSkinLoaderAPI/tree/master/CustomSkinAPI)
- CustomSkinAPIPlus (Test Only)
- [UniSkinAPI](https://github.com/RecursiveG/UniSkinServer/tree/master/doc)
- [ElyByAPI](http://docs.ely.by/api.html)
- Legacy
You can use this feature to customize your skin load list so as to load from any skin server you want.
If you are the owner of skin server, you can use CustomSkinLoader to load skin from your server if one of the api has been actualized.
You can use this feature to customize your skin load list so as to load your skins from any skin server you want.
If you are the owner of skin server, you can use CustomSkinLoader to load skins from your server if one of the APIs has been actualized by your server.
### HD Skins Support
Even though there is no Optifine or MCPatcher, CustomSkinLoader has fix this problem.
You can easily to get a better view in skin.
Even though you don't have OptiFine and MCPatcher, CustomSkinLoader can still load and render HD skins.
You can easily to get a better view of skins.
### Skull Support
Fixed skull load bug.
Fixed skull loading bug, you can apply any skin to your skull now.
Dynamic skull supported.
### Profile Cache
- Decrease frenquency of using network.
- Meanwhile,you can still load profile without network.
- Decrease the frenquency of using the network.
- Meanwhile, you can still load profiles when network is unavailable.(*)
*Should be open in configratulation file.
*Only when it is opened in configratulation.
### Local Skin
Load skin without skin server.
Furthermore, by using this function you can preview your skin in game and even change default skin and model.
You can load local skin by using any API(excluding MojangAPI).
*While using default configratulation, just put skin into `.minecraft/CustomSkinLoader/LocalSkin/(skin|cape)s/{USERNAME}.png`.
Load skins without a skin server.
Furthermore, by using this function you can preview your skins in game and even change the default skin and model.
You can load local skins by using any API (excluding MojangAPI).
*While using default configratulation, just put your skins into `.minecraft/CustomSkinLoader/LocalSkin/(skin|cape)s/{USERNAME}.png`.
### Extra List
A json file generated by supported skin server.
To add server to load list, users just need to put file into `.minecraft/CustomSkinLoader/ExtraList` .
A json file generated by skin servers which supports this feature.
To add a server to your load list, users just need to put the file into `.minecraft/CustomSkinLoader/ExtraList` .
### Transparent Skin Support
The problem of rendering incorrect texture has been fixed.
The problem of incorrectly rendering textures has been fixed.
### Spectator Menu Fixed
By using this mod, you can see correct avatar of players in Spectator Menu rather than steve and alex.
## Default Load List
- [Mojang](http://www.minecraft.net/) (Mojang API)
- [Little Skin](https://mcskin.littleservice.cn/) (CustomSkinAPI)
- [LittleSkin](https://littleskin.cn/) (CustomSkinAPI)
- [Blessing Skin](http://skin.prinzeugen.net/) (CustomSkinAPI)
- [ElyBy](http://docs.ely.by/) (ElyByAPI)
- SkinMe (UniSkinAPI)
- LocalSkin (Legacy)
If you want to apply to add other skin server to default list, please go to [issue](https://github.com/JLChnToZ/MCCustomSkinLoader/issues).
## To Skin Server Owner
CustomSkinLoader is designed for loading from any server, which makes it complex.
CustomSkinLoader is designed for loading from any server, which makes the mod complex.
It's not a good idea to refer to CustomSkinLoader's source code to develop your own skin mod.
It's recommended to use CustomSkinLoader for your server directly.
Furthermore, you can add your server to 'Default Load List'.
You also can use 'ExtraList' which makes it easier for user to adds your server into load list.
You can also use 'ExtraList' which makes it easier for users to add your server into load list.
## Copyright & LICENSE
### Binary File
@@ -70,9 +75,10 @@ You could not repost this mod to any website without permission.
You could not earn money with this mod excluding modpack.
### Source Code
#### Package 'customskinloader'
Including some code from
Including some codes from
- [AsteriskTeam/TabIconHackForge](http://git.oschina.net/AsteriskTeam/TabIconHackForge) (GPLv3)
- [RecursiveG/UniSkinMod](https://github.com/RecursiveG/UniSkinMod) (GPLv3)
- [NekoCaffeine/Alchemy](https://github.com/NekoCaffeine/Alchemy) (GPLv3)
Copyright(C) 2013-2018 JLChnToZ xfl03
@@ -81,4 +87,5 @@ Copyright(C) 2013-2018 JLChnToZ xfl03
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
GPLv3: http://www.gnu.org/licenses/gpl.html
You should change the name of package to avoid others' misunderstanding.
You should change the name of the package to avoid others' misunderstanding.
@@ -4,12 +4,12 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import customskinloader.utils.JavaUtil;
import org.apache.commons.io.IOUtils;
import customskinloader.utils.MinecraftUtil;
@@ -23,8 +23,7 @@ public class ClassTransformer implements IClassTransformer {
public ClassTransformer() {
ModSystemTweaker.logger.info("ClassTransformer Begin");
try {
URLClassLoader ucl = (URLClassLoader)this.getClass().getClassLoader();
URL urls[] = ucl.getURLs();
URL urls[] = JavaUtil.getClasspath();
for (URL url : urls) {
if(MinecraftUtil.isCoreFile(url)){
ModSystemTweaker.logger.debug(url.toString()+" : SKIP (core file).");
@@ -35,7 +34,7 @@ public class ClassTransformer implements IClassTransformer {
continue;
}
File file = new File(url.toURI());
if(file==null||!file.isFile()){
if(!file.isFile()){
ModSystemTweaker.logger.info(url.toString()+" : EXCEPTION (file not found).");
continue;
}
@@ -75,7 +74,7 @@ public class ClassTransformer implements IClassTransformer {
private static ZipFile getZipFile(File file)
{
ZipFile zipFile0=null;
ZipFile zipFile0;
try {
zipFile0 = new ZipFile(file);
return zipFile0;
@@ -89,11 +88,11 @@ public class ClassTransformer implements IClassTransformer {
if (zipFile == null)
return bytes;
String fullName = new StringBuilder().append(name.startsWith("net") ? name.replaceAll("\\.", "\\/") : name).append(".class").toString();//Notch(Run)/MCP(Dev) Class Name
String fullName = (name.startsWith("net") ? name.replace('.', '/') : name) + ".class";//Notch(Run)/MCP(Dev) Class Name
if(!classes.contains(fullName)){//Check Name
if(name.equals(transformedName))
return bytes;
fullName = new StringBuilder().append(transformedName.replaceAll("\\.", "\\/")).append(".class").toString();//MCP Class Name
fullName = transformedName.replace('.', '/') + ".class";//MCP Class Name
if(!classes.contains(fullName))//check Again
return bytes;
}
@@ -13,7 +13,7 @@ public class ModSystemTweaker implements ITweaker {
public static Logger logger = new Logger();
public void acceptOptions(List args, File gameDir, File assetsDir, String profile) {
File tweakerLogFile = new File(gameDir,"CustomSkinLoader/Tweaker.log");
File tweakerLogFile = new File(gameDir,"./CustomSkinLoader/Tweaker.log");
logger = new Logger(tweakerLogFile);
logger.info("Using ModSystemTweaker");
@@ -17,7 +17,7 @@ public class Tweaker implements ITweaker {
public static Logger logger = new Logger();
public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) {
File tweakerLogFile = new File(gameDir,"CustomSkinLoader/Tweaker.log");
File tweakerLogFile = new File(gameDir,"./CustomSkinLoader/Tweaker.log");
logger = new Logger(tweakerLogFile);
logger.info("Using Tweaker");
+15 -10
View File
@@ -2,35 +2,40 @@ apply plugin: 'base'
ext.configFile = file "build.properties"
configFile.withReader {
// read config. it shall from now on be referenced as simply config or as project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
buildscript {
repositories {
/*
maven {
name = "fmm"
url = "http://forgemavenmirror.sinaapp.com/maven"
}
*/
mavenCentral()
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
name = "sponge"
url = "https://repo.spongepowered.org/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
}
subprojects {
if(!project.name.toLowerCase().contains("forge"))
if (!project.name.toLowerCase().contains("forge") && !project.name.toLowerCase().contains("fabric"))
apply from: rootProject.file('common.gradle')
}
apply from: rootProject.file('BuildScripts/cos.gradle')
apply from: rootProject.file('BuildScripts/version.gradle')
task upload {
onlyIf { System.getenv("COS_SECRET_KEY") != null }
doLast {
uploadArtifacts(getShortVersion())
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
name=CustomSkinLoader
group=customskinloader
version=14.8
version=14.11
dev_version=
#RELEASE: snapshot=0
snapshot=0
snapshot=0
+72 -101
View File
@@ -1,20 +1,11 @@
buildscript {
repositories {
/*
maven {
name = "fmm"
url = "http://forgemavenmirror.sinaapp.com/maven"
}
*/
mavenCentral()
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
@@ -24,21 +15,27 @@ apply plugin: 'net.minecraftforge.gradle.forge'
ext.configFile = file "build.properties"
configFile.withReader {
// read config. it shall from now on be referenced as simply config or as project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
//Example: 14.4a-SNAPSHOT-20160820
version = rootProject.ext.config.version + rootProject.ext.config.dev_version + ((rootProject.ext.config.snapshot==""||rootProject.ext.config.snapshot=="0"||rootProject.ext.config.snapshot==0)?'':('-SNAPSHOT-'+System.getenv("CIRCLE_BUILD_NUM")))
apply from: rootProject.file("BuildScripts/version.gradle")
version = getCSLVersion()
group = config.group
archivesBaseName = rootProject.ext.config.name+"_"+config.minecraft_version
archivesBaseName = rootProject.ext.config.name + "_" + config.minecraft_version
ext.shortVersion = getShortVersion()
sourceCompatibility = targetCompatibility = 1.6
compileJava {
sourceCompatibility = targetCompatibility = 1.6
}
minecraft {
version = config.forge_mc_version+"-"+config.forge_version
version = config.forge_mc_version + "-" + config.forge_version
runDir = "run"
mappings = config.mappings_version
replace '@MOD_VERSION@', rootProject.ext.config.version
replace '@MOD_FULL_VERSION@', project.version
replaceIn 'CustomSkinLoader.java'
@@ -46,99 +43,73 @@ minecraft {
jar {
manifest {
attributes 'TweakClass' : 'customskinloader.tweaker.ModSystemTweaker'
attributes 'TweakName' : rootProject.ext.config.name
attributes 'TweakAuthor' : 'xfl03,JLChnToZ'
attributes 'TweakVersion' : version
attributes 'TweakOrder' : '-10'
attributes 'TweakClass' : 'customskinloader.tweaker.ModSystemTweaker'
attributes 'TweakName' : rootProject.ext.config.name
attributes 'TweakAuthor' : 'xfl03,JLChnToZ'
attributes 'TweakVersion': version
attributes 'TweakOrder' : '-10'
}
exclude 'net/minecraft/client/renderer/texture/NativeImage.class'
exclude 'net/minecraft/client/Minecraft.class'
}
task copySource << {
def outputFile = file("src/main/java")
outputFile.deleteDir()
copy {
from '../Common/source'
from 'src/minecraft/'
into 'src/main/java'
sourceSets {
main {
java {
//Common
srcDir '../Common/source'
//Vanilla
srcDir '../Vanilla'
//Special
srcDir 'source'
}
resources {
//Common
srcDir '../Common/resource'
}
}
}
sourceMainJava.dependsOn copySource
processResources {
expand ([
modVersion:rootProject.ext.config.version,
modFullVersion:project.version,
mcVersion:config.minecraft_version,
mcFullVersions:config.minecraft_full_versions,
forgeVersion:config.forge_version,
//gitVersion:System.getenv("GIT_COMMIT"),
//buildUrl:System.getenv("BUILD_URL")
gitVersion:System.getenv("CIRCLE_SHA1"),
buildUrl:System.getenv("CIRCLE_BUILD_URL")
expand([
modVersion : rootProject.ext.config.version,
modFullVersion : project.version,
modShortFullVersion: shortVersion,
mcVersion : config.minecraft_version,
mcFullVersions : config.minecraft_full_versions,
forgeVersion : config.forge_version,
gitVersion : System.getenv("CIRCLE_SHA1"),
buildUrl : System.getenv("CIRCLE_BUILD_URL")
])
}
task copyResources << {
def outputFile = file("src/main/resources")
outputFile.deleteDir()
copy {
from '../Common/resource'
into 'src/main/resources'
apply from: rootProject.file("BuildScripts/remap.gradle")
task afterBuild {
doLast {
//renameSrgJar
def file0 = file("build/libs/${archivesBaseName}-${version}.jar")
def file1 = file("build/libs/${archivesBaseName}-${version}-srg.jar")
file0.renameTo(file1)
//reobfSrgToNotch
reobfSrgToNotch()
//copyBuildFile
copy {
from 'build/libs'
into '../build/libs'
include '**/*.jar'
exclude '**/*-srg.jar'
exclude '**/*-dev.jar'
exclude '**/*-sources.jar'
}
//copyProfileJson
File f = project.file("build/resources/main/Profile.json")
String of = String.format("build/libs/%s-CSL-%s.json", config.minecraft_version, shortVersion)
File off = rootProject.file(of)
off.parentFile.mkdirs()
f.renameTo(off)
}
}
processResources.dependsOn copyResources
task afterBuild << {
//renameSrgJar
def file0 = file("build/libs/${archivesBaseName}-${version}.jar")
def file1 = file("build/libs/${archivesBaseName}-${version}-srg.jar")
file0.renameTo(file1)
//reobfSrgToNotch
reobfSrgToNotch()
//copyBuildFile
copy {
from 'build/libs'
into '../build/libs'
include '**/*.jar'
exclude '**/*-srg.jar'
exclude '**/*-dev.jar'
exclude '**/*-sources.jar'
}
}
build.finalizedBy afterBuild
//notch pack
void reobfSrgToNotch(){
def srgName = "${archivesBaseName}-${version}-srg.jar"
def notchName = srgName.replace('-srg', '')
if(config.srg_notch_map==null||!(config.srg_notch_map instanceof String)||config.srg_notch_map==""){
//Default Map
def mcpName = srgName.replace('-srg', '-dev')
applySpecialSource(srgName,mcpName,getDefaultMap("srg-mcp"))
applySpecialSource(mcpName,notchName,getDefaultMap("mcp-notch"))
}else{
//Custom Map
applySpecialSource(srgName,notchName,config.srg_notch_map)
}
}
void applySpecialSource(String inputName,String outputName,String mapFile){
def mapping = new net.md_5.specialsource.JarMapping()
def srgFile = file(mapFile)
def inputFile = file("build/libs/${inputName}")
def outputFile = file("build/libs/${outputName}")
def remapper = new net.md_5.specialsource.JarRemapper(null, mapping)
def inputJar = net.md_5.specialsource.Jar.init(inputFile)
def inheritanceProviders = new net.md_5.specialsource.provider.JointProvider()
def jarProvider = new net.md_5.specialsource.provider.JarProvider(inputJar)
inheritanceProviders.add(jarProvider)
mapping.loadMappings(srgFile)
mapping.setFallbackInheritanceProvider(inheritanceProviders)
remapper.remapJar(inputJar, outputFile)
}
String getDefaultMap(String srgType){
def mcpVersion = minecraft.mappings.replace('_',"/")
return System.getProperty('user.home') + "/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_${mcpVersion}/${config.forge_mc_version}/srgs/${srgType}.srg"
}
build.finalizedBy afterBuild
+8 -4
View File
@@ -1,5 +1,9 @@
include "1.12-mcp940"
include "1.12.1-test"
//Special Vanilla Edition
include "1.14.2"
//Universial Forge Version for [1.8,)
include "Forge"
//Universal Forge Edition for [1.8,)
include "Forge"
include "Forge1.14"
//Fabric Edition for [1.14,)
include "Fabric"