Jump to content

Quaternion Constructor: No Such Method Exists


Jimmeh

Recommended Posts

Hey there, I'm trying to create a Quaternion like so:

Vector3f.YP.rotationDegrees(180.f)

This is happening server-side, on start up. It's throwing the error:

Caused by: java.lang.NoSuchMethodError: 'net.minecraft.util.math.vector.Quaternion net.minecraft.util.math.vector.Vector3f.func_229187_a_(float)'

Even though Quaternion has the constructor in question:

public Quaternion(Vector3f pVector, float pAngle, boolean pDegrees)

of which, 

Vector3f.YP.rotationDegrees(180.f)

uses.

 

So I'm quite confused as to why this might be happening. What I'm using this in is included both client and server-side, yet server-side is the only one throwing this error. By that, it led me to think Quaternions might only be client-side, but I'm unsure if that's correct. Thanks!

Link to comment
Share on other sites

3 hours ago, diesieben07 said:

It is rotationDegrees which is the problem. rotationDegress is annotated with @OnlyIn(Dist.CLIENT). This means it only exists in the client jar and you cannot use it from common code as it will crash on servers, because the method simply does not exist there.

Oh good catch. Thanks!

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.