Remove 1.7.10

This commit is contained in:
xfl03 committed 2016-12-04 14:38:17 +08:00
1 parent cdd42d60e3
commit 481b0d9df9
40 files changed
+169 -534

No files matched your search

-141
View File
@@ -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)
}
-6
View File
@@ -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
@@ -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<String,Model> models=new HashMap<String,Model>();
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<String,MinecraftProfileTexture>)
* @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<String,MinecraftProfileTexture>)
* @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<String,String>();
hashMap.put("url", url);
Gson gson=new Gson();
String json=gson.toJson(hashMap);
MinecraftProfileTexture pt=gson.fromJson(json, MinecraftProfileTexture.class);
return pt;
}
}
@@ -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<x1;++x)
for (int y=y0;y<y1;++y)
if(this.imageData[getPosition(x,y)]!=data)
return false;
return true;
}
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;
}
/* -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 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);
}
@Override
public void func_152634_a(){
}
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;
}
}
@@ -1,174 +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.HashMap;
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 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
{
public static final ResourceLocation DEFAULT_SKIN = new ResourceLocation("textures/entity/steve.png");
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 skinCacheLoader;
private static final String __OBFID = "CL_00001830";
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).build(new CacheLoader()
{
private static final String __OBFID = "CL_00001829";
public Map func_152786_a(GameProfile p_152786_1_)
{
return Minecraft.getMinecraft().getSessionService().getTextures(p_152786_1_, false);
}
public Object load(Object p_load_1_)
{
return this.func_152786_a((GameProfile)p_load_1_);
}
});
//CustomSkinLoader Begin (Init)
customskinloader.loader.MojangAPILoader.defaultSessionService=sessionService;
customskinloader.utils.HttpTextureUtil.defaultCacheDir=skinCacheDirectory;
//CustomSkinLoader End
}
/**
* Used in the Skull renderer to fetch a skin. May download the skin if it's not in the cache
*/
public ResourceLocation loadSkin(MinecraftProfileTexture p_152792_1_, Type p_152792_2_)
{
return this.loadSkin(p_152792_1_, p_152792_2_, (SkinManager.SkinAvailableCallback)null);
}
/**
* May download the skin if its not in the cache, can be passed a SkinManager#SkinAvailableCallback for handling
*/
public ResourceLocation loadSkin(MinecraftProfileTexture p_152789_1_, final Type p_152789_2_, final SkinManager.SkinAvailableCallback p_152789_3_)
{
//CustomSkinLoader Begin (Parse HttpTextureInfo)
customskinloader.utils.HttpTextureUtil.HttpTextureInfo info=customskinloader.utils.HttpTextureUtil.toHttpTextureInfo(p_152789_1_.getUrl());
//CustomSkinLoader End
final ResourceLocation var4 = new ResourceLocation("skins/" + info.hash);//Modified
ITextureObject var5 = this.textureManager.getTexture(var4);
if (var5 != null)
{
if (p_152789_3_ != null)
{
p_152789_3_.onSkinAvailable(p_152789_2_, var4);
}
}
else
{
final IImageBuffer var8 = p_152789_2_ == Type.SKIN ? new customskinloader.renderer.SkinBuffer() : null;//Modified
ThreadDownloadImageData var9 = new ThreadDownloadImageData(info.cacheFile, info.url, DEFAULT_SKIN, new IImageBuffer()//Modified
{
private static final String __OBFID = "CL_00001828";
public BufferedImage parseUserSkin(BufferedImage p_78432_1_)
{
if (var8 != null)
{
p_78432_1_ = var8.parseUserSkin(p_78432_1_);
}
return p_78432_1_;
}
public void func_152634_a()
{
if (var8 != null)
{
var8.func_152634_a();
}
if (p_152789_3_ != null)
{
p_152789_3_.onSkinAvailable(p_152789_2_, var4);
}
}
});
this.textureManager.loadTexture(var4, var9);
}
return var4;
}
public void func_152790_a(final GameProfile p_152790_1_, final SkinManager.SkinAvailableCallback p_152790_2_, final boolean p_152790_3_)
{
THREAD_POOL.submit(new Runnable()
{
private static final String __OBFID = "CL_00001827";
public void run()
{
final HashMap var1 = Maps.newHashMap();
//CustomSkinLoader Begin (User Skin/Cape Part)
if(customskinloader.CustomSkinLoader.config.enable){
var1.putAll(customskinloader.CustomSkinLoader.loadProfile(p_152790_1_));
}else{
try{
var1.putAll(SkinManager.this.sessionService.getTextures(p_152790_1_, p_152790_3_));
}catch(InsecureTextureException var3){}
}
//CustomSkinLoader End
Minecraft.getMinecraft().addScheduledTask(new Runnable()
{
private static final String __OBFID = "CL_00001826";
public void run()
{
if (var1.containsKey(Type.SKIN))
{
SkinManager.this.loadSkin((MinecraftProfileTexture)var1.get(Type.SKIN), Type.SKIN, p_152790_2_);
}
if (var1.containsKey(Type.CAPE))
{
SkinManager.this.loadSkin((MinecraftProfileTexture)var1.get(Type.CAPE), Type.CAPE, p_152790_2_);
}
}
});
}
});
}
public Map loadSkinFromCache(GameProfile p_152788_1_)
{
//CustomSkinLoader Begin (Skull Part)
//return (Map)this.skinCacheLoader.getUnchecked(p_152788_1_);
return (customskinloader.CustomSkinLoader.config.enable && customskinloader.CustomSkinLoader.config.enableSkull)?
customskinloader.CustomSkinLoader.loadProfileFromCache(p_152788_1_):
(Map)this.skinCacheLoader.getUnchecked(p_152788_1_);
//CustomSkinLoader End
}
public interface SkinAvailableCallback
{
void onSkinAvailable(Type skinPart, ResourceLocation skinLoc);
}
}
File renamed without changes.
File renamed without changes.
+107
View File
@@ -0,0 +1,107 @@
buildscript {
repositories {
/*maven {
name = "fmm"
url = "http://forgemavenmirror.sinaapp.com/maven"
}*/
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
ext.MINECRAFT_VERSION="1.10.2"
ext.FORGE_VERSION="12.18.2.2099"
ext.MAPPING_VERSION="stable_29"
ext.MINECRAFT_FULL_VERSIONS="1.8,1.8.8,1.8.9,1.9,1.9.4,1.10,1.10.2,1.11"
ext.snapshot = !(rootProject.ext.config.snapshot==""||rootProject.ext.config.snapshot=="0"||rootProject.ext.config.snapshot==0)
archivesBaseName = "CustomSkinLoader_Forge"
version = rootProject.ext.config.version + rootProject.ext.config.dev_version + (snapshot?"-SNAPSHOT-"+System.getenv("BUILD_NUMBER"):"")
group = "customskinloader"
sourceCompatibility = targetCompatibility = "1.6"
compileJava {
sourceCompatibility = targetCompatibility = "1.6"
}
jar {
manifest {
attributes 'FMLCorePlugin': 'customskinloader.forge.FMLPlugin'
attributes 'FMLCorePluginContainsFMLMod': true
}
}
sourceSets {
main {
java {
srcDir 'MergedSource'//Merge source
}
resources {
srcDir 'MergedResource'
}
}
}
minecraft {
version = MINECRAFT_VERSION+"-"+FORGE_VERSION
runDir = "run"
mappings = MAPPING_VERSION
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
replace '@MOD_VERSION@', rootProject.ext.config.version
replace '@MOD_FULL_VERSION@', project.version
replaceIn 'CustomSkinLoader.java'
replaceIn 'FMLMod.java'
}
task mergeSource { doLast {
copy {
from '../Common/source'
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("GIT_COMMIT"),
buildUrl :System.getenv("BUILD_URL")
])
}
task afterBuild { doLast {
//Clean Up
def sourceDir = file("MergedSource")
sourceDir.deleteDir()
def resourceDir = file("MergedResource")
resourceDir.deleteDir()
//copyBuildFile
copy {
from 'build/libs'
into '../build/libs'
include '**/*.jar'
exclude '**/*-sources.jar'
}
}}
build.finalizedBy afterBuild
+11
View File
@@ -0,0 +1,11 @@
[
{
"modid": "customskinloader",
"name": "CustomSkinLoader",
"description": "Custom Skin Loader for Minecraft",
"version": "${modFullVersion}",
"url": "https://github.com/xfl03/MCCustomSkinLoader",
"authorList": ["xfl03"],
"credits": "GPLv3"
}
]
@@ -0,0 +1,7 @@
package customskinloader.forge;
@Mod(modid = "customskinloader", name = "CustomSkinLoader", version = "@MOD_FULL_VERSION@", clientSideOnly=true)
public class FMLMod{
}
@@ -0,0 +1,33 @@
package customskinloader.forge;
import java.util.Map;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
public class FMLPlugin implements IFMLLoadingPlugin {
@Override
public String[] getASMTransformerClass() {
return new String[] {customskinloader.tweaker.ClassTransformer.class.getName()};
}
@Override
public String getModContainerClass() {
return null;
}
@Override
public String getSetupClass() {
return null;
}
@Override
public void injectData(Map<String, Object> data) {
}
@Override
public String getAccessTransformerClass() {
return null;
}
}
+2 -1
View File
@@ -31,5 +31,6 @@ buildscript {
}
subprojects {
apply from: rootProject.file('common.gradle')
if(!project.name.toLowerCase().contains("forge"))
apply from: rootProject.file('common.gradle')
}
+3 -3
View File
@@ -1,6 +1,6 @@
name=CustomSkinLoader
group=customskinloader
version=14.6
dev_version=a
version=15.1
dev_version=
#RELEASE: snapshot=0
snapshot=0
snapshot=1
+2 -4
View File
@@ -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
+4 -3
View File
@@ -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"
include "1.11-test"
//Universial Forge Version for [1.8,)
include "Forge"