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.

Featured Replies

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

}

}

 

Your Renderers are justfine, although you don't need to do the push/pomatrix stuff between binding the texture and rendering the model. Also, have you registered the tileentity?

  • Author

I have registered the tile entity and I was working on it for a few hours and I got the hit box loading and nothing else

  • Author

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

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

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.