I have followed a tutorial on how to add a model for your block, but I think some of the code is for ModLoader. So I have been trying to convert it to Forge. I can make it so that no errors appear, but I get a NullPointerException. Please help me figure out how to solve this.Here is a link to the tutorial: http://www.minecraft...it-with-techne/Here is the code I was trying to change:
package mods.T.common;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
@Mod(modid = "SelectedLime375_Pillars", name = "Pillars MOD", version = "0.0.1")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class mod_Pillars {
public static Block MyPillar;
int MyPillarID = 188;
public static Item MyHat;
int MyHatID = 189;
public static int modelID;
@Init
public void load(FMLInitializationEvent event){
MyPillar = new BlockMyPillar(MyPillarID, 0, TileEntityPillar.class).setUnlocalizedName("tileMyPillar");
MyHat = new ItemMyHat(MyHatID, MyPillar).setUnlocalizedName("tileMyHat");
gameRegisters();
languageRegisters();
TileEntityRenderer.instance.renderTileEntityAt(new TileEntityPillar(), 0.0D, 0.0D, 0.0D, 0.0F);
MinecraftForgeClient.registerItemRenderer(mod_Pillars.MyPillar.blockID, new
ItemMyHatRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillar.class,
specialRenderer);
MinecraftForgeClient.registerItemRenderer(mod_Pillars.MyPillar.blockID, new
ItemMyHatRenderer());
}
private static void gameRegisters(){
}
private static void languageRegisters(){
}
public void renderInvBlock(RenderBlocks var1, Block var2, int var3, int var4){
if (var2 == MyPillar)
{
TileEntityRenderer.instance.renderTileEntityAt(new TileEntityPillar(), 0.0D, 0.0D, 0.0D, 0.0F);
}
}
}
Here is the Minecraft crash screen:
Minecraft has crashed! ---------------------- Minecraft has stopped running because it encountered a problem; Failed to start gameA full error report has been saved to E:\Modding\Modding\jars\.\crash-reports\crash-2013-04-10_21.04.34-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash --- BEGIN ERROR REPORT 8b796024 --------Full report at:E:\Modding\Modding\jars\.\crash-reports\crash-2013-04-10_21.04.34-client.txtPlease show that file to Mojang, NOT just this screen!Generated 4/10/13 9:04 PM-- System Details --Details: Minecraft Version: 1.5 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_17, Oracle Corporation Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 882607888 bytes (841 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v7.42 FML v5.0.24.582 Minecraft Forge 7.7.0.582 8 mods loaded, 8 mods active mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Ben10 [Ben10 Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_GemstoneMod [Gemstone Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Pillars [Pillars MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_The_TRANSFORMERS [The TRANSFORMERS MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Tutorial [Tutorial] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available LWJGL: 2.4.2 OpenGL: Mobile Intel® 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2302, Intel Is Modded: Definitely; Client brand changed to 'forge,fml' Type: Client (map_client.txt) Texture Pack: Default Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: nulljava.lang.NullPointerException at net.minecraft.item.ItemBlock.func_94901_k(ItemBlock.java:38) at net.minecraft.client.renderer.texture.TextureMap.func_94247_b(TextureMap.java:79) at net.minecraft.client.renderer.RenderEngine.func_94152_c(RenderEngine.java:520) at net.minecraft.client.renderer.RenderEngine.refreshTextures(RenderEngine.java:432) at cpw.mods.fml.client.FMLClientHandler.onInitializationComplete(FMLClientHandler.java:247) at net.minecraft.client.Minecraft.startGame(Minecraft.java:474) at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) at net.minecraft.client.Minecraft.run(Minecraft.java:728) at java.lang.Thread.run(Unknown Source)--- END ERROR REPORT f3168c8f ----------
Here is the Crash Report .txt file:
---- Minecraft Crash Report ----// Why did you do that?Time: 4/10/13 9:04 PMDescription: Failed to start gamejava.lang.NullPointerException at net.minecraft.item.ItemBlock.func_94901_k(ItemBlock.java:38) at net.minecraft.client.renderer.texture.TextureMap.func_94247_b(TextureMap.java:79) at net.minecraft.client.renderer.RenderEngine.func_94152_c(RenderEngine.java:520) at net.minecraft.client.renderer.RenderEngine.refreshTextures(RenderEngine.java:432) at cpw.mods.fml.client.FMLClientHandler.onInitializationComplete(FMLClientHandler.java:247) at net.minecraft.client.Minecraft.startGame(Minecraft.java:474) at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) at net.minecraft.client.Minecraft.run(Minecraft.java:728) at java.lang.Thread.run(Unknown Source)A detailed walkthrough of the error, its code path and all known details is as follows:----------------------------------------------------------------------------------------- System Details --Details: Minecraft Version: 1.5 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_17, Oracle Corporation Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 882607888 bytes (841 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v7.42 FML v5.0.24.582 Minecraft Forge 7.7.0.582 8 mods loaded, 8 mods active mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Ben10 [Ben10 Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_GemstoneMod [Gemstone Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Pillars [Pillars MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_The_TRANSFORMERS [The TRANSFORMERS MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Tutorial [Tutorial] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available LWJGL: 2.4.2 OpenGL: Mobile Intel® 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2302, Intel Is Modded: Definitely; Client brand changed to 'forge,fml' Type: Client (map_client.txt) Texture Pack: Default Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
The names of the block and item are the only things I have changed beside getting rid of the code for multiple blocks.
I have followed a tutorial on how to add a model for your block, but I think some of the code is for ModLoader. So I have been trying to convert it to Forge. I can make it so that no errors appear, but I get a NullPointerException. Please help me figure out how to solve this.
Minecraft has stopped running because it encountered a problem; Failed to start game
A full error report has been saved to E:\Modding\Modding\jars\.\crash-reports\crash-2013-04-10_21.04.34-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash
--- BEGIN ERROR REPORT 8b796024 --------
Full report at:
E:\Modding\Modding\jars\.\crash-reports\crash-2013-04-10_21.04.34-client.txt
Please show that file to Mojang, NOT just this screen!
Generated 4/10/13 9:04 PM
-- System Details --
Details:
Minecraft Version: 1.5
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_17, Oracle Corporation
Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 882607888 bytes (841 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.42 FML v5.0.24.582 Minecraft Forge 7.7.0.582 8 mods loaded, 8 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_Ben10 [Ben10 Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_GemstoneMod [Gemstone Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_Pillars [Pillars MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_The_TRANSFORMERS [The TRANSFORMERS MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_Tutorial [Tutorial] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
LWJGL: 2.4.2
OpenGL: Mobile Intel® 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2302, Intel
Is Modded: Definitely; Client brand changed to 'forge,fml'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
java.lang.NullPointerException
at net.minecraft.item.ItemBlock.func_94901_k(ItemBlock.java:38)
at net.minecraft.client.renderer.texture.TextureMap.func_94247_b(TextureMap.java:79)
at net.minecraft.client.renderer.RenderEngine.func_94152_c(RenderEngine.java:520)
at net.minecraft.client.renderer.RenderEngine.refreshTextures(RenderEngine.java:432)
at cpw.mods.fml.client.FMLClientHandler.onInitializationComplete(FMLClientHandler.java:247)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:474)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:728)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT f3168c8f ----------
Here is the Crash Report .txt file:
---- Minecraft Crash Report ----
// Why did you do that?
Time: 4/10/13 9:04 PM
Description: Failed to start game
java.lang.NullPointerException
at net.minecraft.item.ItemBlock.func_94901_k(ItemBlock.java:38)
at net.minecraft.client.renderer.texture.TextureMap.func_94247_b(TextureMap.java:79)
at net.minecraft.client.renderer.RenderEngine.func_94152_c(RenderEngine.java:520)
at net.minecraft.client.renderer.RenderEngine.refreshTextures(RenderEngine.java:432)
at cpw.mods.fml.client.FMLClientHandler.onInitializationComplete(FMLClientHandler.java:247)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:474)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:728)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.5
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_17, Oracle Corporation
Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 882607888 bytes (841 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.42 FML v5.0.24.582 Minecraft Forge 7.7.0.582 8 mods loaded, 8 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_Ben10 [Ben10 Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_GemstoneMod [Gemstone Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_Pillars [Pillars MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_The_TRANSFORMERS [The TRANSFORMERS MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
SelectedLime375_Tutorial [Tutorial] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
LWJGL: 2.4.2
OpenGL: Mobile Intel® 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2302, Intel
Is Modded: Definitely; Client brand changed to 'forge,fml'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
The names of the block and item are the only things I have changed beside getting rid of the code for multiple blocks.
Quit mixing API's. Either use the Forge side or use the ModLoader side. If you're making this in the fashion you have it now, with your main mod file being designated by Forge, use forge methods. This means that you'll have to make a class extends TileEntitySpecialRenderer and then register that renderer with forge's ClientRegistry. The method is
public static void bindTileEntitySpecialRenderer(Class<? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer);
You have to call this method in your load method at the very least.
Your class that implements TileEntitySpecialRenderer will be forced to implement a renderTileEntityAt() method. This is where you should place the general Render code.
To change the Rendering within the inventory, create a class that Implements IItemRenderer. This will force you to implement the three methods.
For handleRenderType() and shouldUseRenderHelper(), you should be able to simply just return true. For the renderItem() method, call the
I thought the API mixing was the problem. I code in Forge, but the tutorial was for ModLoader. I had tried converting the code myself and ran into this.
So I changed the code (I put the updated code in the main post), but I still have a question:
Do I need to put anything in this piece of code or do I just copy and paste it into my code?
public static void bindTileEntitySpecialRenderer(Class<? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer);
I thought the API mixing was the problem. I code in Forge, but the tutorial was for ModLoader. I had tried converting the code myself and ran into this.
So I changed the code (I put the updated code in the main post), but I still have a question:
Do I need to put anything in this piece of code or do I just copy and paste it into my code?
public static void bindTileEntitySpecialRenderer(Class<? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer);
public static void bindTileEntitySpecialRenderer(Class<? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer);
Just shows the parameter definition of what you need to pass. You need to call it like
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillar.class, new ClassThatExtendsTileEntitySpecialRenderer);
Don't put the TileEntityRenderer.instance.renderTileEntityAt() method in the load method. You have to put it in the IItemRenderer for the Pillar.
i fixed that clientRegistry error: ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillar.class, new TileEntityPillarRenderer());
but iam still getting this:
java.lang.NullPointerException
at net.minecraft.item.ItemBlock.getSpriteNumber(ItemBlock.java:42)
at net.minecraft.client.renderer.texture.TextureMap.refreshTextures(TextureMap.java:83)
at net.minecraft.client.renderer.RenderEngine.refreshTextureMaps(RenderEngine.java:520)
at net.minecraft.client.renderer.RenderEngine.refreshTextures(RenderEngine.java:432)
at cpw.mods.fml.client.FMLClientHandler.onInitializationComplete(FMLClientHandler.java:247)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:475)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:729)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT 55d3ea9c ----------
i fixed that clientRegistry error: ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPillar.class, new TileEntityPillarRenderer());
but iam still getting this:
java.lang.NullPointerException
at net.minecraft.item.ItemBlock.getSpriteNumber(ItemBlock.java:42)
at net.minecraft.client.renderer.texture.TextureMap.refreshTextures(TextureMap.java:83)
at net.minecraft.client.renderer.RenderEngine.refreshTextureMaps(RenderEngine.java:520)
at net.minecraft.client.renderer.RenderEngine.refreshTextures(RenderEngine.java:432)
at cpw.mods.fml.client.FMLClientHandler.onInitializationComplete(FMLClientHandler.java:247)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:475)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:729)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT 55d3ea9c ----------
Weird. I followed all of the instructions, and my code worked for the first fifteen times, but suddenly it stopped, and I got the exact same error report.
Minecraft has crashed! ---------------------- Minecraft has stopped running because it encountered a problem; Failed to start gameA full error report has been saved to E:\Modding\Modding\jars\.\crash-reports\crash-2013-04-10_21.04.34-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash --- BEGIN ERROR REPORT 8b796024 --------Full report at:E:\Modding\Modding\jars\.\crash-reports\crash-2013-04-10_21.04.34-client.txtPlease show that file to Mojang, NOT just this screen!Generated 4/10/13 9:04 PM-- System Details --Details: Minecraft Version: 1.5 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_17, Oracle Corporation Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 882607888 bytes (841 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v7.42 FML v5.0.24.582 Minecraft Forge 7.7.0.582 8 mods loaded, 8 mods active mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Ben10 [Ben10 Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_GemstoneMod [Gemstone Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Pillars [Pillars MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_The_TRANSFORMERS [The TRANSFORMERS MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Tutorial [Tutorial] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available LWJGL: 2.4.2 OpenGL: Mobile Intel® 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2302, Intel Is Modded: Definitely; Client brand changed to 'forge,fml' Type: Client (map_client.txt) Texture Pack: Default Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: nulljava.lang.NullPointerException at net.minecraft.item.ItemBlock.func_94901_k(ItemBlock.java:38) at net.minecraft.client.renderer.texture.TextureMap.func_94247_b(TextureMap.java:79) at net.minecraft.client.renderer.RenderEngine.func_94152_c(RenderEngine.java:520) at net.minecraft.client.renderer.RenderEngine.refreshTextures(RenderEngine.java:432) at cpw.mods.fml.client.FMLClientHandler.onInitializationComplete(FMLClientHandler.java:247) at net.minecraft.client.Minecraft.startGame(Minecraft.java:474) at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) at net.minecraft.client.Minecraft.run(Minecraft.java:728) at java.lang.Thread.run(Unknown Source)--- END ERROR REPORT f3168c8f ----------
---- Minecraft Crash Report ----// Why did you do that?Time: 4/10/13 9:04 PMDescription: Failed to start gamejava.lang.NullPointerException at net.minecraft.item.ItemBlock.func_94901_k(ItemBlock.java:38) at net.minecraft.client.renderer.texture.TextureMap.func_94247_b(TextureMap.java:79) at net.minecraft.client.renderer.RenderEngine.func_94152_c(RenderEngine.java:520) at net.minecraft.client.renderer.RenderEngine.refreshTextures(RenderEngine.java:432) at cpw.mods.fml.client.FMLClientHandler.onInitializationComplete(FMLClientHandler.java:247) at net.minecraft.client.Minecraft.startGame(Minecraft.java:474) at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) at net.minecraft.client.Minecraft.run(Minecraft.java:728) at java.lang.Thread.run(Unknown Source)A detailed walkthrough of the error, its code path and all known details is as follows:----------------------------------------------------------------------------------------- System Details --Details: Minecraft Version: 1.5 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_17, Oracle Corporation Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 882607888 bytes (841 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v7.42 FML v5.0.24.582 Minecraft Forge 7.7.0.582 8 mods loaded, 8 mods active mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Ben10 [Ben10 Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_GemstoneMod [Gemstone Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Pillars [Pillars MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_The_TRANSFORMERS [The TRANSFORMERS MOD] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available SelectedLime375_Tutorial [Tutorial] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available LWJGL: 2.4.2 OpenGL: Mobile Intel® 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2302, Intel Is Modded: Definitely; Client brand changed to 'forge,fml' Type: Client (map_client.txt) Texture Pack: Default Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
Here are the other files if they will be of help:
BlockMyPillar
package mods.T.common;
import java.util.List;
import java.util.Random;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class BlockMyPillar extends BlockContainer{
public BlockMyPillar(int par1, int par2, Class class1){
super(par1, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int quantityDropped(Random par1Random){
return 1;
}
public int getRenderType(){
return mod_Pillars.modelID;
}
public boolean isOpaqueCube() {
return false;
}
public boolean renderAsNormalBlock() {
return false;
}
/**
* Determines the damage on the item the block drops. Used in cloth and wood.
*/
public int damageDropped(int par1){
return par1;
}
public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer){
int p = MathHelper.floor_double((double)((par5EntityPlayer.rotationYaw * 4F) / 360F) + 0.5D) & 3;
byte byte0 = 3;
if (p == 0)
{
byte0 = 4;
}
if (p == 1)
{
byte0 = 3;
}
if (p == 2)
{
byte0 = 2;
}
if (p == 3)
{
byte0 = 1;
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, byte0, p);
return true;
}
public TileEntity getBlockEntity() {
return new TileEntityPillar();
}
public TileEntity createNewTileEntity(World var1){
return new TileEntityPillar();
}
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List){
par3List.add(new ItemStack(par1, 1, 1));
}
}
package mods.T.common;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelT extends ModelBase {
ModelRenderer Shape1;
public ModelT(){
textureWidth = 16;
textureHeight = 16;
Shape1 = new ModelRenderer(this, 0, 0);
Shape1.addBox(0F, 0F, 0F, 16, 16, 16);
Shape1.setRotationPoint(-8F, 8F, -8F);//* Back+/Forward-, Down+/Up-, Left+/Right- //
Shape1.setTextureSize(0, 0);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);//* Right+/Left-, Forward+/Back-, Up+/Down-//
}
public void rener(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
Shape1.render(f5);
}
public void renderModel(float f5){
Shape1.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z){
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity){
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}
package mods.T.common;
import net.minecraft.tileentity.TileEntity;
public class TileEntityPillar extends TileEntity{
public TileEntityPillar()
{
}
}
TileEntityPillarRenderer
package mods.T.common;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import java.util.Random;
public class TileEntityPillarRenderer extends TileEntitySpecialRenderer{
private ModelT model;
public TileEntityPillarRenderer(){
model = new ModelT();
}
public void renderAModelAt(TileEntityPillar tile, double d, double d1, double d2, float f){
int i =0;
if(tile.worldObj != null){
i =(tile.worldObj.getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord));
}
switch (i){
case 0:
bindTextureByName("/subaraki/pillar.png");
break;
default:
bindTextureByName("/subaraki/pillar.png");
}
GL11.glPushMatrix();
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
GL11.glRotatef(0, 0.0F, 1.0F, 0.0F);
GL11.glScalef(1.0F, -1F, -1F);
model.renderModel(0.0625F);
GL11.glPopMatrix();
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f){
renderAModelAt((TileEntityPillar) tileentity, d, d1, d2, f);
}
}
package mods.T.common;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemMyHat extends ItemBlock{
public ItemMyHat(int par1, Block block){
super(par1);
setHasSubtypes(true);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public String getItemNameIS(ItemStack itemstack){
String name = "";
switch(itemstack.getItemDamage()){
case 0:{
name = "BrickPillar";
break;
}
default: name = "WoodPillar";
}
return itemstack.getItem().getStatName() + "." + name;
}
public int getMetadata(int par1){
return par1;
}
}
package mods.T.common;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
public class ItemMyHatRenderer implements IItemRenderer {
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
}
}
Quit mixing API's. Either use the Forge side or use the ModLoader side. If you're making this in the fashion you have it now, with your main mod file being designated by Forge, use forge methods. This means that you'll have to make a class extends TileEntitySpecialRenderer and then register that renderer with forge's ClientRegistry. The method is
You have to call this method in your load method at the very least.
Your class that implements TileEntitySpecialRenderer will be forced to implement a renderTileEntityAt() method. This is where you should place the general Render code.
To change the Rendering within the inventory, create a class that Implements IItemRenderer. This will force you to implement the three methods.
For handleRenderType() and shouldUseRenderHelper(), you should be able to simply just return true. For the renderItem() method, call the
method.
Then to apply this Item render, call
So I changed the code (I put the updated code in the main post), but I still have a question:
Do I need to put anything in this piece of code or do I just copy and paste it into my code?
public static void bindTileEntitySpecialRenderer(Class<? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer);
public static void bindTileEntitySpecialRenderer(Class<? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer);
Just shows the parameter definition of what you need to pass. You need to call it like
Don't put the TileEntityRenderer.instance.renderTileEntityAt() method in the load method. You have to put it in the IItemRenderer for the Pillar.
On "bindTileEntitySpecialRenderer" the error is: "void is an invalid type for the variable bindTileEntitySpecialRenderer"
On "TileEntityPillarRenderer" the error is: "TileEntityPillarRenderer cannot be resolved to a variable"
I changed some of the code based on what Forge said.
I have uploaded the new code.
I still get an error on
Get rid of that
and I now I get an error on
on specialRenderer. The error says, "specialRenderer cannot be resolved to a variable"
but iam still getting this:
java.lang.NullPointerException
at net.minecraft.item.ItemBlock.getSpriteNumber(ItemBlock.java:42)
at net.minecraft.client.renderer.texture.TextureMap.refreshTextures(TextureMap.java:83)
at net.minecraft.client.renderer.RenderEngine.refreshTextureMaps(RenderEngine.java:520)
at net.minecraft.client.renderer.RenderEngine.refreshTextures(RenderEngine.java:432)
at cpw.mods.fml.client.FMLClientHandler.onInitializationComplete(FMLClientHandler.java:247)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:475)
at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
at net.minecraft.client.Minecraft.run(Minecraft.java:729)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT 55d3ea9c ----------
I tried what you did and I get the same crash.
Weird. I followed all of the instructions, and my code worked for the first fifteen times, but suddenly it stopped, and I got the exact same error report.
The Rules
The Rules