mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-12 02:37:33 +00:00
Remove Tab
This commit is contained in:
1 parent
4449ccdd45
commit
c40bb38e20
38 files changed
+2331
-2317
No files matched your search
@@ -16,67 +16,67 @@ import customskinloader.utils.MinecraftUtil;
|
||||
|
||||
public class CustomSkinAPIPlus implements IJsonAPI {
|
||||
|
||||
private static String clientID=null;
|
||||
public CustomSkinAPIPlus(){
|
||||
File clientIDFile=new File(CustomSkinLoader.DATA_DIR,"CustomSkinAPIPlus-ClientID");
|
||||
|
||||
if(clientIDFile.isFile())
|
||||
try{
|
||||
clientID=FileUtils.readFileToString(clientIDFile);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(clientID==null){
|
||||
clientID=UUID.randomUUID().toString();
|
||||
try {
|
||||
FileUtils.write(clientIDFile, clientID);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String toJsonUrl(String root, String username) {
|
||||
return JsonAPILoader.Type.CustomSkinAPI.jsonAPI.toJsonUrl(root, username);
|
||||
}
|
||||
private static String clientID=null;
|
||||
public CustomSkinAPIPlus(){
|
||||
File clientIDFile=new File(CustomSkinLoader.DATA_DIR,"CustomSkinAPIPlus-ClientID");
|
||||
|
||||
if(clientIDFile.isFile())
|
||||
try{
|
||||
clientID=FileUtils.readFileToString(clientIDFile);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(clientID==null){
|
||||
clientID=UUID.randomUUID().toString();
|
||||
try {
|
||||
FileUtils.write(clientIDFile, clientID);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String toJsonUrl(String root, String username) {
|
||||
return JsonAPILoader.Type.CustomSkinAPI.jsonAPI.toJsonUrl(root, username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPayload(SkinSiteProfile ssp) {
|
||||
if(ssp.privacy==null)
|
||||
ssp.privacy=new CustomSkinAPIPlusPrivacy();
|
||||
return new Gson().toJson(new CustomSkinAPIPlusPayload(ssp.privacy));
|
||||
}
|
||||
@Override
|
||||
public String getPayload(SkinSiteProfile ssp) {
|
||||
if(ssp.privacy==null)
|
||||
ssp.privacy=new CustomSkinAPIPlusPrivacy();
|
||||
return new Gson().toJson(new CustomSkinAPIPlusPayload(ssp.privacy));
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserProfile toUserProfile(String root, String json, boolean local) {
|
||||
return JsonAPILoader.Type.CustomSkinAPI.jsonAPI.toUserProfile(root, json, local);
|
||||
}
|
||||
@Override
|
||||
public UserProfile toUserProfile(String root, String json, boolean local) {
|
||||
return JsonAPILoader.Type.CustomSkinAPI.jsonAPI.toUserProfile(root, json, local);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "CustomSKinAPIPlus";
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return "CustomSKinAPIPlus";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
public static class CustomSkinAPIPlusPrivacy{
|
||||
public boolean gameVersion=true;
|
||||
public boolean modVersion=true;
|
||||
public boolean serverAddress=true;
|
||||
public boolean clientID=true;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
public static class CustomSkinAPIPlusPrivacy{
|
||||
public boolean gameVersion=true;
|
||||
public boolean modVersion=true;
|
||||
public boolean serverAddress=true;
|
||||
public boolean clientID=true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user