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

Added a catch for if a player is caged and kicked. Resolves #1789 #2041

Merged
merged 4 commits into from
Jun 30, 2017

Conversation

Wild1145
Copy link
Member

Resolves #1789

@@ -1,6 +1,8 @@
package me.totalfreedom.totalfreedommod.command;

import me.totalfreedom.totalfreedommod.banning.Ban;
import me.totalfreedom.totalfreedommod.caging.CageData;
import me.totalfreedom.totalfreedommod.player.FPlayer;
Copy link
Member

Choose a reason for hiding this comment

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

I think you meant to put these in the other file..

Copy link
Member

Choose a reason for hiding this comment

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

These will need to be removed, methinks.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, thats where I changed implementation mid-way through. Let me fix that.

@@ -96,6 +97,18 @@ public void onPlayerQuit(PlayerQuitEvent event)
}

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerKick(PlayerKickEvent event)
Copy link
Member

Choose a reason for hiding this comment

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

Why ignoreCancelled? If the event is cancelled, why do you need to remove the cage?

Copy link
Member

@JeromSar JeromSar May 31, 2017

Choose a reason for hiding this comment

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

Wild's implementation is correct. If the kick event is cancelled, the player isn't kicked, so the cage data shouldn't be removed. ignoreCancelled causes the event handler to skip processing if the event is cancelled.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, never mind then. I was thinking the other way around.

@@ -1,6 +1,8 @@
package me.totalfreedom.totalfreedommod.command;

import me.totalfreedom.totalfreedommod.banning.Ban;
import me.totalfreedom.totalfreedommod.caging.CageData;
import me.totalfreedom.totalfreedommod.player.FPlayer;
Copy link
Member

Choose a reason for hiding this comment

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

These will need to be removed, methinks.

@Wild1145
Copy link
Member Author

@JeromSar Unused imports removed.

@JeromSar
Copy link
Member

JeromSar commented May 31, 2017

Thanks for contributing! Your PR will be merged soon.

@JeromSar JeromSar changed the base branch from tfm5.1-mc1.12 to devel June 2, 2017 13:26
@JeromSar JeromSar merged commit 98f0fdb into TotalFreedom:devel Jun 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants