Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted

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

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

  • Author

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

  • Author

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

  • Author

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

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;

}

 

 

 

 

 

 

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

 

 

 

  • Author

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)

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

 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.