EngineHub / WorldEdit

🗺️ Minecraft map editor and mod
https://enginehub.org/worldedit/
Other
3.1k stars 867 forks source link

Rotate command: Support angle aliases "cw" and "ccw" #2640

Open mk-pmb opened 1 week ago

mk-pmb commented 1 week ago

The Problem

I always get confused about the angle direction for the //rotate command.

A Solution

Make aliases "cw" for clockwise and "ccw" for counterclockwise. In my quick experiment just now, cw = 90 and ccw = 270.

Alternatives

No response

Anything Else?

No response

wizjany commented 1 week ago

While I'm not super opposed to explicitly specifying direction here, it's important to note that clockwise and counterclockwise are indeed directions, not amounts. It doesn't make sense to alias clockwise to 90 because 45 degrees is also a valid amount of rotation, as is -315 degrees. And 90 (cw) and 270 (ccw) and -90 (ccw) and -270 (cw) are all equal. Also, the directions (and units, which is also relevant. One could also argue we should allow input in radians) are the standard for headings (such as on a compass) and are explained in the //help text for rotate.

mk-pmb commented 1 week ago

because 45 degrees is also a valid amount of rotation

Thanks for the reminder! I totally forgot WorldEdit can do this. Then it probably would be better to accept "cw" or "ccw" as a suffix to the angle number, e.g. //rotate 45ccw or (to same effect) //rotate -45cw. One suffix would be ignored and the other would negate the sign.

However, the 45° rotation of my jack-o-lanterns and trapdoors (unsurprisingly) falls behind a naive expectation. Rotations that are not a multiple of 90° are only partially supported due to game restrictions. Thus I think it's justified to assume "90" as the angle if "cw" or "ccw" is given without a number. (0 and 180 don't deserve cw/ccw aliases because that would be meaningless.)