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

Command: /back #7

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

Command: /back #7

wants to merge 11 commits into from

Conversation

YTG1234
Copy link
Contributor

@YTG1234 YTG1234 commented Dec 10, 2020

I could've stored it in memory, but that'd be too easy :tiny_potato:

(This PR conflicts with #2 , I will fix one of them when the other gets merged)

@spaceclouds42
Copy link

Noticed what I think is an oversight. In BackCommand.kt, you never call PlayerDataManager.setBackPos()

@YTG1234
Copy link
Contributor Author

YTG1234 commented Dec 15, 2020

Noticed what I think is an oversight. In BackCommand.kt, you never call PlayerDataManager.setBackPos()

what would I set the back pos to? null?

@spaceclouds42
Copy link

I set it to the player's current position right before teleporting the player, that way when you run /back and are teleported to your home, you can do /back again to get to where you originally ran /back, and then run /back again to get back to the home, and /back again, and so on and so forth. I added in
PlayerDataManager.setBackPos( player.uuid, Pos( x = player.x, y = player.y, z = player.z, world = player.world.registryKey.value, yaw = player.yaw, pitch = player.pitch ) )
on the line right before the teleport line (currently, that's line 56 on your branch)

@YTG1234
Copy link
Contributor Author

YTG1234 commented Dec 15, 2020

I set it to the player's current position right before teleporting the player, that way when you run /back and are teleported to your home, you can do /back again to get to where you originally ran /back, and then run /back again to get back to the home, and /back again, and so on and so forth. I added in
PlayerDataManager.setBackPos( player.uuid, Pos( x = player.x, y = player.y, z = player.z, world = player.world.registryKey.value, yaw = player.yaw, pitch = player.pitch ) )
on the line right before the teleport line (currently, that's line 56 on your branch)

Thank you for the suggestion, I'll add it in. Also, GitHub PR suggestions exist: suggestions

@spaceclouds42
Copy link

spaceclouds42 commented Dec 15, 2020

Also, GitHub PR suggestions exist

Lol, I'm very new to using git. Thought I'd have to put in my entire branch/fork in the PR. Thanks for the tip

I first wanted to use streams but then I realized there was already a map function.
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.

2 participants