Jump to content

Recommended Posts

Posted

I have been using Universal Electricity to create an axle network to be able to use for things such as gates. I've been working on making the axles visually spin. The rotation of the axle is decided in updateEntity() off of the current rotation and the current RPS (revolutions per second). This seems to be working fine when I run debug in updateEntity(), but when I debug in the axle's renderer, it always shows rotation as 0.

 

Does anyone have any idea what might be wrong or how to fix it. I'm kinda blanking on this one. Below is the code for TileEntityAxle, which is what all axles extend and contains that code, and the renderer for the wooden axle.

 

 

  Reveal hidden contents

 

 

 

  Reveal hidden contents

 

Posted

What value does rotate get at this line during debugg?

        float rotation = tile.getRotation();

 

Also all the renderAt methods ask for the TE as input, where do you call this from? During debug, what is the value for rotation inn the passed inn TE?

 

 

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted
  On 5/14/2013 at 12:28 PM, Mazetar said:

What value does rotate get at this line during debugg?

        float rotation = tile.getRotation();

 

Also all the renderAt methods ask for the TE as input, where do you call this from? During debug, what is the value for rotation inn the passed inn TE?

 

float rotation = tile.getRotation() always comes out to 0. I have checked at the actual tile entity in debug though and it seems to be calculating it fine.

 

I don't know where the tile entity is being passed for the renderAt method. I guess I always assumed it was fine since the visually connected part always works fine. I'm going to run a quick check to see if the tile entity being passed in the renderer is the tile entity for the axle.

 

I believe if I check the id of the tile entity it should match the id of the one in the renderer. I'll post back in just a second.

 

Update - The id's do not match, one is 63 the other is 109. This could be because I'm casting it though, I'm not sure.

 

Also, thank you for the help.

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.