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

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

2017-05-25_14.41.46.png

Edited by Fifou_BE

  • Author

Up, don't know if It's allowed but can't find the rules :S Sorry If i'm doing something wrong :( 

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.

  • Author
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 :) 

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.