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

Fixes #9

Merged
merged 1 commit into from
Oct 15, 2015
Merged

Fixes #9

merged 1 commit into from
Oct 15, 2015

Conversation

suirad
Copy link

@suirad suirad commented Oct 11, 2015

This fixes #5, #6, #8

I have tested all changes.

  • Spelling error corrected
  • PlayerMoveEvent will not process a null location
  • Respawning clears the old location, and the move event updates itself with the new location after respawn. This works after death, and also if the player is kicked while dead and respawns after a reconnect.

@CivcraftBot
Copy link

Can one of the admins verify this patch? Type 'ok to test' to test.

public void playerRespawnEvent(PlayerRespawnEvent e) {
Player p = e.getPlayer();
if (!TOSManager.isTermPlayer(p, "CivMenu Agreement")) {
locations.remove(p.getUniqueId());

Choose a reason for hiding this comment

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

This means if someone kills himself, he can walk around freely after he respawns (until he gets kicked). Instead a new location should be inserted here, to which the players is bound (the respawn location).

Copy link
Author

Choose a reason for hiding this comment

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

Lines 68-72 correct that issue, and makes sure it doesn't happen.

Choose a reason for hiding this comment

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

Ah yeah, it would be a bit clearer if it also readded it here, but overall it should work perfectly fine.

Copy link

Choose a reason for hiding this comment

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

I agree with Max it should be added here as well just to make the code more clear.

Copy link
Author

Choose a reason for hiding this comment

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

Readding the location here does not seem to work properly(i found that by copy-pasting your pull manually) by my tests, for some reason. When the location was readded, it kept putting me inside blocks and suffocating me.

Copy link

Choose a reason for hiding this comment

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

Did you test it with random spawn installed on the server?

Copy link
Author

Choose a reason for hiding this comment

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

No. It's not the spawning itself that puts me inside blocks, its the teleport from the move event that does it. I had this right after line 85:

locations.put(p.getUniqueId(), e.getRespawnLocation());

With that added, the teleport when going too far puts you inside the ground. I am not sure why...

@Maxopoly
Copy link

ok to test

@Maxopoly
Copy link

Can I even do that?

@suirad
Copy link
Author

suirad commented Oct 11, 2015

I already have #4 finished, should i just commit and pin it onto this pull or just wait until after this pull is merged so its separate?

@Maxopoly
Copy link

make a new branch, pull from civcraft's master into that branch, then do your changes and make a new pull request from that branch.

@suirad
Copy link
Author

suirad commented Oct 11, 2015

Sounds good.

@suirad
Copy link
Author

suirad commented Oct 15, 2015

This should be good to merge.

@ttk2
Copy link

ttk2 commented Oct 15, 2015

ok doing so.

ttk2 added a commit that referenced this pull request Oct 15, 2015
@ttk2 ttk2 merged commit 429fc63 into Civcraft:master Oct 15, 2015
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.

P0: Could not pass event PlayerMoveEvent to CivMenu v1.1.5 org.bukkit.event.EventException
5 participants