Jump to content

Recommended Posts

Posted

Hi, I'm developing a mod for minecraft 1.7.10 and I'm trying to get the texture of some blocks and adding to them an overlay to make something like this R1kCi7J.png that is the texture of the oak planks plus the black cage with the red dots, is there a way to do this without making every single texture? Thanks in advance

Set the power inside a single block free! ;D

Posted

Oh man are you in for a fun time tonight.

 

Short answer: yes, two ways.

1) render the block twice

2) custom TextureAtlasSprite loading

 

1 is easier and found via Google ("two pass blocks"), 2 is muuuch more complicated and will need to wait for me to be at my desktop again. There's a copy on the forum here somewhere, check my user profile for threads started on the last couple of months.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Here we go.

 

There are a few important parts, and a few unimportant ones.

Important:

-

hasCustomLoader()

-

load()

 

Unimportant:

-

colorize()

which handles color multiplication (I used it to colorize the overlay image but not the base).

- anything dealing with

invert

(this was special case handling I wanted so that my grayscale overlays could be inverted white-to-black so that they could be used equally well on a dark base (such as basalt) or a light base (such as marble).

 

scaleToSmaller() should be rewritten to be "scaleToLarger()" but it was easy to write and lets the overlay handle resource packs changing resolution size of only one texture without breaking horribly.  It may not generate a good result, but it will generate a valid result.

 

 

The imports

import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;

import javax.imageio.ImageIO;

import com.google.common.collect.Lists;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.client.resources.data.AnimationMetadataSection;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;

 

public class TextureAtlasDynamic extends TextureAtlasSprite {
protected String textureBase;
protected String textureOverlay;
protected Color colorMulti;
protected boolean invert;

public TextureAtlasDynamic(String p_i1282_1_, String base, String overlay, Color color, boolean inv) {
	super(p_i1282_1_);
	textureBase = base;
	textureOverlay = overlay;
	colorMulti = color;
	invert = inv;
}

@Override
public void updateAnimation() {
	TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(0), this.width, this.height, this.originX, this.originY, false, false);
}

@Override
public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) {
        return true;
    }

@Override
    public boolean load(IResourceManager manager, ResourceLocation location) {
	framesTextureData.clear();
        this.frameCounter = 0;
        this.tickCounter = 0;
        
    	ResourceLocation resource1 = new ResourceLocation(textureBase);
    	ResourceLocation resource2 = new ResourceLocation(textureOverlay);
        try {
        	TextureMap map = Minecraft.getMinecraft().getTextureMapBlocks();
        	resource1 = this.completeResourceLocation(map, resource1, 0);
        	resource2 = this.completeResourceLocation(map, resource2, 0);
		BufferedImage buff = ImageIO.read(manager.getResource(resource1).getInputStream());
		BufferedImage buff2 = ImageIO.read(manager.getResource(resource2).getInputStream());

        int[] rawBase = new int[buff.getWidth()*buff.getHeight()];
        int[] rawOverlay = new int[buff2.getWidth()*buff2.getHeight()];

        buff.getRGB(0, 0, buff.getWidth(), buff.getHeight(), rawBase, 0, buff.getWidth());
        buff2.getRGB(0, 0, buff2.getWidth(), buff2.getHeight(), rawOverlay, 0, buff2.getWidth());
        
        int min = Math.min(buff.getWidth(),buff2.getWidth());
        rawBase = scaleToSmaller(rawBase, buff.getWidth(), min);
        rawOverlay = scaleToSmaller(rawOverlay, buff2.getWidth(), min);

        width = min;
        height = min;
        
        int r1,g1,b1;
        int r2,g2,b2;
        float a1,a2,a3;
        for(int p=0; p<rawBase.length;p++) {
        	Color c1 = new Color(rawBase[p],true);
        	Color c2 = new Color(rawOverlay[p],true);
        	
        	c2 = colorize(colorMulti,c2,invert);
        	
        	a1 = c1.getAlpha()/255f;
        	r1 = c1.getRed();
        	g1 = c1.getGreen();
        	b1 = c1.getBlue();
        	a2 = c2.getAlpha()/255f;
        	r2 = c2.getRed();
        	g2 = c2.getGreen();
        	b2 = c2.getBlue();
        	a3 = a2+a1*(1-a2);
        	
        	if(a3 > 0) {
	        	r1 = Math.round(((r2*a2)+(r1*a1*(1-a2)))/a3);
	        	g1 = Math.round(((g2*a2)+(g1*a1*(1-a2)))/a3);
	        	b1 = Math.round(((b2*a2)+(b1*a1*(1-a2)))/a3);
        	}
        	else {
        		r1 = g1 = b1 = 0;
        	}
        	Color c3 = new Color(r1,g1,b1,Math.round(a3*255));
        	rawBase[p] = c3.getRGB();
        }
        
        int[][] aint = new int[1 + MathHelper.calculateLogBaseTwo(min)][];
        for (int k = 0; k < aint.length; ++k)
        {
        	aint[k] = rawBase;
        }

        this.framesTextureData.add(aint);
	} catch (IOException e) {
		e.printStackTrace();
		int[][] aint = new int[1][];
        for (int k = 0; k < 1; ++k)
        {
        	aint[k] = new int[16*16];
        	for(int l=0; l<aint[k].length;l++) {
        		aint[k][l] = 0xFFFFFFFF;
        	}
        }
        width = 16;
        height = 16;

        this.framesTextureData.add(aint);
	}
        return false;
    }

