More reformatting
This commit is contained in:
@@ -12,30 +12,23 @@ import org.bukkit.Bukkit;
|
||||
public class CmdKick extends FCommand {
|
||||
|
||||
public CmdKick() {
|
||||
super();
|
||||
this.aliases.add("kick");
|
||||
super(); this.aliases.add("kick");
|
||||
|
||||
this.requiredArgs.add("player name");
|
||||
//this.optionalArgs.put("", "");
|
||||
|
||||
this.permission = Permission.KICK.node;
|
||||
this.disableOnLock = false;
|
||||
this.permission = Permission.KICK.node; this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
senderMustBeAdmin = false;
|
||||
senderMustBePlayer = true; senderMustBeMember = false; senderMustBeModerator = true; senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
FPlayer you = this.argAsBestFPlayerMatch(0);
|
||||
if (you == null) { return; }
|
||||
FPlayer you = this.argAsBestFPlayerMatch(0); if (you == null) { return; }
|
||||
|
||||
if (fme == you) {
|
||||
msg("<b>You cannot kick yourself.");
|
||||
msg("<i>You might want to: %s", p.cmdBase.cmdLeave.getUseageTemplate(false));
|
||||
return;
|
||||
msg("<i>You might want to: %s", p.cmdBase.cmdLeave.getUseageTemplate(false)); return;
|
||||
}
|
||||
|
||||
Faction yourFaction = you.getFaction();
|
||||
@@ -43,19 +36,16 @@ public class CmdKick extends FCommand {
|
||||
// players with admin-level "disband" permission can bypass these requirements
|
||||
if (!Permission.KICK_ANY.has(sender)) {
|
||||
if (yourFaction != myFaction) {
|
||||
msg("%s<b> is not a member of %s", you.describeTo(fme, true), myFaction.describeTo(fme));
|
||||
return;
|
||||
msg("%s<b> is not a member of %s", you.describeTo(fme, true), myFaction.describeTo(fme)); return;
|
||||
}
|
||||
|
||||
if (you.getRole().value >= fme.getRole().value) {
|
||||
// TODO add more informative messages.
|
||||
msg("<b>Your rank is too low to kick this player.");
|
||||
return;
|
||||
msg("<b>Your rank is too low to kick this player."); return;
|
||||
}
|
||||
|
||||
if (!Conf.canLeaveWithNegativePower && you.getPower() < 0) {
|
||||
msg("<b>You cannot kick that member until their power is positive.");
|
||||
return;
|
||||
msg("<b>You cannot kick that member until their power is positive."); return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,8 +54,7 @@ public class CmdKick extends FCommand {
|
||||
|
||||
// trigger the leave event (cancellable) [reason:kicked]
|
||||
FPlayerLeaveEvent event = new FPlayerLeaveEvent(you, you.getFaction(), FPlayerLeaveEvent.PlayerLeaveReason.KICKED);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) { return; }
|
||||
Bukkit.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; }
|
||||
|
||||
// then make 'em pay (if applicable)
|
||||
if (!payForCommand(Conf.econCostKick, "to kick someone from the faction", "for kicking someone from the faction")) {
|
||||
@@ -84,8 +73,7 @@ public class CmdKick extends FCommand {
|
||||
|
||||
if (you.getRole() == Role.ADMIN) { yourFaction.promoteNewLeader(); }
|
||||
|
||||
yourFaction.deinvite(you);
|
||||
you.resetFactionData();
|
||||
yourFaction.deinvite(you); you.resetFactionData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user