Jump to content

[Unsolved] Error "Registering texture" Crash report


SackCastellon

Recommended Posts

Does somebody know why it crashes?

 

 

The crash report

 

2013-11-29 17:53:35 [iNFO] [sTDOUT] ---- Minecraft Crash Report ----
2013-11-29 17:53:35 [iNFO] [sTDOUT] // Hi. I'm Minecraft, and I'm a crashaholic.
2013-11-29 17:53:35 [iNFO] [sTDOUT] 
2013-11-29 17:53:35 [iNFO] [sTDOUT] Time: 29/11/13 17:53
2013-11-29 17:53:35 [iNFO] [sTDOUT] Description: Registering texture
2013-11-29 17:53:35 [iNFO] [sTDOUT] 
2013-11-29 17:53:35 [iNFO] [sTDOUT] java.lang.NullPointerException
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at SackCastellon.betterwood.items.MetaItemSoup.registerIcons(MetaItemSoup.java:98)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureMap.registerIcons(TextureMap.java:186)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:62)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:57)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:84)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:148)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:119)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:103)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:543)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:265)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.startGame(Minecraft.java:509)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.run(Minecraft.java:808)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.main.Main.main(Main.java:93)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 
2013-11-29 17:53:35 [iNFO] [sTDOUT] 
2013-11-29 17:53:35 [iNFO] [sTDOUT] A detailed walkthrough of the error, its code path and all known details is as follows:
2013-11-29 17:53:35 [iNFO] [sTDOUT] ---------------------------------------------------------------------------------------
2013-11-29 17:53:35 [iNFO] [sTDOUT] 
2013-11-29 17:53:35 [iNFO] [sTDOUT] -- Head --
2013-11-29 17:53:35 [iNFO] [sTDOUT] Stacktrace:
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at SackCastellon.betterwood.items.MetaItemSoup.registerIcons(MetaItemSoup.java:98)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureMap.registerIcons(TextureMap.java:186)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:62)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:57)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 
2013-11-29 17:53:35 [iNFO] [sTDOUT] -- Resource location being registered --
2013-11-29 17:53:35 [iNFO] [sTDOUT] Details:
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Resource location: minecraft:textures/atlas/items.png
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Texture object class: net.minecraft.client.renderer.texture.TextureMap
2013-11-29 17:53:35 [iNFO] [sTDOUT] Stacktrace:
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:84)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:148)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:119)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:103)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:543)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:265)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.startGame(Minecraft.java:509)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 
2013-11-29 17:53:35 [iNFO] [sTDOUT] -- Initialization --
2013-11-29 17:53:35 [iNFO] [sTDOUT] Details:
2013-11-29 17:53:35 [iNFO] [sTDOUT] Stacktrace:
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.run(Minecraft.java:808)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.client.main.Main.main(Main.java:93)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 
2013-11-29 17:53:35 [iNFO] [sTDOUT] -- System Details --
2013-11-29 17:53:35 [iNFO] [sTDOUT] Details:
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Minecraft Version: 1.6.4
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Operating System: Windows 7 (amd64) version 6.1
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Java Version: 1.7.0_25, Oracle Corporation
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Memory: 768823120 bytes (733 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Suspicious classes: FML and Forge are installed
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	FML: MCP v8.11 FML v6.4.45.953 Minecraft Forge 9.11.1.953 9 mods loaded, 9 mods active
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	FML{6.4.45.953} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Forge{9.11.1.953} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	SKC-Core{1.1.0.0} [sKC Core] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	SKC-BetterWood{1.1.0.0} [better Wood] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	SKC-CraftableHorseArmor{1.1.0.0} [Craftable Horse Armor] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	SKC-PixelArt{1.0.0.0} [Pixel Art] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	SKC-StainedSand{1.0.0.0} [stained Sand] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	SKC-StainedWood{1.0.0.0} [stained Wood] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Launched Version: 1.6
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	LWJGL: 2.9.0
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	OpenGL: Intel(R) HD Graphics GL version 2.1.0 - Build 8.15.10.2827, Intel
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Is Modded: Definitely; Client brand changed to 'fml,forge'
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Type: Client (map_client.txt)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Resource Pack: Default
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Current Language: English (US)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Profiler Position: N/A (disabled)
2013-11-29 17:53:35 [iNFO] [sTDOUT] 	Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
2013-11-29 17:53:35 [iNFO] [sTDOUT] #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Juanjo hijo\AppData\Roaming\.modding\forge-1.6.4-9.11.1.953-src\forge\mcp\jars\.\crash-reports\crash-2013-11-29_17.53.35-client.txt

 

 

 

And this is the Item's Class

 

package SackCastellon.betterwood.items;

import java.util.List;

import SackCastellon.betterwood.library.loader.ItemLoader;
import SackCastellon.betterwood.library.loader.NameLoader;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class MetaItemSoup extends ItemFood {

private String TexturePath = ItemLoader.TexturePath;

private Item ReturnItem;

private String LoreMaterial;

private String[] ItemLore;
private String[] TextureNames;

@SideOnly(Side.CLIENT)
private Icon[] Texture;

public MetaItemSoup(int par1,Item par2) {
	super(par1, 6, 0.6F, false);
/*
    	this.LoreMaterial = par2[1];
	this.TextureNames = par3;
	this.ItemLore = par4;
*/		
	this.ReturnItem = par2;

        this.setHasSubtypes(true);
        this.setMaxDamage(0);
    }

    public String getMaterial(ItemStack par1)
    {
        int k = MathHelper.clamp_int(par1.getItemDamage(), 0, ItemLore.length - 1);
        return ItemLore[k];
    }
    
    public Item setItemNames (String[][] par1)
    {
    	this.LoreMaterial = par1[0][1];
	this.TextureNames = par1[1];
	this.ItemLore = par1[2];
	return this;
    }
    
@Override
public void addInformation(ItemStack par1, EntityPlayer par2, List par3, boolean par4){
	NBTTagCompound nbt = par1.getTagCompound(); 
	{
		par3.add(this.LoreMaterial + ": " + this.getMaterial(par1));
	}
}

    public String getUnlocalizedName(ItemStack par1ItemStack)
    {
        int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, TextureNames.length - 1);
        return super.getUnlocalizedName() + "." + TextureNames[i];
    }

    public Icon getIconFromDamage(int par1)
    {
        int i = MathHelper.clamp_int(par1, 0, TextureNames.length - 1);
        return this.Texture[i];
    }

    public void getSubItems(int par1, CreativeTabs par2, List par3)
    {
    	for (int meta = 0; meta < this.TextureNames.length; ++meta) {
        	par3.add(new ItemStack(par1, 1, meta));
    	}
    }

@Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister par1IconRegister)
    {
        this.Texture = new Icon[4];

        for (int i = 0; i < 4; ++i)
        {
            this.Texture[i] = par1IconRegister.registerIcon(TexturePath + this.getUnlocalizedName().substring(5).toLowerCase() + "/" + (TextureNames[i].startsWith("EBXL") ? "ebxl/" : "vanilla/") + (TextureNames[i].startsWith("EBXL") ? TextureNames[i].substring(5) : TextureNames[i]));
        }
    }

