Fix PlayerTab

This commit is contained in:
xfl03 committed 2017-06-18 21:31:25 +08:00
1 parent d6281881a5
commit 7dc2c45600
6 files changed
+87 -29

No files matched your search

+13
View File
@@ -10,3 +10,16 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
#VSCode
.vscode/
#eclipse
*/.classpath
.classpath
*/.project
.project
.settings/
#gradle
.gradle/
@@ -33,7 +33,7 @@ public class CustomSkinLoader {
CONFIG_FILE=new File(DATA_DIR,"CustomSkinLoader.json");
public static final SkinSiteProfile[] DEFAULT_LOAD_LIST={
SkinSiteProfile.createMojangAPI("Mojang"),
SkinSiteProfile.createCustomSkinAPI("BlessingSkin","http://http://123.57.132.134/"),
SkinSiteProfile.createCustomSkinAPI("BlessingSkin","http://123.57.132.134/"),
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),
@@ -2,7 +2,11 @@ package customskinloader.forge;
import net.minecraftforge.fml.common.Mod;
@Mod(modid = "customskinloader", name = "CustomSkinLoader", version = "@MOD_FULL_VERSION@", clientSideOnly=true, acceptedMinecraftVersions="[1.8,)")
@Mod(modid = "customskinloader",
name = "CustomSkinLoader",
version = "@MOD_FULL_VERSION@",
clientSideOnly=true,
acceptedMinecraftVersions="[1.8,)")
public class ForgeMod{
}
@@ -0,0 +1,36 @@
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.InsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
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{
//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));
}
}
}
}
}
@@ -17,7 +17,7 @@ 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.*;
public class TransformerManager implements IClassTransformer {
@@ -35,7 +35,8 @@ public class TransformerManager implements IClassTransformer {
new InitTransformer(),
new LoadSkinTransformer(),
new LoadProfileTexturesTransformer(),
new LoadSkinFromCacheTransformer()};
new LoadSkinFromCacheTransformer(),
new ScoreObjectiveTransformer()};
private Map<String, Map<String, IMethodTransformer>> map;
public TransformerManager(){
map = new HashMap<String, Map<String, IMethodTransformer>>();
@@ -57,7 +58,7 @@ public class TransformerManager implements IClassTransformer {
}
}
//From: https://github.com/RecursiveG/UniSkinMod/blob/1.9.4/src/main/java/org/devinprogress/uniskinmod/coremod/BaseAsmTransformer.java
//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;
+28 -24
View File
@@ -1,20 +1,20 @@
#CustomSkinLoader
##What's this?
Custom Skin Loader mod for Minecraft.
You can use it to load any skin from any website.
#CustomSkinLoader
##What's this?
Custom Skin Loader mod for Minecraft.
You can use it to load any skin from any website.
##Download
##Download
Build Server : [Infinity Studio CI](https://ci.infstudio.net/job/CustomSkinLoader/)
[![Build Status](https://ci.infstudio.net/job/CustomSkinLoader/badge/icon)](https://ci.infstudio.net/job/CustomSkinLoader/)
Release Page : [MCBBS](http://www.mcbbs.net/thread-269807-1-1.html)
##Feature
###Plenty of Skin Load API Support and Customizable Skin Load List
Skin Load API Supported:
- [Mojang API](http://wiki.vg/Mojang_API)
- [CustomSkinAPI](https://github.com/xfl03/CustomSkinLoaderAPI/tree/master/CustomSkinAPI)
##Feature
###Plenty of Skin Load API Support and Customizable Skin Load List
Skin Load API Supported:
- [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)
- [UniSkinAPI](https://github.com/RecursiveG/UniSkinServer/tree/master/doc)
- Legacy
- ElfSkin (Self-made API, Test Only)
@@ -29,33 +29,33 @@ You can easily to get a better view in skin.
Fixed skull load bug.
Dynamic skull supported.
###Profile Cache
###Profile Cache
- Decrease frenquency of using network.
- Meanwhile,you can still load profile without network.
*Should be open in configratulation file.
###Local Skin
###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.
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`.
###Extra List
*While using default configratulation, just put skin 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` .
###Transparent Skin Support
###Transparent Skin Support
The problem of rendering incorrect texture has been fixed.
##Default Load List
- [Mojang](http://www.minecraft.net/) (Mojang API)
- [Blessing Skin](http://skin.prinzeugen.net/) (CustomSkinAPI)
- [OneSkin](http://fleey.org/skin/) (CustomSkinAPI)
- [Blessing Skin](http://123.57.132.134/) (CustomSkinAPI)
- [OneSkin](http://fleey.cn/skin/) (CustomSkinAPI)
- 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
##To Skin Server Owner
CustomSkinLoader is designed for loading from any server, which makes it 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.
@@ -63,15 +63,19 @@ 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.
##Copyright & LICENSE
###Binary File
###Binary File
You could not modify binary file.
Feel free to use and share this mod and unmodified file in anyway like modpack.
When using in modpack, you must put 'CustomSkinLoader' in mod list.
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'
Copyright(C) 2013-2016 JLChnToZ xfl03
####Package 'customskinloader'
Including some code from
- [AsteriskTeam/TabIconHackForge](http://git.oschina.net/AsteriskTeam/TabIconHackForge) (GPLv3)
- [RecursiveG/UniSkinMod](https://github.com/RecursiveG/UniSkinMod) (GPLv3)
Copyright(C) 2013-2017 JLChnToZ xfl03
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.