Posted June 16, 20169 yr 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
June 16, 20169 yr 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?
June 16, 20169 yr Author 1. Yes, no effect. 2. Did you look at the code? Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
June 16, 20169 yr check out https://github.com/p455w0rd/p455w0rds1.9Things/blob/master/src/java/p455w0rd/p455w0rdsthings/client/render/TESRCompressor.java#L145-L182 ..it doesn't "bob", but that would be simple enough to implement. http://p455w0rd.net/images/forumsignature.png[/img]
June 17, 20169 yr 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.
June 17, 20169 yr 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.
June 17, 20169 yr Author Abastro's solution worked. That's a confusing method name :V Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
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.