private static int[] scaleToSmaller(int[] data, int width, int min) {
	if(width == min) { return data; }
	int scale = width / min;
	int[] output = new int[min*min];
	int j = 0;
	for(int i = 0; i < output.length; i++) {
		if(i%min == 0) {
			j += width;
		}
		output[i] = data[i*scale+j];
	}
	return output;
}

private static ResourceLocation completeResourceLocation(TextureMap map, ResourceLocation loc, int c)
    {
        try {
		return (ResourceLocation)HardLib.proxy.resourceLocation.invoke(map, loc, c); //see below
	} catch (IllegalAccessException e) {
		e.printStackTrace();
	} catch (IllegalArgumentException e) {
		e.printStackTrace();
	} catch (InvocationTargetException e) {
		e.printStackTrace();
	}
        return null;
    }

    private static Color colorize(Color cm, Color c2, boolean invert) {
    	float[] pix = new float[3];
    	float[] mul = new float[3];
    	Color.RGBtoHSB(c2.getRed(), c2.getGreen(), c2.getBlue(),pix);
    	Color.RGBtoHSB(cm.getRed(), cm.getGreen(), cm.getBlue(), mul);
    	float v = (invert?1-pix[2]:pix[2]);
    	Color c3 = new Color(Color.HSBtoRGB(mul[0], mul[1], v));
    	return new Color(c3.getRed(),c3.getGreen(),c3.getBlue(),c2.getAlpha());
    }
}

The only bit that is external is the reflection which I did in my common proxy.  It could have been static.

public class ClientProxy extends CommonProxy {
//public Method resourceLocation; in CommonProxy
public void init() {
	Class clz = TextureMap.class;
        Method[] meths = clz.getDeclaredMethods();
        for(Method m : meths) {
        	if(m.getReturnType() == ResourceLocation.class) {
        		m.setAccessible(true);
        		resourceLocation = m;
        	}
        }
}

 

And finally, registering the TextureAtlasSprite without needing events:

(I had an array of 12 used for the same block)

 

	@Override
    @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
	this.icons = new IIcon[12];
	if(iconRegister instanceof TextureMap) { //instanceof check, TextureMap should be the only thing that implements IIconRegister
		TextureMap map = (TextureMap)iconRegister;
		for(int o = 0; o < 12; o++) {
			String overlayName = "hazards:stone_overlay_"+o;
			String baseName = this.getTextureName(); //passed via block constructor from the block its "cloning"
			String regname = "hazards:"+this.getUnlocalizedName()+"_"+o; //the overlay texture
			map.setTextureEntry(regname, new TextureAtlasDynamic(regname,baseName,overlayName,new Color(color),inv));
			icons[o] = map.getTextureExtry(regname);
		}
	}
}

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Here we go.

 

There are a few important parts, and a few unimportant ones.

Important:

-

hasCustomLoader()

-

load()

 

Unimportant:

-

colorize()

which handles color multiplication (I used it to colorize the overlay image but not the base).

- anything dealing with

invert

(this was special case handling I wanted so that my grayscale overlays could be inverted white-to-black so that they could be used equally well on a dark base (such as basalt) or a light base (such as marble).

 

scaleToSmaller() should be rewritten to be "scaleToLarger()" but it was easy to write and lets the overlay handle resource packs changing resolution size of only one texture without breaking horribly.  It may not generate a good result, but it will generate a valid result.

 

 

The imports

import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;

import javax.imageio.ImageIO;

import com.google.common.collect.Lists;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.client.resources.data.AnimationMetadataSection;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;

 

public class TextureAtlasDynamic extends TextureAtlasSprite {
protected String textureBase;
protected String textureOverlay;
protected Color colorMulti;
protected boolean invert;

public TextureAtlasDynamic(String p_i1282_1_, String base, String overlay, Color color, boolean inv) {
	super(p_i1282_1_);
	textureBase = base;
	textureOverlay = overlay;
	colorMulti = color;
	invert = inv;
}

@Override
public void updateAnimation() {
	TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(0), this.width, this.height, this.originX, this.originY, false, false);
}

@Override
public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) {
        return true;
    }

