New option to disallow players from leaving, joining, or being kicked from a faction while they have a negative power level - code by sp1ky, adapted from a pull request
This commit is contained in:
@ -42,6 +42,11 @@ public class FCommandJoin extends FBaseCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Conf.CanLeaveWithNegativePower && me.getPower() < 0) {
|
||||
sendMessage("You cannot join a faction until your power is positive.");
|
||||
return;
|
||||
}
|
||||
|
||||
if( ! faction.getOpen() && ! faction.isInvited(me)) {
|
||||
sendMessage("This guild requires invitation.");
|
||||
faction.sendMessage(me.getNameAndRelevant(faction)+Conf.colorSystem+" tried to join your faction.");
|
||||
|
@ -46,6 +46,11 @@ public class FCommandKick extends FBaseCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Conf.CanLeaveWithNegativePower && you.getPower() < 0) {
|
||||
sendMessage("You cannot kick that member until their power is positive.");
|
||||
return;
|
||||
}
|
||||
|
||||
myFaction.deinvite(you);
|
||||
you.resetFactionData();
|
||||
|
||||
|
Reference in New Issue
Block a user