public ItemStack onEaten(ItemStack par1, World par2, EntityPlayer par3)
{
	return new ItemStack(ReturnItem, 1, par1.getItemDamage());
}
}

 

I hope someone can help me.

 

Thanks.

Link to comment
Share on other sites

Hi

 

Busti means

This line: java.lang.NullPointerException

at SackCastellon.betterwood.items.MetaItemSoup.registerIcons(MetaItemSoup.java:98)

tells you that you are giving a null variable to something which doesn't expect it.

A null variable usually means you have forgotten to initialise it (it is empty).

 

I suggest you should check your .texturePath, .texture and textureNames again, I think Busti is right.

 

Do you know how to use the debugger?  If so I'd suggest putting a breakpoint at MetaItemSoup.java:98 and inspecting textureNames etc to make sure it matches what you expect.

 

If not, you could add the following code instead

        for (int i = 0; i < 4; ++i)
        {
            System.out.println("TextureNames[" + i + "]  = " + TextureNames[i]);
                 // similarly for TexturePath
            this.Texture[i] = par1IconRegister.registerIcon(TexturePath + this.getUnlocalizedName().substring(5).toLowerCase() + "/" + (TextureNames[i].startsWith("EBXL") ? "ebxl/" : "vanilla/") + (TextureNames[i].startsWith("EBXL") ? TextureNames[i].substring(5) : TextureNames[i]));
        }