@Override
    public boolean load(IResourceManager manager, ResourceLocation location) {
	framesTextureData.clear();
        this.frameCounter = 0;
        this.tickCounter = 0;
        
    	ResourceLocation resource1 = new ResourceLocation(textureBase);
    	ResourceLocation resource2 = new ResourceLocation(textureOverlay);
        try {
        	TextureMap map = Minecraft.getMinecraft().getTextureMapBlocks();
        	resource1 = this.completeResourceLocation(map, resource1, 0);
        	resource2 = this.completeResourceLocation(map, resource2, 0);
		BufferedImage buff = ImageIO.read(manager.getResource(resource1).getInputStream());
		BufferedImage buff2 = ImageIO.read(manager.getResource(resource2).getInputStream());

        int[] rawBase = new int[buff.getWidth()*buff.getHeight()];
        int[] rawOverlay = new int[buff2.getWidth()*buff2.getHeight()];

        buff.getRGB(0, 0, buff.getWidth(), buff.getHeight(), rawBase, 0, buff.getWidth());
        buff2.getRGB(0, 0, buff2.getWidth(), buff2.getHeight(), rawOverlay, 0, buff2.getWidth());
        
        int min = Math.min(buff.getWidth(),buff2.getWidth());
        rawBase = scaleToSmaller(rawBase, buff.getWidth(), min);
        rawOverlay = scaleToSmaller(rawOverlay, buff2.getWidth(), min);

        width = min;
        height = min;
        
        int r1,g1,b1;
        int r2,g2,b2;
        float a1,a2,a3;
        for(int p=0; p<rawBase.length;p++) {
        	Color c1 = new Color(rawBase[p],true);
        	Color c2 = new Color(rawOverlay[p],true);
        	
        	c2 = colorize(colorMulti,c2,invert);
        	
        	a1 = c1.getAlpha()/255f;
        	r1 = c1.getRed();
        	g1 = c1.getGreen();
        	b1 = c1.getBlue();
        	a2 = c2.getAlpha()/255f;
        	r2 = c2.getRed();
        	g2 = c2.getGreen();
        	b2 = c2.getBlue();
        	a3 = a2+a1*(1-a2);
        	
        	if(a3 > 0) {
	        	r1 = Math.round(((r2*a2)+(r1*a1*(1-a2)))/a3);
	        	g1 = Math.round(((g2*a2)+(g1*a1*(1-a2)))/a3);
	        	b1 = Math.round(((b2*a2)+(b1*a1*(1-a2)))/a3);
        	}
        	else {
        		r1 = g1 = b1 = 0;
        	}
        	Color c3 = new Color(r1,g1,b1,Math.round(a3*255));
        	rawBase[p] = c3.getRGB();
        }
        
        int[][] aint = new int[1 + MathHelper.calculateLogBaseTwo(min)][];
        for (int k = 0; k < aint.length; ++k)
        {
        	aint[k] = rawBase;
        }

        this.framesTextureData.add(aint);
	} catch (IOException e) {
		e.printStackTrace();
		int[][] aint = new int[1][];
        for (int k = 0; k < 1; ++k)
        {
        	aint[k] = new int[16*16];
        	for(int l=0; l<aint[k].length;l++) {
        		aint[k][l] = 0xFFFFFFFF;
        	}
        }
        width = 16;
        height = 16;

        this.framesTextureData.add(aint);
	}
        return false;
    }

private static int[] scaleToSmaller(int[] data, int width, int min) {
	if(width == min) { return data; }
	int scale = width / min;
	int[] output = new int[min*min];
	int j = 0;
	for(int i = 0; i < output.length; i++) {
		if(i%min == 0) {
			j += width;
		}
		output[i] = data[i*scale+j];
	}
	return output;
}

private static ResourceLocation completeResourceLocation(TextureMap map, ResourceLocation loc, int c)
    {
        try {
		return (ResourceLocation)HardLib.proxy.resourceLocation.invoke(map, loc, c); //see below
	} catch (IllegalAccessException e) {
		e.printStackTrace();
	} catch (IllegalArgumentException e) {
		e.printStackTrace();
	} catch (InvocationTargetException e) {
		e.printStackTrace();
	}
        return null;
    }

    private static Color colorize(Color cm, Color c2, boolean invert) {
    	float[] pix = new float[3];
    	float[] mul = new float[3];
    	Color.RGBtoHSB(c2.getRed(), c2.getGreen(), c2.getBlue(),pix);
    	Color.RGBtoHSB(cm.getRed(), cm.getGreen(), cm.getBlue(), mul);
    	float v = (invert?1-pix[2]:pix[2]);
    	Color c3 = new Color(Color.HSBtoRGB(mul[0], mul[1], v));
    	return new Color(c3.getRed(),c3.getGreen(),c3.getBlue(),c2.getAlpha());
    }
}

The only bit that is external is the reflection which I did in my common proxy.  It could have been static.

public class ClientProxy extends CommonProxy {
//public Method resourceLocation; in CommonProxy
public void init() {
	Class clz = TextureMap.class;
        Method[] meths = clz.getDeclaredMethods();
        for(Method m : meths) {
        	if(m.getReturnType() == ResourceLocation.class) {
        		m.setAccessible(true);
        		resourceLocation = m;
        	}
        }
}

 

And finally, registering the TextureAtlasSprite without needing events:

(I had an array of 12 used for the same block)

 

	@Override
    @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
	this.icons = new IIcon[12];
	if(iconRegister instanceof TextureMap) { //instanceof check, TextureMap should be the only thing that implements IIconRegister
		TextureMap map = (TextureMap)iconRegister;
		for(int o = 0; o < 12; o++) {
			String overlayName = "hazards:stone_overlay_"+o;
			String baseName = this.getTextureName(); //passed via block constructor from the block its "cloning"
			String regname = "hazards:"+this.getUnlocalizedName()+"_"+o; //the overlay texture
			map.setTextureEntry(regname, new TextureAtlasDynamic(regname,baseName,overlayName,new Color(color),inv));
			icons[o] = map.getTextureExtry(regname);
		}
	}
}

First of all, THANK YOU.

 

Second: I've tried your code but I've a problem at this point:

private static ResourceLocation completeResourceLocation(TextureMap map, ResourceLocation loc, int c) {
	try {
		return (ResourceLocation) HardLib.proxy.resourceLocation.invoke(map, loc, c);
	} catch (IllegalAccessException e) {
		e.printStackTrace();
	} catch (IllegalArgumentException e) {
		e.printStackTrace();
	} catch (InvocationTargetException e) {
		e.printStackTrace();
	}
	return null;
}

It need HardLib proxy that's from your library/api (I found it on github  ;D) so I've changed it to refer to my ClientProxy Class but it sais that i've not decleared resourceLocation as a variable. My ClientProxy Class is:

package com.lsmod.compactstorage;

import java.lang.reflect.Method;

import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.ResourceLocation;

public class ClientProxy {

public void preInit(FMLPreInitializationEvent e) {

}

public void init() {
	Class clz = TextureMap.class;
	Method[] meths = clz.getDeclaredMethods();
	for (Method m : meths) {
		if (m.getReturnType() == ResourceLocation.class) {
			m.setAccessible(true);
			resourceLocation = m;
		}
	}
}

public void postInit(FMLPostInitializationEvent e) {

}

}

Oh, if it could help I followed this guide to learn basics for modding and my classes looks very similar to the author's ones https://play.google.com/store/books/details?id=KE2EBAAAQBAJ&source=ge-web-app

Set the power inside a single block free! ;D

Posted
Second: I've tried your code but I've a problem at this point:

 

It need HardLib proxy that's from your library/api (I found it on github  ;D) so I've changed it to refer to my ClientProxy Class but it sais that i've not decleared resourceLocation as a variable. My ClientProxy Class is:

 

That was the second choice block I'd including putting the field in the common proxy.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

That was the second choice block I'd including putting the field in the common proxy.

Ok, now the game loads correctly but in the console I've the missing texture error with another error that i haven't never seen

[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN minecraft
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]:   domain minecraft is missing 1 texture
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]:     domain minecraft has 3 locations:
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]:       unknown resourcepack type net.minecraft.client.resources.DefaultResourcePack : Default
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]:       mod FML resources at C:\Users\lmlor\.gradle\caches\minecraft\net\minecraftforge\forge\1.7.10-10.13.4.1558-1.7.10\forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]:       mod Forge resources at C:\Users\lmlor\.gradle\caches\minecraft\net\minecraftforge\forge\1.7.10-10.13.4.1558-1.7.10\forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain minecraft are:
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/blocks/MISSING_ICON_BLOCK_165_testBlock.png
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain minecraft
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[21:35:20] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

Set the power inside a single block free! ;D

Posted

Show your icon registration method in your block class.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Show your icon registration method in your block class.

This is ma test Block class, I don't know if it's correct, probabily no  :-[ Which are the resources folder for the textures? minecraft default for base and  src\main\resources\assets\modid\textures\blocks for overlay?

package com.lsmod.CompactStorage.Blocks;

import com.lsmod.CompactStorage.CompactStorage;
import com.lsmod.CompactStorage.client.TextureAtlasDynamic;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.creativetab.CreativeTabs;

public class testBlock extends Block {

public testBlock(String name) {
	super(Material.wood);
	setBlockName(name);
	setCreativeTab(CreativeTabs.tabBlock);
	setHardness(3F);
	setResistance(15F);
	setStepSound(soundTypeWood);
	setHarvestLevel("axe", 1);
}

@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
	if (iconRegister instanceof TextureMap) {
		TextureMap map = (TextureMap) iconRegister;
		String overlayName = "tier0";
		String baseName = "planks_oak";
		String regname = "planks_oak";
		map.setTextureEntry(regname, new TextureAtlasDynamic(regname, baseName, overlayName));
	}
}
}

Set the power inside a single block free! ;D

Posted

You missed an important line:

 

				icons[o] = map.getTextureExtry(regname);

 

You need to get the IIcon back out and save it to a field in the block, which is then returned via getIcon(...)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

You missed an important line:

 

				icons[o] = map.getTextureExtry(regname);

 

You need to get the IIcon back out and save it to a field in the block, which is then returned via getIcon(...)

Ok, I've finished my ideas  :'( Please Help me  :'( :'( :'(

Crash Report

[16:05:53] [main/INFO] [GradleStart]: Extra: []

[16:05:54] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --accessToken, {REDACTED}, --assetIndex, 1.7.10, --assetsDir, C:/Users/lmlor/.gradle/caches/minecraft/assets, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[16:05:54] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[16:05:54] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[16:05:54] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[16:05:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

[16:05:54] [main/INFO] [FML]: Forge Mod Loader version 7.99.36.1558 for Minecraft 1.7.10 loading

[16:05:54] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.7.0_79, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jdk1.7.0_79\jre

[16:05:54] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[16:05:54] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[16:05:54] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin

[16:05:54] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[16:05:54] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:05:54] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

[16:05:54] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[16:05:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:05:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:05:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[16:05:54] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[16:05:55] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[16:05:55] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[16:05:55] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

[16:05:55] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[16:05:55] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker

[16:05:55] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker

[16:05:55] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[16:05:56] [main/INFO]: Setting user: Player640

[16:05:57] [Client thread/INFO]: LWJGL Version: 2.9.1

[16:05:57] [Client thread/INFO] [sTDOUT]: [cpw.mods.fml.client.SplashProgress:start:188]: ---- Minecraft Crash Report ----

// I bet Cylons wouldn't have this problem.

 

Time: 30/12/15 16.05

Description: Loading screen debug info

 

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.7.0_79, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 810616680 bytes (773 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML:

GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 359.06' Renderer: 'GeForce GTX 650/PCIe/SSE2'

[16:05:58] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[16:05:58] [Client thread/INFO] [FML]: MinecraftForge v10.13.4.1558 Initialized

[16:05:58] [Client thread/INFO] [FML]: Replaced 183 ore recipies

[16:05:58] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[16:05:58] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer

[16:05:58] [Client thread/INFO] [FML]: Searching C:\Users\lmlor\Desktop\MODs\CS-Dev\eclipse\mods for mods

[16:06:02] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

[16:06:02] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, CompactStorage] at CLIENT

[16:06:02] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, CompactStorage] at SERVER

[16:06:02] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Compact Storage

[16:06:02] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[16:06:02] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations

[16:06:02] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations

[16:06:02] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations

[16:06:02] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.net.UnknownHostException: files.minecraftforge.net

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.net.Socket.connect(Socket.java:579)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.net.Socket.connect(Socket.java:528)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.NetworkClient.doConnect(NetworkClient.java:180)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.www.http.HttpClient.New(HttpClient.java:308)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.www.http.HttpClient.New(HttpClient.java:326)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.net.URL.openStream(URL.java:1037)

[16:06:02] [Forge Version Check/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.common.ForgeVersion$1.run(ForgeVersion.java:90)

[16:06:02] [Client thread/INFO] [FML]: Applying holder lookups

[16:06:02] [Client thread/INFO] [FML]: Holder lookups applied

[16:06:02] [Client thread/INFO] [FML]: Injecting itemstacks

[16:06:02] [Client thread/INFO] [FML]: Itemstack injection complete

[16:06:02] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

[16:06:02] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem...

[16:06:02] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL

[16:06:02] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[16:06:02] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.

[16:06:03] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

[16:06:03] [sound Library Loader/INFO]: Sound engine started

[16:06:03] [Client thread/INFO]: Created: 16x16 textures/blocks-atlas

[16:06:03] [Client thread/INFO]: Created: 16x16 textures/items-atlas

[16:06:03] [Client thread/INFO] [FML]: Injecting itemstacks

[16:06:03] [Client thread/INFO] [FML]: Itemstack injection complete

[16:06:03] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

[16:06:03] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Compact Storage

[16:06:03] [Client thread/INFO]: Created: 256x256 textures/items-atlas

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.IllegalArgumentException: wrong number of arguments

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:606)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.lsmod.CompactStorage.client.TextureAtlasDynamic.completeResourceLocation(TextureAtlasDynamic.java:110)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.lsmod.CompactStorage.client.TextureAtlasDynamic.load(TextureAtlasDynamic.java:51)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:125)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:98)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:172)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:143)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:121)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:654)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:327)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.startGame(Minecraft.java:597)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.run(Minecraft.java:942)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.main.Main.main(Main.java:164)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:606)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at GradleStart.main(Unknown Source)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.IllegalArgumentException: wrong number of arguments

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:606)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.lsmod.CompactStorage.client.TextureAtlasDynamic.completeResourceLocation(TextureAtlasDynamic.java:110)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.lsmod.CompactStorage.client.TextureAtlasDynamic.load(TextureAtlasDynamic.java:52)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:125)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:98)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:172)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:143)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:121)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:654)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:327)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.startGame(Minecraft.java:597)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.run(Minecraft.java:942)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.main.Main.main(Main.java:164)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:606)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at GradleStart.main(Unknown Source)

[16:06:03] [Client thread/INFO]: Caught error stitching, removing all assigned resourcepacks

net.minecraft.util.ReportedException: Registering texture

at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:111) ~[TextureManager.class:?]

at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:172) ~[TextureManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:143) ~[simpleReloadableResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:121) ~[simpleReloadableResourceManager.class:?]

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:654) [Minecraft.class:?]

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:327) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:597) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:942) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

at GradleStart.main(Unknown Source) [start/:?]

Caused by: java.lang.NullPointerException

at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:63) ~[simpleReloadableResourceManager.class:?]

at com.lsmod.CompactStorage.client.TextureAtlasDynamic.load(TextureAtlasDynamic.java:53) ~[TextureAtlasDynamic.class:?]

at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:125) ~[TextureMap.class:?]

at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:98) ~[TextureMap.class:?]

at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) ~[TextureManager.class:?]

... 16 more

[16:06:04] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Compact Storage

[16:06:04] [Client thread/INFO]: Created: 256x256 textures/items-atlas

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.IllegalArgumentException: wrong number of arguments

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:606)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.lsmod.CompactStorage.client.TextureAtlasDynamic.completeResourceLocation(TextureAtlasDynamic.java:110)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.lsmod.CompactStorage.client.TextureAtlasDynamic.load(TextureAtlasDynamic.java:51)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:125)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:98)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:172)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:143)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:121)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:662)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:327)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.startGame(Minecraft.java:597)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.run(Minecraft.java:942)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.main.Main.main(Main.java:164)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:606)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at GradleStart.main(Unknown Source)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.IllegalArgumentException: wrong number of arguments

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:606)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.lsmod.CompactStorage.client.TextureAtlasDynamic.completeResourceLocation(TextureAtlasDynamic.java:110)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at com.lsmod.CompactStorage.client.TextureAtlasDynamic.load(TextureAtlasDynamic.java:52)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:125)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:98)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:172)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:143)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:121)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:662)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:327)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.startGame(Minecraft.java:597)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.Minecraft.run(Minecraft.java:942)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.client.main.Main.main(Main.java:164)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:606)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

[16:06:04] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at GradleStart.main(Unknown Source)

[16:06:04] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----

// Uh... Did I do that?

 

Time: 30/12/15 16.06

Description: Registering texture

 

java.lang.NullPointerException: Registering texture

at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:63)

at com.lsmod.CompactStorage.client.TextureAtlasDynamic.load(TextureAtlasDynamic.java:53)

at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:125)

at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:98)

at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89)

at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:172)

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:143)

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:121)

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:662)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:327)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:597)

at net.minecraft.client.Minecraft.run(Minecraft.java:942)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:63)

at com.lsmod.CompactStorage.client.TextureAtlasDynamic.load(TextureAtlasDynamic.java:53)

at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:125)

at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:98)

 

-- Resource location being registered --

Details:

Resource location: minecraft:textures/atlas/blocks.png

Texture object class: net.minecraft.client.renderer.texture.TextureMap

Stacktrace:

at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89)

at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:172)

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:143)

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:121)

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:662)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:327)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:597)

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.run(Minecraft.java:942)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.7.0_79, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 851862840 bytes (812 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UCHIJA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)

UCHIJA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)

UCHIJA Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)

UCHIJA CompactStorage{{@version}} [Compact Storage] (bin)

GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 359.06' Renderer: 'GeForce GTX 650/PCIe/SSE2'

Launched Version: 1.7.10

LWJGL: 2.9.1

OpenGL: GeForce GTX 650/PCIe/SSE2 GL version 4.5.0 NVIDIA 359.06, NVIDIA Corporation

GL Caps: Using GL 1.3 multitexturing.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Anisotropic filtering is supported and maximum anisotropy is 16.

