Posted July 7, 201510 yr 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?
July 7, 201510 yr What do you mean with 'doesn't work'? Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
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.