Jump to content

Recommended Posts

Posted

I'll try, but just for a better explanation...

 

Rotations for my entity are "smooth", they do not seem to get perfectly set exactly to the variable's value (renders are made into a consistent > 20 fps rotation). As a part of this, when the rotation variable I set goes from 359 to 0, the model rotates 359 degrees backwards instead of 1 in the right direction to get to 0(in a fraction of a second).

Posted

Shouldn't that be just a mathematical problem using the PartialTickTime and the update tick?

 

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

I'll try, but just for a better explanation...

 

Rotations for my entity are "smooth", they do not seem to get perfectly set exactly to the variable's value (renders are made into a consistent > 20 fps rotation). As a part of this, when the rotation variable I set goes from 359 to 0, the model rotates 359 degrees backwards instead of 1 in the right direction to get to 0(in a fraction of a second).

 

Can you post your code?  You're probably just not handling that case (of going past 360) properly.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

using:

 

if (ShipCSeat != null && ShipCSeat.riddenByEntity instanceof EntityPlayer) {

EntityPlayer player = (EntityPlayer) this.ShipCSeat.riddenByEntity;

this.setRotation(player.rotationYaw, 0);

}

 

in an onUpdate class that calls super. ShipCSeat is the entity that the player actually rides retrieved from server on server using UUID.

Posted

Shouldn't that be happening on the Entity class's onEntityUpdate that I call at the beginning of onUpdate with super.onUpdate();? Maybe that needs to be sent client side? Seemed to me like onUpdate wasn't being called on both sides...

Posted

I'm still not sure of your problem.  You're saying that if you change the rotation, that it will slowly go towards that rotation and in case where it is near 360 it will go the wrong way around?

 

I thought setting the rotation would immediately rotate it.  I'm not sure where it is doing the "smooth rotation" code.  But you need to find that because that is where it would have to handle the case of going past the full circle.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

Is your ship very wide/long? If so, I think you're talking about how the end of your ship is rotated very rigidly.

 

This is to be expected due to the fact that the farther away an object is from the center of rotation, the more space it will travel to fulfill the rotation.

Kain

  • 1 month later...
Posted

Haven't been modding in a while but went back in and just using my own variable seems to work fine. Still has the smooth/ lagginess but I think that is just the actual rotation of the player...

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.