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

Im working on an easier method to render tileentities so i have a generic renderer like this:

 

 

package itsamysterious.mods.reallifemod.core.rendering.tileEntitys;

 

import static org.lwjgl.opengl.GL11.GL_ALPHA_TEST;

import static org.lwjgl.opengl.GL11.GL_CULL_FACE;

import static org.lwjgl.opengl.GL11.glDisable;

import static org.lwjgl.opengl.GL11.glEnable;

import static org.lwjgl.opengl.GL11.glPopMatrix;

import static org.lwjgl.opengl.GL11.glPushMatrix;

import static org.lwjgl.opengl.GL11.glRotatef;

import static org.lwjgl.opengl.GL11.glTranslatef;

import itsamysterious.mods.reallifemod.client.forgeobjmodelported.AdvancedModelLoader;

import itsamysterious.mods.reallifemod.client.forgeobjmodelported.IModelCustom;

import itsamysterious.mods.reallifemod.core.tiles.RLMTileEntity;

import itsamysterious.mods.reallifemod.init.Reference;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.ResourceLocation;

 

public class GenericFurnitureRenderer extends TileEntitySpecialRenderer{

public static  Class<? extends RLMTileEntity> theClass;

private IModelCustom model;

private ResourceLocation texture;

 

public GenericFurnitureRenderer(Class<? extends RLMTileEntity> class1, String modelLoc, String textureLoc) {

theClass = class1;

texture = new ResourceLocation(Reference.ID+":textures/"+textureLoc);

model = AdvancedModelLoader.loadModel(new ResourceLocation(Reference.ID+":models/"+modelLoc));

}

 

@Override

public void renderTileEntityAt(TileEntity tile, double x,

double y, double z, float p_180535_8_, int p_180535_9_) {

if(tile.getClass().equals(theClass)){

RLMTileEntity theTile = (RLMTileEntity) tile;

{

glPushMatrix();

        glDisable(GL_CULL_FACE);

        glEnable(GL_ALPHA_TEST);

       

glTranslatef((float) x+0.5f, (float)y, (float) z+0.5f);

glRotatef(theTile.getBlockMetadata() * 90, 0.0F, 1.0F, 0.0F);

if(theTile.getBlockMetadata()*90==180||theTile.getBlockMetadata()*90==0){

glRotatef(180, 0.0F, 1.0F, 0.0F);

 

}

        bindTexture(texture);

        model.renderAll();

        glPopMatrix();

}

}

}

 

 

}

 

 

 

 

Can anybody tell me why it does not workj?

 

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.