Shaders are available because OpenGL 2.1 is supported.

 

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Anisotropic Filtering: Off (1)

[16:06:04] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\lmlor\Desktop\MODs\CS-Dev\eclipse\.\crash-reports\crash-2015-12-30_16.06.04-client.txt

AL lib: (EE) alc_cleanup: 1 device not closed

 

 

 

Block Class

package com.lsmod.CompactStorage.Blocks;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import com.lsmod.CompactStorage.client.TextureAtlasDynamic;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;

public class test2Block extends Block {

String name = "endOre";
// Indicates the number of metadata -> Number of blocks
int metadata = 8;

@SideOnly(Side.CLIENT)
private IIcon[] icons;

public test2Block() {

	super(Material.rock);
	setBlockName(name);
	setCreativeTab(CreativeTabs.tabBlock);
	setHardness(3F);
	setResistance(15F);
	setStepSound(soundTypeStone);
	setHarvestLevel("pickaxe", 2);
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
	icons = new IIcon[metadata];

	if (par1IconRegister instanceof TextureMap) {
		TextureMap map = (TextureMap) par1IconRegister;
		for (int i = 0; i < icons.length; i++) {
			String overlayName = "tier"+i;
			String baseName = "plank_oak";
			String regname = this.getUnlocalizedName()+"_"+i;
			map.setTextureEntry(regname, new TextureAtlasDynamic(regname, baseName, overlayName));
			icons[i] = map.getTextureExtry(regname);
			//icons[i] = par1IconRegister.registerIcon("CompactStorage" + ":" + "plank_oak" + i);
		}
	}
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2) {
	return icons[par2];
}

@SuppressWarnings({ "unchecked", "rawtypes" })
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
	for (int var4 = 0; var4 < metadata; ++var4) {
		par3List.add(new ItemStack(par1, 1, var4));
	}
}

}

ItemBlock Class

package com.lsmod.CompactStorage.Blocks;


import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;

public class test2Item extends ItemBlock {

public test2Item(Block block) {

	super(block);

}

@Override
public int getMetadata(int par1) {

	return par1;

}

@Override
public String getUnlocalizedName(ItemStack itemstack) {

	String name = "";

	switch (itemstack.getItemDamage()) {

	case 0:
		name = "tier0";
		break;
	case 1:
		name = "tier1";
		break;
	case 2:
		name = "tier2";
		break;
	case 3:
		name = "tier3";
		break;
	case 4:
		name = "tier4";
		break;
	case 5:
		name = "tier5";
		break;
	case 6:
		name = "tier6";
		break;
	case 7:
		name = "tier7";
		break;
	default:
		System.out.println("Invalid metadata for Block EndOre");
		name = "broken";
		break;

	}

	return getUnlocalizedName() + "." + name;
}

}

 

TextureAtlas

package com.lsmod.CompactStorage.client;

import java.awt.image.BufferedImage;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

import javax.imageio.ImageIO;

import com.lsmod.CompactStorage.CompactStorage;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;

public class TextureAtlasDynamic extends TextureAtlasSprite {

protected String textureBase;
protected String textureOverlay;

public TextureAtlasDynamic(String string, String base, String overlay) {
	super(string);
	textureBase = base;
	textureOverlay = overlay;
}

@Override
public void updateAnimation() {
	TextureUtil.uploadTextureMipmap((int[][]) this.framesTextureData.get(0), this.width, this.height, this.originX, this.originY, false, false);
}

@Override
public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) {
	return true;
}

@Override
public boolean load(IResourceManager manager, ResourceLocation location) {
	framesTextureData.clear();
	this.frameCounter = 0;
	this.tickCounter = 0;

	ResourceLocation resource1 = new ResourceLocation(textureBase);
	ResourceLocation resource2 = new ResourceLocation(textureOverlay);

	try {
        	TextureMap map = Minecraft.getMinecraft().getTextureMapBlocks();
        	resource1 = this.completeResourceLocation(map, resource1, 0);
        	resource2 = this.completeResourceLocation(map, resource2, 0);
		BufferedImage buff = ImageIO.read(manager.getResource(resource1).getInputStream());
		BufferedImage buff2 = ImageIO.read(manager.getResource(resource2).getInputStream());

        int[] rawBase = new int[buff.getWidth()*buff.getHeight()];
        int[] rawOverlay = new int[buff2.getWidth()*buff2.getHeight()];

        buff.getRGB(0, 0, buff.getWidth(), buff.getHeight(), rawBase, 0, buff.getWidth());
        buff2.getRGB(0, 0, buff2.getWidth(), buff2.getHeight(), rawOverlay, 0, buff2.getWidth());
        
        int min = Math.min(buff.getWidth(),buff2.getWidth());
        rawBase = scaleToSmaller(rawBase, buff.getWidth(), min);
        rawOverlay = scaleToSmaller(rawOverlay, buff2.getWidth(), min);

        width = min;
        height = min;
        
        int[][] aint = new int[1 + MathHelper.calculateLogBaseTwo(min)][];
        for (int k = 0; k < aint.length; ++k)
        {
        	aint[k] = rawBase;
        }

        this.framesTextureData.add(aint);
	} catch (IOException e) {
		e.printStackTrace();
		int[][] aint = new int[1][];
        for (int k = 0; k < 1; ++k)
        {
        	aint[k] = new int[16*16];
        	for(int l=0; l<aint[k].length;l++) {
        		aint[k][l] = 0xFFFFFFFF;
        	}
        }
        width = 16;
        height = 16;

        this.framesTextureData.add(aint);
	}
        return false;
}

