Jump to content

RenderItem unaffected by light level? [1.9]


CJCutrone9

Recommended Posts

I'm trying to render a sword model above a tile entity (it will be a dynamic item stack in the future, so hard coding the model in is not an option). I've looked at the item frame code, and older mods/tutorials, and I've gotten it to render the sword model, and I can even make out some features of the texture, but, it's an almost entirely black texture. My initial assumption is the light level, but having messed with the code and thousands of different options, I'm not so sure.

 

Here's my code for the current render:

 

@Override
public void renderTileEntityAt(TileEntitySwordStand te, double x, double y, double z, float partialTicks, int destroyStage) {
	GlStateManager.pushMatrix();
	GlStateManager.translate(x, y + 2, z);
                renderItem.renderItem(new ItemStack(Items.diamond_sword), ItemCameraTransforms.TransformType.FIXED);            
                GlStateManager.popMatrix();
}

 

Pretty self explanatory.

 

I've added in this line of code: (modified from the Enderman's eye layer)

 

            int i = 61680;
            int j = i % 65536;
            int k = i / 65536;
            OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);

 

Which makes the light level work, but now the texture has an opacity of about 50%. (A neat affect I'll keep in mind for the future, but not what I'm looking for).

 

And before anyone says "look at the item frame", I did. I looked at it, copied it, ate it, read it while using the bathroom, dissected it, resurrected it, rebuilt it, and updated my code to match, the result was a darkly rendered item. So, I'm not sure what's going on.

 

If anything else is needed, I'll provide it, nothing to hide with this mess. :P

Link to comment
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.
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...

×   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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.