-
Notifications
You must be signed in to change notification settings - Fork 222
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
Conversation
@@ -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; |
There was a problem hiding this comment.
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..
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
@JeromSar Unused imports removed. |
Thanks for contributing! Your PR will be merged soon. |
Resolves #1789