Jump to content

Please help, Custom Rendered block giving error I cant fix 1.7.10 forge


Recommended Posts

Posted

So with open custom rendered blocks I decided to make a second one (A trophy) and for some reason in the render class for it, it is throwing a fit at this bit of code "this.model.renderModel(0.0625F);"

 

Working custom block no errors/Table/First Custom Rendered block

 

 

package com.northcraft.mod.renderer;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

import com.northcraft.mod.Northcraft;
import com.northcraft.mod.model.ModelTable;

public class RenderTable extends TileEntitySpecialRenderer{

private static final ResourceLocation texture = new ResourceLocation(Northcraft.modid + ":" + "textures/model/Table.png");

private ModelTable model;

public RenderTable() {
	this.model = new ModelTable();
}

@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();

}

}

 

 

 

 

 

Error Code/Second Custom Rendered Block/Trophy

 

 

package com.northcraft.mod.renderer;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

import com.northcraft.mod.Northcraft;
import com.northcraft.mod.model.ModelTable;
import com.northcraft.mod.model.ModelTrophy;

public class RenderTrophy extends TileEntitySpecialRenderer{

private static final ResourceLocation texture = new ResourceLocation(Northcraft.modid + ":" + "textures/model/Table.png");

private ModelTrophy model;

public RenderTrophy() {
	this.model = new ModelTrophy();
}

@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();

}

}

 

Posted

It is giving an error I can figure out for the life of me. Sorry that I am not really the best at explaining myself

 

Post the error (like shadowfacts told you to) and your model classes (like diesieben07 told you to).

 

It's hard to find a solution when we don't know what the problem is.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.