Posted April 9, 20223 yr 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!
April 10, 20223 yr Author 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!
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.