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

I'm creating a block and when the player is close or looks directly at my block the block has a shadowy overlay (it is meant to be completely white), this the code for my render:

@Override
    public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float scale) {
        Minecraft.getMinecraft().renderEngine.bindTexture(MainMod.RUNES.get(tileEntity.getBlockMetadata()).getTextureLocation());
        Tessellator tessellator = Tessellator.instance;
        GL11.glPushMatrix();
        GL11.glTranslated(x, y, z); // +1 so that our "drawing" appears 1 block over our block (to get a better view)
        tessellator.startDrawingQuads();

        tessellator.addVertexWithUV(0, 0.01, 1, 0, 0);
        tessellator.addVertexWithUV(1, 0.01, 1, 0, 1);
        tessellator.addVertexWithUV(1, 0.01, 0, 1, 1);
        tessellator.addVertexWithUV(0, 0.01, 0, 1, 0);

        tessellator.draw();
        GL11.glPopMatrix();
    }

 

My blocks source has the bounds of 0, 0, 0, 1, 0, 1

canRenderInPass is set to false,

shouldSideBeRendered is false,

isOpaqueCube is false

and renderAsNormalBlock is false

 

some screenshots:

With shadow:

3c29bf31ca.png

 

Without shadow:

c49e72407a.png

Well.  You didn't say what's wrong, my guess is that it's rendering ALL of the shading when ANY block is looked at (based on your screenshots, also you shouldn't have turned off the GUI, because that removed the reticule).

 

You're missing the code-bit that deals with the "looking" in your post (probably the TileEntity).  So I can't be sure.

 

But it looks like you've got something static that shouldn't be.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

I'm not doing anything when it comes to checking if it is being looked at (it's more when looking downwards it happens, my mistake, not so much when my block is looked at).

btw this is my tile entity code:

 

public int runeType; //This only decides what image is shown
    @Override
    public void writeToNBT(NBTTagCompound par1)
    {
        super.writeToNBT(par1);
        par1.setInteger("runeType", runeType);
    }

    @Override
    public void readFromNBT(NBTTagCompound par1)
    {
        super.readFromNBT(par1);
        this.runeType = par1.getInteger("runeType");
    }

 

Here is the images with the UI:

e2177c6d54.png

e7dab89c7d.png

Ok, now I know even LESS about your problem than I had before:

 

WTF are you trying to achieve that is not currently working?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Hmm reads title, looks at pictures obviously he doesn't want a shadowy overlay on his blocks

 

That might have been a bit rude, but the point still stands, I don't want the shadowy overlay

Before the calls to

Tessellator#addVertexWithUV()

, add

Tessellator#setColorOpaque_F(1, 1, 1)

.

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/

That might have been a bit rude, but the point still stands, I don't want the shadowy overlay

 

He starts that it does and the pictures show it, but he doesn't actually state that that is the problem and that he wants it to go away.

 

The OP was equivalent to,  "the sky is blue."

 

Yes, yes it is. And..?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

@Draco18s if you don't have anything useful to post please don't post also btw what didn't you get from

I'm creating a block and when the player is close or looks directly at my block the block has a shadowy overlay (it is meant to be completely white), this the code for my render:

 

@larsgerrits any other idea what might be causing it?

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.

 

Good day, sir.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

@Draco18s I wasn't saying you were a jerk just saying you were missing the obvious, also to post that after being corrected...

@OP

So yo clarify. Your white overlay which you currently have rendering all the time is changing to the grey/shadow colour when you look down and you would like to know how to stop it.

Is that correct?

I am the author of Draconic Evolution

Hi

 

When you tried Lars' suggestion, did you do

 

          tessellator.startDrawingQuads();

            tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);

 

or

            tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);

          tessellator.startDrawingQuads();

 

?  The first one is the correct one.

 

You could also try

 

      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glDisable(GL11.GL_LIGHTING);

all your rendering here

      GL11.glPopAttrib();

-TGG

 

Guest
This topic is now closed to further replies.

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.