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

Fix wrong ender pearl behaviors #822

Closed

Conversation

@XuZhen86
Copy link
Contributor

@XuZhen86 XuZhen86 commented Jan 23, 2018

This pull request tries to fix the bug of malfunctioning ender pearls.

Observed behavior:

  1. No damage caused by using ender pearl in gamemode 0
  2. Used ender pearls getting back to inventory
  3. Player located inside a block after been teleported
  4. Player’s orientation after teleporting resets to the orientation before teleporting

Expected behavior:

  1. Player receive 5 fall damage after teleport
  2. When player uses an ender pearl, the amount should decrease by one
  3. Player located above the block
  4. Player's instant orientation before teleporting should not be changed after teleporting

Solution:

  1. Add damage after teleport
  2. Add a wrapper method to decrease the ender pearl count if player is not in creative mode
  3. Plus 1 to Y value of location before teleporting
  4. Set pitch and yaw before teleporting

Another question: How can I pull request only on the current commit? For now, the commit history contains the previous fall damage fix. I tried to merge dev before commit but it didn't work.

XuZhen86 added 11 commits Jan 21, 2018
Since there are better ways to solve the problem
Including:
1. No damage caused by using ender pearl in gamemode 0
2. Used ender pearls getting back to inventory
3. Player located inside a block after been teleported
4. Player’s orientation after teleporting resets to the orientation before teleporting.
@mastercoms
Copy link
Member

@mastercoms mastercoms commented Jan 23, 2018

Hi, thanks for your PR, but we will have to wait until after #614 is merged before reviewing this one if the bugs are still present there.

@aramperes
Copy link
Member

@aramperes aramperes commented Jan 23, 2018

To answer your question about your previous PR's commits being there: it looks like you merged that old branch into your new branch, effectively "pushing" the commits ahead of the dev branch (thus moving the commits to after the ones who were pushed in the meantime).

Usually, to avoid problems like this, you would keep your fork's dev branch intact and regularly git-pull from the base repository (this one). When you want to start a new branch, you create it off the latest dev branch commit.

git checkout dev # make sure you're in the dev branch (has to be clean)
git remote add base https://github.com/GlowstoneMC/Glowstone.git
git pull base dev # update your local dev branch
git push origin dev # update your fork's dev branch, that way you can create branches on GitHub instead of command-line if you prefer
git checkout -b my_pr_branch # create the new branch off of dev
# ... add commits ...
git push -u origin my_pr_branch # push the new branch to your fork
# submit PR
@mastercoms
Copy link
Member

@mastercoms mastercoms commented Jan 29, 2018

Merged in 9c3fce2.

Thank you for your contribution to Glowstone!

@mastercoms mastercoms closed this Jan 29, 2018
@XuZhen86 XuZhen86 mentioned this pull request Feb 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants