Jump to content

[1.16.5] TER render error (all blocks in the world have the same TER)


Luis_ST

Recommended Posts

I'm currently working on an industrial mod which should add some useful machines.
Among other things, I added a milestone which has a TER,
which turns the milewheel when it processes a recipe

which works perfectly even if there is only one milestone in the world
if i place a second one and only one has an active recipe, both milewheels turn

now my question, how do I prevent this?
this is my TER

Edited by Luis_ST
Link to comment
Share on other sites

  • Luis_ST changed the title to [1.16.5] TER render error (all blocks in the world have the same TER)
7 minutes ago, diesieben07 said:

There is only one instance of your TESR. However your TESR has internal state, which is then shared between all rendering of course. Where is this internal state?

so what i have to change? because I've tried to save the rotation speed in the TE (but it didn't work).

Link to comment
Share on other sites

36 minutes ago, diesieben07 said:

You have to store the rotation speed as well as the rotation value itself in the TE. You also need to do the rotation animation in the tile entity's tick method so that the animation speed is actually consistent no matter what the FPS is.

okay, but how should I render the TESR from the tick method of my TE, since rendering is the task of the TESR.

36 minutes ago, diesieben07 said:

To make the animation not 20 FPS then you have to not just store the rotation value but also remember the rotation value from last tick. Then in your TESR use MathHelper.lerp(partialTicks, previousValue, currentValue) to get the rotation you need to render at.

I try to create this using the BellTileEntity and BellTileEntityRenderer because, as far as I know, this is the only TE/TESR that has an animation

Edited by Luis_ST
Link to comment
Share on other sites

3 hours ago, diesieben07 said:

ou have to store the rotation speed as well as the rotation value itself in the TE. You also need to do the rotation animation in the tile entity's tick method so that the animation speed is actually consistent no matter what the FPS is. To make the animation not 20 FPS then you have to not just store the rotation value but also remember the rotation value from last tick. Then in your TESR use MathHelper.lerp(partialTicks, previousValue, currentValue) to get the rotation you need to render at.

done, but all TE's still have the same TEST, the only thing that has changed is that the animation has become smoother
this is now the TE  and this the TESR

Edited by Luis_ST
Link to comment
Share on other sites

1 hour ago, diesieben07 said:

This is in your model. There is only one instance of this model. You cannot use it to keep track of the rotation, otherwise all your blocks share the same rotation value. You need to keep track of the rotation in your tile entity and animate (modify based on the speed every tick) it there. Then in your TESR you need to lerp between the rotation value (from the TE!) and its previous tick value. Then set yRot to that value.

okay thanks, i have to adjust the speed again, but the rotation works

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.