Totalytaco Posted June 21, 2014 Posted June 21, 2014 hi i tried making my first custo-rendered block following this guide i have been looking for help for a while now but i cant seem to find what the problem is i think the problem is in the proxys but i cant seem to figure it out crash-report http://pastebin.com/0JHkiQk1 commonproxy http://pastebin.com/je1sA1zU clientproxy http://pastebin.com/mcLaWEfk main mod class http://pastebin.com/76DtLh15 block renderer http://pastebin.com/ePgaVv31 tileentityCrate http://pastebin.com/nK1aNRvN model http://pastebin.com/PdLnBhef please help if anyone can find the problem Quote
Xcox123 Posted June 21, 2014 Posted June 21, 2014 at net.wowcraft.model.ModelCrate.<init>(ModelCrate.java:114) ~[ModelCrate.class:?] at net.wowcraft.renderer.RenderCrate.<init>(RenderCrate.java:19) ~[RenderCrate.class:?] at net.wowcraft.proxy.ClientProxy.registerRenderThings(ClientProxy.java:12) ~[ClientProxy.class:?] I need your renderer class. As seen here, the error is being caused at java:114 in your ModelCrate class, which is being called in your RenderCrate class at java:19, and again in ClientProxy at java:12. If you could please show those lines of code that would be extremeley helpful ^.^ ~Xcox123 Quote
Totalytaco Posted June 21, 2014 Author Posted June 21, 2014 i think the block renderer is what you ment or am i wrong? thanks for helping btw Quote
Xcox123 Posted June 21, 2014 Posted June 21, 2014 I think so? I need the class called RenderCrate Quote
Totalytaco Posted June 21, 2014 Author Posted June 21, 2014 oh and i'm sorry if i am confused i'm realy new to modding but could you specify a bit under what java,114 would mean and is this kine 114? thanks anyway Quote
Totalytaco Posted June 21, 2014 Author Posted June 21, 2014 package net.wowcraft.renderer; import org.lwjgl.opengl.GL11; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.wowcraft.mod.WowCraft; import net.wowcraft.model.ModelCrate; public class RenderCrate extends TileEntitySpecialRenderer{ private static final ResourceLocation texture = new ResourceLocation(WowCraft.modid + ":" + "textures/model/Crate.png"); private ModelCrate model; public RenderCrate(){ this.model = new ModelCrate(); } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y,double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } //this is that class Quote
Totalytaco Posted June 21, 2014 Author Posted June 21, 2014 oh and sorry for not using spoilers first time utilizing the forums Quote
Totalytaco Posted June 21, 2014 Author Posted June 21, 2014 I think so? I need the class called RenderCrate i hope that's the right class renderCrate thaks btw apreciate that youre trying to help Quote
Dragonisser Posted June 21, 2014 Posted June 21, 2014 I've this: ClientProxy RenderingRegistry.registerBlockHandler(RenderAltar.altarRenderId, new RenderAltar()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAltar.class, new RenderAltar()); And in the block.class (would be good if you show us that too ^^) @SideOnly(Side.CLIENT) public int getRenderType() { return RenderAltar.altarRenderId; } Quote
Totalytaco Posted June 21, 2014 Author Posted June 21, 2014 block class http://pastebin.com/Te6AXqAe Quote
TheGreyGhost Posted June 21, 2014 Posted June 21, 2014 Hi These links tell a bit more about debuggin Null Pointer Exceptions http://www.cs.man.ac.uk/~johns/npe.html http://www.terryanderson.ca/debugging/run.html In your case, the error message says java.lang.NullPointerException: Initializing game at net.wowcraft.model.ModelCrate.<init>(ModelCrate.java:114) So the symptom shows up at your ModelCrate constructor on line 114. You pasted a few extra lines into the crash class so the error is actually at line 109 crateedgesix.mirror = true; // line 114: oops - used before creation crateedgesix = new ModelRenderer(this, 95, 3); This a common problem with the code generated by Techne. -TGG Quote
Totalytaco Posted June 22, 2014 Author Posted June 22, 2014 so in that case crateedgefive.addBox(-1F, -1F, -1F, 1, 18, 2); is the line wich the error accures on? i still cant find a way to fix it (i'm really new to modding so please bare with me) Quote
TheGreyGhost Posted June 22, 2014 Posted June 22, 2014 so in that case crateedgefive.addBox(-1F, -1F, -1F, 1, 18, 2); is the line wich the error accures on? i still cant find a way to fix it (i'm really new to modding so please bare with me) No I think it is probably this one crateedgesix.mirror = true; // line 114: oops - used before creation crateedgesix = new ModelRenderer(this, 95, 3); -> you need to swap the order of these two lines. -TGG Quote
Recommended Posts
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.