Fifou_BE Posted May 26, 2017 Posted May 26, 2017 (edited) Hello, I've created a new model from Craft Studio and I added it to my mod but I having some problems with the render in the world, in the inventory the block look exactly like it would look but in the world when I place it it's way darker than it should be ? Do you know where it can come from ? Here is a picture of the problem and my code maybe could be useful package fr.fifou.economy.blocks.tileentity; import org.lwjgl.opengl.GL11; import fr.fifou.economy.ModEconomy; import fr.fifou.economy.blocks.models.modelAtm; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public class TileEntityEconomySpecialRenderer extends TileEntitySpecialRenderer { private static modelAtm modelBlock = new modelAtm(); public static ResourceLocation texture = new ResourceLocation(ModEconomy.MODID, "textures/blocks_models/atm.png"); public void renderTileEntityEconomyAt(TileEntityBlockAtm tileEntity, double posX, double posY, double posZ, float partialTicks, int damageCount) { //Open Matrix GlStateManager.pushMatrix(); //Place the block at X Y Z coordinates GlStateManager.translate(posX + 0.5F, posY + 1.5F, posZ + 0.5F); //Turn up side down the block GlStateManager.rotate(180F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(180F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(90F * tileEntity.getDirection(), 0.0F, 1.0F, 0.0F); //Draw the texture this.bindTexture(texture); //Doing the 3D render modelBlock.renderAll(); //We close Matrix GlStateManager.popMatrix(); } @Override public void renderTileEntityAt(TileEntity tileEntity, double posX, double posY, double posZ, float partialTicks, int damageCount) { this.renderTileEntityEconomyAt(((TileEntityBlockAtm) tileEntity), posX, posY, posZ, partialTicks, damageCount); } Thank you Edited May 27, 2017 by Fifou_BE Quote
Fifou_BE Posted May 27, 2017 Author Posted May 27, 2017 Up, don't know if It's allowed but can't find the rules Sorry If i'm doing something wrong Quote
Fifou_BE Posted May 27, 2017 Author Posted May 27, 2017 Because I always learned with TESR.. ^^ Quote
LRocket Posted May 27, 2017 Posted May 27, 2017 I had something similar happen before. what i did was before the rendering i added GlStateManager.disableLighting(); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 15 * 16, 15 * 16); in your case it will be before the "renderAll()" call. and after the call i enable lighting again using GlStateManager.enableLighting(); I'm not sure if you have to have both disable lighting and set the light map texture coords or just one of them, try it and see if it helps. 1 Quote
Fifou_BE Posted May 27, 2017 Author Posted May 27, 2017 4 minutes ago, LRocket said: I had something similar happen before. what i did was before the rendering i added GlStateManager.disableLighting(); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 15 * 16, 15 * 16); in your case it will be before the "renderAll()" call. and after the call i enable lighting again using GlStateManager.enableLighting(); I'm not sure if you have to have both disable lighting and set the light map texture coords or just one of them, try it and see if it helps. Yep It works perfectly Thank you Quote
Recommended Posts
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.