private static int[] scaleToSmaller(int[] data, int width, int min) {
	if(width == min) { return data; }
	int scale = width / min;
	int[] output = new int[min*min];
	int j = 0;
	for(int i = 0; i < output.length; i++) {
		if(i%min == 0) {
			j += width;
		}
		output[i] = data[i*scale+j];
	}
	return output;
}

private static ResourceLocation completeResourceLocation(TextureMap map, ResourceLocation loc, int c) {
	try {
		return (ResourceLocation)CompactStorage.proxy.resourceLocation.invoke(map, c);
	} catch (IllegalAccessException e) {
		e.printStackTrace();
	} catch (IllegalArgumentException e) {
		e.printStackTrace();
	} catch (InvocationTargetException e) {
		e.printStackTrace();
	}
	return null;
}

}

 

I don't really know what to do, please be good with me, can you make me a simple example of a block using TextureAtlas?

Set the power inside a single block free! ;D

Posted

AFAICT something in the texture atlas load method is borked. This is an incredibly difficult error to solve, as the point at which the program discovers that there's a problem is long after our code has run, or deep in the call stack. I don't see the problem off hand.

 

I'll have to get you my block later, I'm not home.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

AFAICT something in the texture atlas load method is borked. This is an incredibly difficult error to solve, as the point at which the program discovers that there's a problem is long after our code has run, or deep in the call stack. I don't see the problem off hand.

 

I'll have to get you my block later, I'm not home.

Oh, thank you very much, you're doing a lot for me!  ;D

Set the power inside a single block free! ;D

Posted
Oh, thank you very much, you're doing a lot for me!  ;D

 

I think I'm the only one who has used the custom sprite loader, so I'm the only one that knows how it works, and even that knowledge is questionable. It is so much easier to just render the block twice and accept the crappy break particles.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Stacktrace:
   at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:63)
   at com.lsmod.CompactStorage.client.TextureAtlasDynamic.load(TextureAtlasDynamic.java:53)

The only thing that can be null on line 63 in

SimpleReloadableResourceManager

is the ResourceLocation parameter passed in. This corresponds to your

ResourceLocation

variable called

resource1

. This gets intialized with a call to

completeResourceLocation

. This means that that method returns

null

. In your crash log, it also mentions this:

[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.IllegalArgumentException: wrong number of arguments
[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:    at java.lang.reflect.Method.invoke(Method.java:606)
[16:06:03] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:    at com.lsmod.CompactStorage.client.TextureAtlasDynamic.completeResourceLocation(TextureAtlasDynamic.java:110)

Line 110 in

TextureAtlasDynamic

is that line in

completeResourceLocation

, which means you call

invoke

with the wrong number of arguments. Seems a bit weird to me...

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

That suggests that "plank_oak" is not the correct texture string.

 

The standard texture alas would throw one of those "texture not found: minecraft:plank_oak" messages, but in creating a custom loader, that error handling got lost. I'll take a look at the strings I pass. It might need to be "minecraft:plank_oak"

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Ok, so I poked around.  You are using it correctly, however, the texture name is not "plank_oak" its "planks_oak"

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Ok, so I poked around.  You are using it correctly, however, the texture name is not "plank_oak" its "planks_oak"

Ok, I corrected it to "planks oak" but that's not the thing that cause the crash, it should load without loading that texture, the problem is in TextureAtlas class

Set the power inside a single block free! ;D

Posted

Ok, so I poked around.  You are using it correctly, however, the texture name is not "plank_oak" its "planks_oak"

Ok, I corrected it to "planks oak" but that's not the thing that cause the crash, it should load without loading that texture, the problem is in TextureAtlas class

 

Unfortunately, whatever the problem is, the error handling is not there to tell us what's wrong.  You're going to have to do some stack trace digging and examining what it is crashes, why, where that value came from, and work backwards.

 

Took me weeks to figure a couple of errors out myself that way, having to do with the various data arrays for the mipmaps.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.