Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds <ViveCraftPlayerTag.rotation[head/left/right]> tag for Vivecraft #434

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

heypr
Copy link
Contributor

@heypr heypr commented Aug 27, 2024

Requested by Behr long ago in a voice call.

  • Adds the <ViveCraftPlayerTag.rotation[head/left/right]> tag with a QuaternionTag output.
  • Some minor cleanup of the position tag.

rotation = (float[]) object.getPlayer().getMetadata("righthand.rot").get(0).value();
break;
default:
attribute.echoError("Attribute must be 'head', 'left' or 'right'");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one nitpick - don't think Attribute is right here? can probably say input, input part, or format it like Invalid player part specified, must be 'head', 'left', or 'right'. or something like that

return null;
}
if (rotation == null) {
attribute.echoError("Location is not valid. Did a plugin overwrite the data?");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case it's rotation, not location

switch (input.toString()) {
case "head":
rotation = (float[]) object.getPlayer().getMetadata("head.rot").get(0).value();
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use the modern switch syntax here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants