Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.7.2] Custom Render Block Lighting Issues?


Recommended Posts

Hello Guys i found a glitchy thing over my custom render block .

 

in super flat the lighting is fine however when i got to the real overworld this strange thingy happens.

 

When i move on some sides the lightings gone like this.

 

 

8imMUcv.png

 

I followed the tutorial on how to rendering the model block but the lighting fix dint work

thou the getBlockBrightness was i think replaced i tried to change it into getMixedBrightness

 

anyways heres my render block code

package mhfc.net.client.render.block;

import org.lwjgl.opengl.GL11;

import mhfc.net.client.model.block.ModelArmorStandBase;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;

public class RenderArmorStandBase extends TileEntitySpecialRenderer {

private ModelArmorStandBase model;
private static final ResourceLocation texture = new ResourceLocation("mhfc:textures/tile/armorstandbase.png");

public RenderArmorStandBase() {
	model = new ModelArmorStandBase();
}

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(180F, 0F, 0F, 1F);
	bindTexture(texture);
	GL11.glPushMatrix();
	model.renderModel(0.0625F);
	GL11.glPopMatrix();
	GL11.glPopMatrix();
}

private void adjustLightFixture(World world, int i, int j, int k, Block block) {
        Tessellator tess = Tessellator.instance;
        float brightness = block.getMixedBrightnessForBlock(world, i, j, k);
        int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
        int modulousModifier = skyLight % 65536;
        int divModifier = skyLight / 65536;
        tess.setColorOpaque_F(brightness, brightness, brightness);
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,  (float) modulousModifier,  divModifier);
        }

}

Link to post
Share on other sites

Try this, based upon differences between your code, and the renderer for Minecraft chests.

 

public void renderTileEntityAt(TileEntity tileentity, double x, double y,double z, float f) {
GL11.glPushMatrix();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glTranslatef((float)x + 0.5F, (float)y - -1.5F, (float)z + 0.5F);
GL11.glRotatef(180F, 0F, 0F, 1F);
bindTexture(texture);
GL11.glPushMatrix();
model.renderModel(0.0625F);
GL11.glPopMatrix();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
}

 

It's most likely the normal code that is your issue.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Goals and Tasks are defined within the flyweight Entity itself whenever it is constructed. I would suggest taking a look at already implemented entities with goals and tasks if you want to implement them yourself.
    • Any mod present on the server (assuming it doesn't have the ignore extension point set) must be present on the client to allow both to connect.
    • Yes, you are passing in an Item instead of a supplier of an item. I would suggest taking another read over the docs.
    • Hi again, I'm trying to create a custom living entity but I keep running into this issue that causes a crash due to a ticking entity. Crash: [12:31:15] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception net.minecraft.crash.ReportedException: Ticking entity at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:855) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:787) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tickServer(IntegratedServer.java:78) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:642) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:232) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282] {} Caused by: java.lang.NullPointerException at net.minecraft.entity.LivingEntity.travel(LivingEntity.java:1905) ~[forge:?] {re:classloading} at net.minecraft.entity.LivingEntity.aiStep(LivingEntity.java:2449) ~[forge:?] {re:classloading} at net.minecraft.entity.MobEntity.aiStep(MobEntity.java:488) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.AgeableEntity.aiStep(AgeableEntity.java:115) ~[forge:?] {re:classloading} at net.minecraft.entity.passive.AnimalEntity.aiStep(AnimalEntity.java:51) ~[forge:?] {re:classloading} at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2158) ~[forge:?] {re:classloading} at net.minecraft.entity.MobEntity.tick(MobEntity.java:300) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.tickNonPassenger(ServerWorld.java:611) ~[forge:?] {re:classloading} at net.minecraft.world.World.guardEntityTick(World.java:554) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:404) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:851) ~[forge:?] {re:classloading,pl:accesstransformer:B} ... 5 more AL lib: (EE) alc_cleanup: 1 device not closed  It seems to be that I have not defined an ai/brain but I have no idea how to do this. I cant seem to see any event to do this in the library.  Any help would be greatly appreciated.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.