Fixed the spam issue with a real fix.
This commit is contained in:
parent
ee3c5446e2
commit
266c598b76
@ -8,6 +8,6 @@
|
||||
<version>1.6.9.5-U0.2.1-RC-1.5-BETA</version>
|
||||
<version>1.6.9.5-U0.2.1-RC-1.5-BETA-2</version>
|
||||
</versions>
|
||||
<lastUpdated>20181221181311</lastUpdated>
|
||||
<lastUpdated>20181221214408</lastUpdated>
|
||||
</versioning>
|
||||
</metadata>
|
||||
|
@ -1 +1 @@
|
||||
9bdc33366d81ebbb51cec5b2a0092585
|
||||
e9ce0bdae55853de86510ddacb671877
|
@ -1 +1 @@
|
||||
cdb7b8ec048405faa43f32d2daf226382f5952d2
|
||||
694467945b9eeace46a9acb0cfd0fddc9c87fad8
|
@ -508,10 +508,6 @@ public class SavageFactions extends MPlugin {
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
FPlayer fPlayer = FPlayers.getInstance().getByPlayer((Player) sender);
|
||||
if (!fPlayer.hasFaction()) {
|
||||
fPlayer.msg("Autocomplete is not available if you do not have a faction.");
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
List<String> completions = new ArrayList<>();
|
||||
String cmd = Conf.baseCommandAliases.isEmpty() ? "/f" : "/" + Conf.baseCommandAliases.get(0);
|
||||
List<String> argsList = new ArrayList<>(Arrays.asList(args));
|
||||
|
@ -24,6 +24,7 @@ public class CmdAdmin extends FCommand {
|
||||
this.permission = Permission.ADMIN.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -22,6 +22,7 @@ public class CmdBanner extends FCommand {
|
||||
this.permission = Permission.BANNER.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -19,6 +19,7 @@ public class CmdChat extends FCommand {
|
||||
this.permission = Permission.CHAT.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -19,6 +19,7 @@ public class CmdChest extends FCommand {
|
||||
this.permission = Permission.CHEST.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -24,6 +24,7 @@ public class CmdClaim extends FCommand {
|
||||
this.permission = Permission.CLAIM.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -17,6 +17,7 @@ public class CmdClaimAt extends FCommand {
|
||||
this.permission = Permission.CLAIMAT.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -25,6 +25,7 @@ public class CmdClaimLine extends FCommand {
|
||||
this.permission = Permission.CLAIM_LINE.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -23,6 +23,7 @@ public class CmdColeader extends FCommand {
|
||||
this.permission = Permission.COLEADER.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -15,6 +15,7 @@ public class CmdCoords extends FCommand {
|
||||
this.permission = Permission.COORD.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -24,6 +24,7 @@ public class CmdDeinvite extends FCommand {
|
||||
this.permission = Permission.DEINVITE.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
|
@ -17,6 +17,7 @@ public class CmdDelFWarp extends FCommand {
|
||||
this.senderMustBeModerator = true;
|
||||
this.senderMustBePlayer = true;
|
||||
this.permission = Permission.SETWARP.node;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ public class CmdDescription extends FCommand {
|
||||
this.permission = Permission.DESCRIPTION.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -29,6 +29,7 @@ public class CmdDisband extends FCommand {
|
||||
this.permission = Permission.DISBAND.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -23,6 +23,7 @@ public class CmdFWarp extends FCommand {
|
||||
this.optionalArgs.put("warpname", "warpname");
|
||||
this.optionalArgs.put("password", "password");
|
||||
|
||||
|
||||
this.permission = Permission.WARP.node;
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeModerator = false;
|
||||
|
@ -32,6 +32,7 @@ public class CmdFly extends FCommand {
|
||||
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
|
||||
this.permission = Permission.FLY.node;
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeModerator = false;
|
||||
|
@ -15,6 +15,7 @@ public class CmdFocus
|
||||
|
||||
permission = Permission.FOCUS.node;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
|
@ -17,6 +17,7 @@ public class CmdGetVault extends FCommand {
|
||||
this.permission = Permission.GETVAULT.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -30,6 +30,7 @@ public class CmdHome extends FCommand {
|
||||
this.permission = Permission.HOME.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -12,6 +12,7 @@ public class CmdInspect extends FCommand {
|
||||
this.permission = Permission.INSPECT.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -23,6 +23,7 @@ public class CmdInvite extends FCommand {
|
||||
this.permission = Permission.INVITE.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -18,6 +18,7 @@ public class CmdJoin extends FCommand {
|
||||
this.permission = Permission.JOIN.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -26,6 +26,7 @@ public class CmdKick extends FCommand {
|
||||
this.permission = Permission.KICK.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -15,6 +15,7 @@ public class CmdLeave extends FCommand {
|
||||
this.permission = Permission.LEAVE.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -31,6 +31,7 @@ public class CmdList extends FCommand {
|
||||
this.permission = Permission.LIST.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -22,6 +22,7 @@ public class CmdLock extends FCommand {
|
||||
this.permission = Permission.LOCK.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -12,6 +12,7 @@ public class CmdLogins extends FCommand {
|
||||
this.aliases.add("logout");
|
||||
this.aliases.add("logouts");
|
||||
this.senderMustBePlayer = true;
|
||||
|
||||
this.senderMustBeMember = true;
|
||||
this.permission = Permission.MONITOR_LOGINS.node;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ public class CmdLowPower extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
|
@ -19,6 +19,7 @@ public class CmdMap extends FCommand {
|
||||
this.permission = Permission.MAP.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -15,6 +15,7 @@ public class CmdMapHeight extends FCommand {
|
||||
|
||||
this.permission = Permission.MAPHEIGHT.node;
|
||||
|
||||
|
||||
this.senderMustBePlayer = true;
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ public class CmdMod extends FCommand {
|
||||
this.permission = Permission.MOD.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -35,6 +35,7 @@ public class CmdMoney extends FCommand {
|
||||
this.addSubCommand(this.cmdMoneyTransferFf);
|
||||
this.addSubCommand(this.cmdMoneyTransferFp);
|
||||
this.addSubCommand(this.cmdMoneyTransferPf);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ public class CmdMoneyBalance extends FCommand {
|
||||
this.permission = Permission.MONEY_BALANCE.node;
|
||||
this.setHelpShort(TL.COMMAND_MONEYBALANCE_SHORT.toString());
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -21,6 +21,7 @@ public class CmdMoneyDeposit extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_DEPOSIT.node;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -23,6 +23,7 @@ public class CmdMoneyTransferFf extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_F2F.node;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -22,6 +22,7 @@ public class CmdMoneyTransferFp extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_F2P.node;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -22,6 +22,7 @@ public class CmdMoneyTransferPf extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_P2F.node;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -22,6 +22,7 @@ public class CmdMoneyWithdraw extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_WITHDRAW.node;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -16,6 +16,7 @@ public class CmdNear extends FCommand {
|
||||
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -18,6 +18,7 @@ public class CmdOpen extends FCommand {
|
||||
this.permission = Permission.OPEN.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -18,6 +18,7 @@ public class CmdOwner extends FCommand {
|
||||
this.permission = Permission.OWNER.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -19,6 +19,7 @@ public class CmdOwnerList extends FCommand {
|
||||
this.permission = Permission.OWNERLIST.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
@ -17,6 +17,7 @@ public class CmdPaypalSee extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
|
@ -17,6 +17,7 @@ public class CmdPaypalSet extends FCommand {
|
||||
this.senderMustBeModerator = false;
|
||||
this.senderMustBeColeader = true;
|
||||
this.senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
|
@ -23,6 +23,7 @@ public class CmdPeaceful extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,6 +35,7 @@ public class CmdPerm extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -23,6 +23,7 @@ public class CmdPower extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -24,6 +24,7 @@ public class CmdRules extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,6 +27,7 @@ public class CmdSafeunclaimall extends FCommand {
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,6 +41,7 @@ public class CmdSeeChunk extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
|
||||
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true);
|
||||
interval = SavageFactions.plugin.getConfig().getLong("see-chunk.interval", 10L);
|
||||
if (effect == null) {
|
||||
|
@ -16,6 +16,7 @@ public class CmdSetBanner extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
|
@ -19,6 +19,7 @@ public class CmdSetDefaultRole extends FCommand {
|
||||
this.senderMustBePlayer = true;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
|
||||
this.permission = Permission.DEFAULTRANK.node;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ public class CmdSetFWarp extends FCommand {
|
||||
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeModerator = false;
|
||||
|
||||
this.senderMustBePlayer = true;
|
||||
|
||||
this.permission = Permission.SETWARP.node;
|
||||
|
@ -22,6 +22,7 @@ public class CmdSetMaxVaults extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,6 +26,7 @@ public class CmdSethome extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ public class CmdShowClaims extends FCommand {
|
||||
this.senderMustBePlayer = true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -34,7 +35,7 @@ public class CmdShowClaims extends FCommand {
|
||||
for (String world : chunkMap.keySet()) {
|
||||
String message = TL.COMMAND_SHOWCLAIMS_FORMAT.toString().replace("{world}", world);
|
||||
sendMessage(message.replace("{chunks}", "")); // made {chunks} blank as I removed the placeholder and people wont update their config :shrug:
|
||||
StringBuilder chunks = new StringBuilder("");
|
||||
StringBuilder chunks = new StringBuilder();
|
||||
for (String chunkString : chunkMap.get(world)) {
|
||||
chunks.append(chunkString + ", ");
|
||||
if (chunks.toString().length() >= 2000) {
|
||||
|
@ -17,6 +17,7 @@ public class CmdShowInvites extends FCommand {
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ public class CmdStatus extends FCommand {
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -29,7 +30,7 @@ public class CmdStatus extends FCommand {
|
||||
for (FPlayer fp : myFaction.getFPlayers()) {
|
||||
String humanized = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - fp.getLastLoginTime(), true, true) + TL.COMMAND_STATUS_AGOSUFFIX;
|
||||
String last = fp.isOnline() ? ChatColor.GREEN + TL.COMMAND_STATUS_ONLINE.toString() : (System.currentTimeMillis() - fp.getLastLoginTime() < 432000000 ? ChatColor.YELLOW + humanized : ChatColor.RED + humanized);
|
||||
String power = ChatColor.YELLOW + String.valueOf(fp.getPowerRounded()) + " / " + String.valueOf(fp.getPowerMaxRounded()) + ChatColor.RESET;
|
||||
String power = ChatColor.YELLOW + String.valueOf(fp.getPowerRounded()) + " / " + fp.getPowerMaxRounded() + ChatColor.RESET;
|
||||
ret.add(String.format(TL.COMMAND_STATUS_FORMAT.toString(), ChatColor.GOLD + fp.getRole().getPrefix() + fp.getName() + ChatColor.RESET, power, last).trim());
|
||||
}
|
||||
fme.sendMessage(ret);
|
||||
|
@ -17,6 +17,7 @@ public class CmdStealth extends FCommand {
|
||||
this.senderMustBeModerator = false;
|
||||
this.senderMustBeColeader = false;
|
||||
this.senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
|
@ -27,6 +27,7 @@ public class CmdStuck extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,6 +26,7 @@ public class CmdTag extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ public class CmdTitle extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,6 +27,7 @@ public class CmdTnt extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,6 +30,7 @@ public class CmdTntFill extends FCommand {
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ public class CmdToggleAllianceChat extends FCommand {
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,8 +30,10 @@ public class CmdTop extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
// Can sort by: money, members, online, allies, enemies, power, land.
|
||||
|
@ -21,6 +21,7 @@ public class CmdTpBanner extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ public class CmdUnban extends FCommand {
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ public class CmdUnclaim extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,6 +25,7 @@ public class CmdUnclaimall extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ public class CmdUpgrades extends FCommand {
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,6 +27,7 @@ public class CmdVault extends FCommand {
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,6 +25,7 @@ public class CmdWarunclaimall extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,6 +26,7 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
public boolean senderMustBeAdmin;
|
||||
public boolean senderMustBeColeader;
|
||||
|
||||
|
||||
public boolean isMoneyCommand;
|
||||
|
||||
public FCommand() {
|
||||
@ -98,22 +99,30 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
}
|
||||
|
||||
if (!fme.hasFaction()) {
|
||||
if (informSenderIfNot) {
|
||||
sender.sendMessage(p.txt.parse("<b>You are not member of any faction."));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.senderMustBeModerator && !fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
if (informSenderIfNot) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction moderators can %s.", this.getHelpShort()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.senderMustBeColeader && !fme.getRole().isAtLeast(Role.COLEADER)) {
|
||||
if (informSenderIfNot) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction coleaders can %s.", this.getHelpShort()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.senderMustBeAdmin && !fme.getRole().isAtLeast(Role.LEADER)) {
|
||||
if (informSenderIfNot) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction admins can %s.", this.getHelpShort()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.massivecraft.factions.zcore;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SavageFactions;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
@ -37,6 +38,7 @@ public abstract class MCommand<T extends MPlugin> {
|
||||
public CommandVisibility visibility;
|
||||
// Some information on permissions
|
||||
public boolean senderMustBePlayer;
|
||||
public boolean senderMustHaveFaction;
|
||||
public String permission;
|
||||
// Information available on execution of the command
|
||||
public CommandSender sender; // Will always be set
|
||||
@ -153,14 +155,16 @@ public abstract class MCommand<T extends MPlugin> {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public boolean validSenderType(CommandSender sender, boolean informSenderIfNot) {
|
||||
if (this.senderMustBePlayer && !(sender instanceof Player)) {
|
||||
if (informSenderIfNot) {
|
||||
msg(TL.GENERIC_PLAYERONLY);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
return true;
|
||||
return !this.senderMustHaveFaction || !FPlayers.getInstance().getByPlayer((Player) sender).hasFaction();
|
||||
}
|
||||
|
||||
public boolean validSenderPermissions(CommandSender sender, boolean informSenderIfNot) {
|
||||
|
Loading…
Reference in New Issue
Block a user