One thing I notice about your code too - the convention in Java is to use camelCase for instances of your classes.

so for example

 

class MyTestClass {

// -- -etc

};

 

MyTestClass myTestClassInstance = new MyTestClass();

 

instead of

 

MyTestClass MyTestClassInstance = new MyTestClass();

 

-TGG

Link to comment
Share on other sites

MyTestClass myTestClassInstance = new MyTestClass();

 

instead of

 

MyTestClass MyTestClassInstance = new MyTestClass();

 

At least he didn't do Block MyBlock = new MyBlock() like someone else did here a while back.  They couldn't understand why MyBlock.nonStaticVar would throw an error.

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.

Link to comment
Share on other sites

Hi

 

Busti means

This line: java.lang.NullPointerException

at SackCastellon.betterwood.items.MetaItemSoup.registerIcons(MetaItemSoup.java:98)

tells you that you are giving a null variable to something which doesn't expect it.

A null variable usually means you have forgotten to initialise it (it is empty).

 

I suggest you should check your .texturePath, .texture and textureNames again, I think Busti is right.

 

Do you know how to use the debugger?  If so I'd suggest putting a breakpoint at MetaItemSoup.java:98 and inspecting textureNames etc to make sure it matches what you expect.

 

If not, you could add the following code instead

        for (int i = 0; i < 4; ++i)
        {
            System.out.println("TextureNames[" + i + "]  = " + TextureNames[i]);
                 // similarly for TexturePath
            this.Texture[i] = par1IconRegister.registerIcon(TexturePath + this.getUnlocalizedName().substring(5).toLowerCase() + "/" + (TextureNames[i].startsWith("EBXL") ? "ebxl/" : "vanilla/") + (TextureNames[i].startsWith("EBXL") ? TextureNames[i].substring(5) : TextureNames[i]));
        }

 

I added this to the class:

@Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister par1IconRegister)
    {
        this.Texture = new Icon[4];

        for (int i = 0; i < 4; ++i)
        {
        	LogHelper.info("TexturePath = " + this.TexturePath);
        	LogHelper.info("TextureNames[0] = " + TextureNames[0]);
        	LogHelper.info("TextureNames[1] = " + TextureNames[1]);
        	LogHelper.info("TextureNames[2] = " + TextureNames[2]);
        	LogHelper.info("TextureNames[3] = " + TextureNames[3]);
        	
            this.Texture[i] = par1IconRegister.registerIcon(TexturePath + this.getUnlocalizedName().substring(5).toLowerCase() + "/" + (TextureNames[i].startsWith("EBXL") ? "ebxl/" : "vanilla/") + (TextureNames[i].startsWith("EBXL") ? TextureNames[i].substring(5) : TextureNames[i]));
        }
    }

 

 

And the crash report says:

2013-11-30 17:37:18 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Better Wood, FMLFileResourcePack:SKC Core, FMLFileResourcePack:Craftable Horse Armor, FMLFileResourcePack:Pixel Art, FMLFileResourcePack:Stained Sand, FMLFileResourcePack:Stained Wood
2013-11-30 17:37:18 [iNFO] [sKC-BetterWood] TexturePath = betterwood:
2013-11-30 17:37:18 [iNFO] [sTDOUT] ---- Minecraft Crash Report ----
2013-11-30 17:37:18 [iNFO] [sTDOUT] // Daisy, daisy...
2013-11-30 17:37:18 [iNFO] [sTDOUT] 
2013-11-30 17:37:18 [iNFO] [sTDOUT] Time: 30/11/13 17:37
2013-11-30 17:37:18 [iNFO] [sTDOUT] Description: Registering texture

 

So, i'm assuming the problem is on TextureNames[]. Am i right?

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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