diff --git a/1.7.10-mcp908/build.gradle b/1.7.10-mcp908/build.gradle deleted file mode 100644 index 3aa199b..0000000 --- a/1.7.10-mcp908/build.gradle +++ /dev/null @@ -1,141 +0,0 @@ -buildscript { - repositories { - /* - maven { - name = "fmm" - url = "http://forgemavenmirror.sinaapp.com/maven" - } - */ - 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:1.2-SNAPSHOT' - } -} -apply plugin: 'forge' - -ext.rootConfigFile = file "../build.properties" -rootConfigFile.withReader { - def prop = new Properties() - prop.load(it) - project.ext.rootConfig = new ConfigSlurper().parse prop -} - -ext.configFile = file "build.properties" -configFile.withReader { - def prop = new Properties() - prop.load(it) - project.ext.config = new ConfigSlurper().parse prop -} -//Example: 14.4a-SNAPSHOT-20160820 -version = rootConfig.version + rootConfig.dev_version + ((rootConfig.snapshot==""||rootConfig.snapshot=="0"||rootConfig.snapshot==0)?'':('-SNAPSHOT-'+System.getenv("BUILD_NUMBER"))) -group = config.group -archivesBaseName = rootConfig.name+"_"+config.minecraft_version - -minecraft { - version = config.forge_mc_version+"-"+config.forge_version - runDir = "run" - mappings = config.mappings_version - - replace '@MOD_VERSION@', rootConfig.version - replace '@MOD_FULL_VERSION@', project.version - replaceIn 'CustomSkinLoader.java' -} - -jar { - manifest { - attributes 'TweakClass' : 'customskinloader.tweaker.ModSystemTweaker' - attributes 'TweakName' : rootConfig.name - attributes 'TweakAuthor' : 'xfl03,JLChnToZ' - attributes 'TweakVersion' : version - attributes 'TweakOrder' : '-10' - } -} - -task copySource << { - def outputFile = file("src/main/java") - outputFile.deleteDir() - copy { - from '../Common' - from 'src/minecraft/' - into 'src/main/java' - include '**/*.java' - } -} -sourceMainJava.dependsOn copySource - -processResources { - expand ([ - modVersion:rootConfig.version, - modFullVersion:config.minecraft_full_versions, - mcVersion:config.minecraft_version, - mcFullVersions:config.minecraft_full_versions, - forgeVersion:config.forge_version, - gitVersion:System.getenv("GIT_COMMIT"), - buildUrl:System.getenv("BUILD_URL") - ]) -} -task copyResources << { - def outputFile = file("src/main/resources") - outputFile.deleteDir() - copy { - from '../Common' - into 'src/main/resources' - exclude '**/*.java' - } -} -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 '**/*-sources.jar' - } -} -build.finalizedBy afterBuild - -//notch pack -void reobfSrgToNotch(){ - def srgName = "${archivesBaseName}-${version}-srg.jar" - def mcpName = srgName.replace('-srg', '-dev') - applySpecialSource(srgName,mcpName,"srg-mcp") - def notchName = srgName.replace('-srg', '') - applySpecialSource(mcpName,notchName,"mcp-notch") -} - -void applySpecialSource(String inputName,String outputName,String srgType){ - def mcpVersion = minecraft.mappings.replace('_',"/") - def mapping = new net.md_5.specialsource.JarMapping() - def srgFile = file(System.getProperty('user.home') + "/.gradle/caches/minecraft/net/minecraftforge/forge/${config.forge_mc_version}-${config.forge_version}/${mcpVersion}/srgs/${srgType}.srg") - 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) -} diff --git a/1.7.10-mcp908/build.properties b/1.7.10-mcp908/build.properties deleted file mode 100644 index 1cb9843..0000000 --- a/1.7.10-mcp908/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -minecraft_version=1.7.10 -minecraft_full_versions=1.7.9,1.7.10 -#forge gradle needs forge version -forge_mc_version=1.7.10 -forge_version=10.13.4.1558-1.7.10 -mappings_version=stable_12 \ No newline at end of file diff --git a/1.7.10-mcp908/src/minecraft/customskinloader/profile/ModelManager0.java b/1.7.10-mcp908/src/minecraft/customskinloader/profile/ModelManager0.java deleted file mode 100644 index 8e7de5f..0000000 --- a/1.7.10-mcp908/src/minecraft/customskinloader/profile/ModelManager0.java +++ /dev/null @@ -1,107 +0,0 @@ -package customskinloader.profile; - -import java.util.HashMap; -import java.util.Map; - -import com.google.common.collect.Maps; -import com.google.gson.Gson; -import com.mojang.authlib.minecraft.MinecraftProfileTexture; -import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; - -/** - * Model Manager for 1.7.10 and lower. - * A manager to check if model is available. - * It is the only class in package 'customskinloader' which has differences in different Minecraft version. - * @since 13.1 - */ -public class ModelManager0 { - public static enum Model{ - SKIN_DEFAULT, - SKIN_SLIM, - CAPE, - ELYTRA - } - private static HashMap models=new HashMap(); - private static Type typeElytra=null; - static{ - models.put("default", Model.SKIN_DEFAULT); - models.put("cape", Model.CAPE); - } - - /** - * Get enum for the model. - * @param model - string model - * @since 14.5 - */ - public static Model getEnumModel(String model){ - return models.get(model); - } - - /** - * Check if model is skin. - * @since 14.5 - * */ - public static boolean isSkin(Model model){ - return model==Model.SKIN_DEFAULT||model==Model.SKIN_SLIM; - } - - /** - * Check if elytra is supported. - * @since 14.5 - */ - public static boolean isElytraSupported(){ - return false; - } - - /** - * Parse hashMapProfile to UserProfile - * @param profile - hashMapProfile (HashMap) - * @return profile - UserProfile instance - * @since 13.1 - */ - public static UserProfile toUserProfile(Map profile){ - UserProfile userProfile=new UserProfile(); - if(profile==null) - return userProfile; - MinecraftProfileTexture skin=(MinecraftProfileTexture)profile.get(Type.SKIN); - userProfile.skinUrl= skin==null?null:skin.getUrl();//Avoid NullPointerException - userProfile.model="default"; - MinecraftProfileTexture cape=(MinecraftProfileTexture)profile.get(Type.CAPE); - userProfile.capeUrl= cape==null?null:cape.getUrl(); - return userProfile; - } - - /** - * Parse UserProfile to hashMapProfile - * @param profile - UserProfile instance - * @return profile - hashMapProfile (HashMap) - * @since 13.1 - */ - public static Map fromUserProfile(UserProfile profile){ - Map map=Maps.newHashMap(); - if(profile==null) - return map; - if(profile.skinUrl!=null) - map.put(Type.SKIN, getProfileTexture(profile.skinUrl,null)); - if(profile.capeUrl!=null) - map.put(Type.CAPE, getProfileTexture(profile.capeUrl,null)); - return map; - } - - /** - * Parse url to MinecraftProfileTexture - * Fix authlib 21 bug for 1.7.10 - * @param url - textureUrl - * metadata - metadata - * @return MinecraftProfileTexture - * @since 14.5 - */ - public static MinecraftProfileTexture getProfileTexture(String url,Map metadata){ - Map hashMap=new HashMap(); - hashMap.put("url", url); - Gson gson=new Gson(); - String json=gson.toJson(hashMap); - MinecraftProfileTexture pt=gson.fromJson(json, MinecraftProfileTexture.class); - return pt; - } -} diff --git a/1.7.10-mcp908/src/minecraft/customskinloader/renderer/SkinBuffer.java b/1.7.10-mcp908/src/minecraft/customskinloader/renderer/SkinBuffer.java deleted file mode 100644 index 0cbec03..0000000 --- a/1.7.10-mcp908/src/minecraft/customskinloader/renderer/SkinBuffer.java +++ /dev/null @@ -1,95 +0,0 @@ -package customskinloader.renderer; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.image.BufferedImage; -import java.awt.image.DataBufferInt; -import java.awt.image.ImageObserver; - -public class SkinBuffer implements net.minecraft.client.renderer.IImageBuffer { - - private int[] imageData; - private int ratio=1; - - @Override - public BufferedImage parseUserSkin(BufferedImage image) { - if(image==null) - return null; - ratio = image.getWidth() / 64; - BufferedImage bufferedimage = new BufferedImage(64 * ratio, 32 * ratio, 2); - Graphics graphics = bufferedimage.getGraphics(); - graphics.setColor(new Color(0,0,0,0)); - graphics.fillRect(0,0,64,32); - if (image.getHeight() == 64 * ratio){//Double layer - graphics.drawImage(image, 0 *ratio, 0 *ratio, 64*ratio, 32*ratio, 0 *ratio, 0 *ratio, 64*ratio, 32*ratio, (ImageObserver)null); - graphics.drawImage(image, 0 *ratio, 16*ratio, 64*ratio, 32*ratio, 0 *ratio, 32*ratio, 64*ratio, 48*ratio, (ImageObserver)null); - }else{ - graphics.drawImage(image, 0, 0, (ImageObserver)null); - } - 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);//Leg - 1 - setAreaDueToConfig(16 * ratio,16 * ratio,40 * ratio,32 * ratio);//Body - 1 - setAreaDueToConfig(40 * ratio,16 * ratio,56 * ratio,32 * ratio);//Arm - 1 - - return bufferedimage; - } - - /* 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) - return false; - for (int x=x0;x - * 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 data) { + } + + @Override + public String getAccessTransformerClass() { + return null; + } + +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2174ed3..0812492 100644 --- a/build.gradle +++ b/build.gradle @@ -31,5 +31,6 @@ buildscript { } subprojects { - apply from: rootProject.file('common.gradle') + if(!project.name.toLowerCase().contains("forge")) + apply from: rootProject.file('common.gradle') } \ No newline at end of file diff --git a/build.properties b/build.properties index 83c2651..2cd9caf 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ name=CustomSkinLoader group=customskinloader -version=14.6 -dev_version=a +version=15.1 +dev_version= #RELEASE: snapshot=0 -snapshot=0 \ No newline at end of file +snapshot=1 \ No newline at end of file diff --git a/common.gradle b/common.gradle index eeb852e..3eef7f8 100644 --- a/common.gradle +++ b/common.gradle @@ -58,10 +58,9 @@ task copySource << { def outputFile = file("src/main/java") outputFile.deleteDir() copy { - from '../Common' + from '../Common/source' from 'src/minecraft/' into 'src/main/java' - include '**/*.java' } } sourceMainJava.dependsOn copySource @@ -81,9 +80,8 @@ task copyResources << { def outputFile = file("src/main/resources") outputFile.deleteDir() copy { - from '../Common' + from '../Common/resource' into 'src/main/resources' - exclude '**/*.java' } } processResources.dependsOn copyResources diff --git a/settings.gradle b/settings.gradle index f51bbc6..0b0cabf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,9 @@ -//Remove Build 1.7.10 -//include "1.7.10-mcp908" include "1.8-mcp910" include "1.8.8-mcp918" include "1.9-mcp924" include "1.9.4-mcp928" include "1.10-mcp931" -include "1.11-test" \ No newline at end of file +include "1.11-test" + +//Universial Forge Version for [1.8,) +include "Forge" \ No newline at end of file