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

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.