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
wants to merge 11 commits into
base: dev
from

Conversation

Projects
None yet
3 participants
@XuZhen86
Contributor

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 some commits Jan 21, 2018

Re-enable Checkstyle
Since there are better ways to solve the problem
Fix wrong ender pearl behaviors
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

This comment has been minimized.

Member

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.

@momothereal

This comment has been minimized.

Member

momothereal 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 added a commit that referenced this pull request Jan 29, 2018

mastercoms added a commit that referenced this pull request Jan 29, 2018

@mastercoms

This comment has been minimized.

Member

mastercoms commented Jan 29, 2018

Merged in 9c3fce2.

Thank you for your contribution to Glowstone!

@mastercoms mastercoms closed this Jan 29, 2018

@XuZhen86 XuZhen86 referenced this pull request Feb 17, 2018

Merged

Fine tune ender pearl #853

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment