Jump to content

Recommended Posts

Posted

So I've got a

TileEntity

that contains an

ItemStack

. The TESR for the TE should render the item spinning and bobbing up and down in the block. I've run into a problem because my block isn't a normal 1m^3 block, but much smaller.

 

I've tried two approaches to rendering the item, neither of which has been completely successful.

 

My first approach was getting the

IBakedModel

for the stack using

RenderItem

and then also use

RenderItem

to render that model. This worked and stayed in the proper position while rotating/bobbing. However, the item was rendered completely dark and I wasn't able to find a fix (screenshot).

 

My second approach was to use

RenderItem

to get the

IBakedModel

for the stack and use

BlockModelRenderer

to render the model. This resulted in the item rendering properly lit, but the item was moving with the player (not in a 1:1 fashion, but something else).

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Posted

For your first idea: Have you tried using RenderHelper.enableStandardItemLighting()?

For your second idea: Do you apply a translation to the renderer to the te's position?

Posted

I think you should disable the standard lighting while rendering the item.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

In your second approach you are using a FastTESR which doesn't allow the use of GL. That's why the item isn't moving. For your first approach try what Abastro said.

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.