Jump to content

custom rendered block causes crash upon starting the game (unsolved) 1.7.2


Totalytaco

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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;

}

 

 

 

 

 

 

Link to comment
Share on other sites

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

 

 

 

Link to comment
Share on other sites

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

 

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.

Announcements



×
×
  • Create New...

Important Information

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