Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Added hclip command #530

Merged
merged 3 commits into from
Mar 6, 2021
Merged

Conversation

sALTaccount
Copy link
Contributor

added an hclip command, it's similar to vclip but it teleports horizontally instead of vertically

@zeroeightysix
Copy link
Owner

It is far easier to not restrict hclip to the 4 cardinal directions, and use the player's yaw instead.

You can get a Vec3d of the player's facing direction quite easily using Vec3d.fromPolar:

val direction = Vec3d.fromPolar(0f, yaw)

using that, your entire when clause becomes:

updatePosition(
    x + direction.x * blocks,
    y,
    z + direction.z * blocks
)

@sALTaccount
Copy link
Contributor Author

fixed

@5HT2
Copy link
Contributor

5HT2 commented Feb 15, 2021

Wouldn't it be more useful to also have a vclip command?

@zeroeightysix
Copy link
Owner

Wouldn't it be more useful to also have a vclip command?

There is one. Consider looking before you comment. It would, however, be a good idea to merge the two into one command that does both.

@5HT2
Copy link
Contributor

5HT2 commented Feb 15, 2021

Wasn't aware of that, huh

@sALTaccount
Copy link
Contributor Author

I changed it to use a variable for distance. Also, I don't think vclip and hclip should be merged into a singular module. Most utility mods that have vclip and hclip have them as separate commands so I think that we should as well in order to maintain consistency.

Copy link
Owner

@zeroeightysix zeroeightysix left a comment

Choose a reason for hiding this comment

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

Thanks!

@zeroeightysix zeroeightysix merged commit 36f5ec8 into zeroeightysix:fabric Mar 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants