Fixed the spam issue with a real fix.
This commit is contained in:
@@ -24,7 +24,8 @@ public class CmdAdmin extends FCommand {
|
||||
this.permission = Permission.ADMIN.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -22,7 +22,8 @@ public class CmdBanner extends FCommand {
|
||||
this.permission = Permission.BANNER.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
|
||||
@@ -19,6 +19,7 @@ public class CmdChat extends FCommand {
|
||||
this.permission = Permission.CHAT.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
|
||||
@@ -19,7 +19,8 @@ public class CmdChest extends FCommand {
|
||||
this.permission = Permission.CHEST.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -24,7 +24,8 @@ public class CmdClaim extends FCommand {
|
||||
this.permission = Permission.CLAIM.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -17,7 +17,8 @@ public class CmdClaimAt extends FCommand {
|
||||
this.permission = Permission.CLAIMAT.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -25,7 +25,8 @@ public class CmdClaimLine extends FCommand {
|
||||
this.permission = Permission.CLAIM_LINE.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -23,7 +23,8 @@ public class CmdColeader extends FCommand {
|
||||
this.permission = Permission.COLEADER.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = true;
|
||||
|
||||
@@ -15,7 +15,8 @@ public class CmdCoords extends FCommand {
|
||||
this.permission = Permission.COORD.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -24,7 +24,8 @@ public class CmdDeinvite extends FCommand {
|
||||
this.permission = Permission.DEINVITE.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = true;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -17,6 +17,7 @@ public class CmdDelFWarp extends FCommand {
|
||||
this.senderMustBeModerator = true;
|
||||
this.senderMustBePlayer = true;
|
||||
this.permission = Permission.SETWARP.node;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,8 @@ public class CmdDescription extends FCommand {
|
||||
this.permission = Permission.DESCRIPTION.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
|
||||
@@ -1,88 +1,89 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SavageFactions;
|
||||
import com.massivecraft.factions.event.FactionDisbandEvent.PlayerDisbandReason;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class CmdDisband extends FCommand {
|
||||
|
||||
|
||||
private static HashMap<String, String> disbandMap = new HashMap<>();
|
||||
|
||||
|
||||
public CmdDisband() {
|
||||
super();
|
||||
this.aliases.add("disband");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("faction tag", "yours");
|
||||
|
||||
this.permission = Permission.DISBAND.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
// The faction, default to your own.. but null if console sender.
|
||||
Faction faction = this.argAsFaction(0, fme == null ? null : myFaction);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
Access access = faction.getAccess(fme, PermissableAction.DISBAND);
|
||||
if (fme.getRole() != Role.LEADER && access != Access.ALLOW) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband " + faction.getTag());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!faction.isNormal()) {
|
||||
msg(TL.COMMAND_DISBAND_IMMUTABLE.toString());
|
||||
return;
|
||||
}
|
||||
if (faction.isPermanent()) {
|
||||
msg(TL.COMMAND_DISBAND_MARKEDPERMANENT.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// check for tnt before disbanding.
|
||||
|
||||
if (!disbandMap.containsKey(me.getUniqueId().toString()) && faction.getTnt() > 0) {
|
||||
msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + ""));
|
||||
disbandMap.put(me.getUniqueId().toString(), faction.getId());
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
disbandMap.remove(me.getUniqueId().toString());
|
||||
}
|
||||
}, 200L);
|
||||
} else {
|
||||
//Check if the faction we asked confirmation for is the one being disbanded.
|
||||
if (faction.getId().equals(disbandMap.get(me.getUniqueId().toString())) || faction.getTnt() == 0) {
|
||||
faction.disband(me, PlayerDisbandReason.COMMAND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_DISBAND_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.SavageFactions;
|
||||
import com.massivecraft.factions.event.FactionDisbandEvent.PlayerDisbandReason;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class CmdDisband extends FCommand {
|
||||
|
||||
|
||||
private static HashMap<String, String> disbandMap = new HashMap<>();
|
||||
|
||||
|
||||
public CmdDisband() {
|
||||
super();
|
||||
this.aliases.add("disband");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("faction tag", "yours");
|
||||
|
||||
this.permission = Permission.DISBAND.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
// The faction, default to your own.. but null if console sender.
|
||||
Faction faction = this.argAsFaction(0, fme == null ? null : myFaction);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
Access access = faction.getAccess(fme, PermissableAction.DISBAND);
|
||||
if (fme.getRole() != Role.LEADER && access != Access.ALLOW) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband " + faction.getTag());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!faction.isNormal()) {
|
||||
msg(TL.COMMAND_DISBAND_IMMUTABLE.toString());
|
||||
return;
|
||||
}
|
||||
if (faction.isPermanent()) {
|
||||
msg(TL.COMMAND_DISBAND_MARKEDPERMANENT.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// check for tnt before disbanding.
|
||||
|
||||
if (!disbandMap.containsKey(me.getUniqueId().toString()) && faction.getTnt() > 0) {
|
||||
msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + ""));
|
||||
disbandMap.put(me.getUniqueId().toString(), faction.getId());
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
disbandMap.remove(me.getUniqueId().toString());
|
||||
}
|
||||
}, 200L);
|
||||
} else {
|
||||
//Check if the faction we asked confirmation for is the one being disbanded.
|
||||
if (faction.getId().equals(disbandMap.get(me.getUniqueId().toString())) || faction.getTnt() == 0) {
|
||||
faction.disband(me, PlayerDisbandReason.COMMAND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_DISBAND_DESCRIPTION;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ public class CmdFWarp extends FCommand {
|
||||
this.optionalArgs.put("warpname", "warpname");
|
||||
this.optionalArgs.put("password", "password");
|
||||
|
||||
this.permission = Permission.WARP.node;
|
||||
|
||||
this.permission = Permission.WARP.node;
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeModerator = false;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ public class CmdFly extends FCommand {
|
||||
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
this.permission = Permission.FLY.node;
|
||||
|
||||
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,7 +17,8 @@ public class CmdGetVault extends FCommand {
|
||||
this.permission = Permission.GETVAULT.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -30,7 +30,8 @@ public class CmdHome extends FCommand {
|
||||
this.permission = Permission.HOME.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -12,7 +12,8 @@ public class CmdInspect extends FCommand {
|
||||
this.permission = Permission.INSPECT.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -23,7 +23,8 @@ public class CmdInvite extends FCommand {
|
||||
this.permission = Permission.INVITE.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -18,7 +18,8 @@ public class CmdJoin extends FCommand {
|
||||
this.permission = Permission.JOIN.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -26,7 +26,8 @@ public class CmdKick extends FCommand {
|
||||
this.permission = Permission.KICK.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -15,7 +15,8 @@ public class CmdLeave extends FCommand {
|
||||
this.permission = Permission.LEAVE.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -31,7 +31,8 @@ public class CmdList extends FCommand {
|
||||
this.permission = Permission.LIST.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -1,43 +1,44 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdLock extends FCommand {
|
||||
|
||||
// TODO: This solution needs refactoring.
|
||||
/*
|
||||
factions.lock:
|
||||
description: use the /f lock [on/off] command to temporarily lock the data files from being overwritten
|
||||
default: op
|
||||
*/
|
||||
|
||||
public CmdLock() {
|
||||
super();
|
||||
this.aliases.add("lock");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
this.permission = Permission.LOCK.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
p.setLocked(this.argAsBool(0, !p.getLocked()));
|
||||
msg(p.getLocked() ? TL.COMMAND_LOCK_LOCKED : TL.COMMAND_LOCK_UNLOCKED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_LOCK_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdLock extends FCommand {
|
||||
|
||||
// TODO: This solution needs refactoring.
|
||||
/*
|
||||
factions.lock:
|
||||
description: use the /f lock [on/off] command to temporarily lock the data files from being overwritten
|
||||
default: op
|
||||
*/
|
||||
|
||||
public CmdLock() {
|
||||
super();
|
||||
this.aliases.add("lock");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("on/off", "flip");
|
||||
|
||||
this.permission = Permission.LOCK.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
p.setLocked(this.argAsBool(0, !p.getLocked()));
|
||||
msg(p.getLocked() ? TL.COMMAND_LOCK_LOCKED : TL.COMMAND_LOCK_UNLOCKED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_LOCK_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ public class CmdLogins extends FCommand {
|
||||
this.aliases.add("logout");
|
||||
this.aliases.add("logouts");
|
||||
this.senderMustBePlayer = true;
|
||||
this.senderMustBeMember = true;
|
||||
|
||||
this.senderMustBeMember = true;
|
||||
this.permission = Permission.MONITOR_LOGINS.node;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ public class CmdLowPower extends FCommand {
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -19,7 +19,8 @@ public class CmdMap extends FCommand {
|
||||
this.permission = Permission.MAP.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -15,7 +15,8 @@ public class CmdMapHeight extends FCommand {
|
||||
|
||||
this.permission = Permission.MAPHEIGHT.node;
|
||||
|
||||
this.senderMustBePlayer = true;
|
||||
|
||||
this.senderMustBePlayer = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,8 @@ public class CmdMod extends FCommand {
|
||||
this.permission = Permission.MOD.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
|
||||
@@ -35,6 +35,7 @@ public class CmdMoney extends FCommand {
|
||||
this.addSubCommand(this.cmdMoneyTransferFf);
|
||||
this.addSubCommand(this.cmdMoneyTransferFp);
|
||||
this.addSubCommand(this.cmdMoneyTransferPf);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,8 @@ public class CmdMoneyBalance extends FCommand {
|
||||
this.permission = Permission.MONEY_BALANCE.node;
|
||||
this.setHelpShort(TL.COMMAND_MONEYBALANCE_SHORT.toString());
|
||||
|
||||
senderMustBePlayer = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
@@ -21,7 +21,8 @@ public class CmdMoneyDeposit extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_DEPOSIT.node;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -23,7 +23,8 @@ public class CmdMoneyTransferFf extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_F2F.node;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -22,7 +22,8 @@ public class CmdMoneyTransferFp extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_F2P.node;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -22,7 +22,8 @@ public class CmdMoneyTransferPf extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_P2F.node;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -22,7 +22,8 @@ public class CmdMoneyWithdraw extends FCommand {
|
||||
|
||||
this.permission = Permission.MONEY_WITHDRAW.node;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -16,7 +16,8 @@ public class CmdNear extends FCommand {
|
||||
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = true;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -18,7 +18,8 @@ public class CmdOpen extends FCommand {
|
||||
this.permission = Permission.OPEN.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = true;
|
||||
|
||||
@@ -18,7 +18,8 @@ public class CmdOwner extends FCommand {
|
||||
this.permission = Permission.OWNER.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
@@ -19,7 +19,8 @@ public class CmdOwnerList extends FCommand {
|
||||
this.permission = Permission.OWNERLIST.node;
|
||||
this.disableOnLock = false;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = 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() {
|
||||
|
||||
@@ -1,61 +1,62 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPeaceful extends FCommand {
|
||||
|
||||
public CmdPeaceful() {
|
||||
super();
|
||||
this.aliases.add("peaceful");
|
||||
|
||||
this.requiredArgs.add("faction tag");
|
||||
//this.optionalArgs.put("", "");
|
||||
|
||||
this.permission = Permission.SET_PEACEFUL.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
Faction faction = this.argAsFaction(0);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String change;
|
||||
if (faction.isPeaceful()) {
|
||||
change = TL.COMMAND_PEACEFUL_REVOKE.toString();
|
||||
faction.setPeaceful(false);
|
||||
} else {
|
||||
change = TL.COMMAND_PEACEFUL_GRANT.toString();
|
||||
faction.setPeaceful(true);
|
||||
}
|
||||
|
||||
// Inform all players
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
String blame = (fme == null ? TL.GENERIC_SERVERADMIN.toString() : fme.describeTo(fplayer, true));
|
||||
if (fplayer.getFaction() == faction) {
|
||||
fplayer.msg(TL.COMMAND_PEACEFUL_YOURS, blame, change);
|
||||
} else {
|
||||
fplayer.msg(TL.COMMAND_PEACEFUL_OTHER, blame, change, faction.getTag(fplayer));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_PEACEFUL_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPeaceful extends FCommand {
|
||||
|
||||
public CmdPeaceful() {
|
||||
super();
|
||||
this.aliases.add("peaceful");
|
||||
|
||||
this.requiredArgs.add("faction tag");
|
||||
//this.optionalArgs.put("", "");
|
||||
|
||||
this.permission = Permission.SET_PEACEFUL.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
Faction faction = this.argAsFaction(0);
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String change;
|
||||
if (faction.isPeaceful()) {
|
||||
change = TL.COMMAND_PEACEFUL_REVOKE.toString();
|
||||
faction.setPeaceful(false);
|
||||
} else {
|
||||
change = TL.COMMAND_PEACEFUL_GRANT.toString();
|
||||
faction.setPeaceful(true);
|
||||
}
|
||||
|
||||
// Inform all players
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
String blame = (fme == null ? TL.GENERIC_SERVERADMIN.toString() : fme.describeTo(fplayer, true));
|
||||
if (fplayer.getFaction() == faction) {
|
||||
fplayer.msg(TL.COMMAND_PEACEFUL_YOURS, blame, change);
|
||||
} else {
|
||||
fplayer.msg(TL.COMMAND_PEACEFUL_OTHER, blame, change, faction.getTag(fplayer));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_PEACEFUL_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,153 +1,154 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.SavageFactions;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.Particles.ParticleEffect;
|
||||
import com.massivecraft.factions.util.VisualizeUtil;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class CmdSeeChunk extends FCommand {
|
||||
|
||||
//Used a hashmap cuz imma make a particle selection gui later, will store it where the boolean is rn.
|
||||
public static HashMap<String, Boolean> seeChunkMap = new HashMap<>();
|
||||
Long interval = 10L;
|
||||
private boolean useParticles;
|
||||
private int length;
|
||||
private ParticleEffect effect;
|
||||
private int taskID = - 1;
|
||||
|
||||
|
||||
//I remade it cause of people getting mad that I had the same seechunk as drtshock
|
||||
|
||||
|
||||
public CmdSeeChunk() {
|
||||
super();
|
||||
aliases.add("seechunk");
|
||||
aliases.add("sc");
|
||||
|
||||
permission = Permission.SEECHUNK.node;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
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) {
|
||||
effect = ParticleEffect.REDSTONE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (seeChunkMap.containsKey(me.getName())) {
|
||||
seeChunkMap.remove(me.getName());
|
||||
msg(TL.COMMAND_SEECHUNK_DISABLED);
|
||||
} else {
|
||||
seeChunkMap.put(me.getName(), true);
|
||||
msg(TL.COMMAND_SEECHUNK_ENABLED);
|
||||
manageTask();
|
||||
}
|
||||
}
|
||||
|
||||
private void manageTask() {
|
||||
if (taskID != - 1) {
|
||||
if (seeChunkMap.keySet().size() == 0) {
|
||||
Bukkit.getScheduler().cancelTask(taskID);
|
||||
taskID = - 1;
|
||||
}
|
||||
} else {
|
||||
startTask();
|
||||
}
|
||||
}
|
||||
|
||||
private void startTask() {
|
||||
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Iterator<String> itr = seeChunkMap.keySet().iterator();
|
||||
while (itr.hasNext()) {
|
||||
Object nameObject = itr.next();
|
||||
String name = nameObject + "";
|
||||
Player player = Bukkit.getPlayer(name);
|
||||
showBorders(player);
|
||||
}
|
||||
manageTask();
|
||||
}
|
||||
}, 0, interval);
|
||||
}
|
||||
|
||||
private void showBorders(Player me) {
|
||||
World world = me.getWorld();
|
||||
FLocation flocation = new FLocation(me);
|
||||
int chunkX = (int) flocation.getX();
|
||||
int chunkZ = (int) flocation.getZ();
|
||||
|
||||
int blockX;
|
||||
int blockZ;
|
||||
|
||||
blockX = chunkX * 16;
|
||||
blockZ = chunkZ * 16;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
|
||||
|
||||
blockX = chunkX * 16 + 15;
|
||||
blockZ = chunkZ * 16;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
|
||||
blockX = chunkX * 16;
|
||||
blockZ = chunkZ * 16 + 15;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
|
||||
blockX = chunkX * 16 + 15;
|
||||
blockZ = chunkZ * 16 + 15;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
}
|
||||
|
||||
private void showPillar(Player player, World world, int blockX, int blockZ) {
|
||||
List<Player> onePlayer = Arrays.asList(player);
|
||||
for (int blockY = 0; blockY < player.getLocation().getBlockY() + 30; blockY++) {
|
||||
Location loc = new Location(world, blockX, blockY, blockZ).add(0.5, 0, 0.5);
|
||||
if (loc.getBlock().getType() != Material.AIR) {
|
||||
continue;
|
||||
}
|
||||
if (useParticles) {
|
||||
if (SavageFactions.plugin.useNonPacketParticles) {
|
||||
// Dust options only exists in the 1.13 API, so we use an
|
||||
// alternative method to achieve this in lower versions.
|
||||
if (SavageFactions.plugin.mc113) {
|
||||
player.spawnParticle(Particle.REDSTONE, loc, 0, new Particle.DustOptions(Color.RED, 1));
|
||||
} else {
|
||||
player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 255, 0, 0, 1);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.effect.display(0, 0, 0, 0, 1, loc, player);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
Material type = blockY % 5 == 0 ? SavageFactions.plugin.REDSTONE_LAMP_ON : SavageFactions.plugin.STAINED_GLASS;
|
||||
VisualizeUtil.addLocation(player, loc, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.GENERIC_PLACEHOLDER;
|
||||
}
|
||||
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.SavageFactions;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.Particles.ParticleEffect;
|
||||
import com.massivecraft.factions.util.VisualizeUtil;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class CmdSeeChunk extends FCommand {
|
||||
|
||||
//Used a hashmap cuz imma make a particle selection gui later, will store it where the boolean is rn.
|
||||
public static HashMap<String, Boolean> seeChunkMap = new HashMap<>();
|
||||
Long interval = 10L;
|
||||
private boolean useParticles;
|
||||
private int length;
|
||||
private ParticleEffect effect;
|
||||
private int taskID = - 1;
|
||||
|
||||
|
||||
//I remade it cause of people getting mad that I had the same seechunk as drtshock
|
||||
|
||||
|
||||
public CmdSeeChunk() {
|
||||
super();
|
||||
aliases.add("seechunk");
|
||||
aliases.add("sc");
|
||||
|
||||
permission = Permission.SEECHUNK.node;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
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) {
|
||||
effect = ParticleEffect.REDSTONE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (seeChunkMap.containsKey(me.getName())) {
|
||||
seeChunkMap.remove(me.getName());
|
||||
msg(TL.COMMAND_SEECHUNK_DISABLED);
|
||||
} else {
|
||||
seeChunkMap.put(me.getName(), true);
|
||||
msg(TL.COMMAND_SEECHUNK_ENABLED);
|
||||
manageTask();
|
||||
}
|
||||
}
|
||||
|
||||
private void manageTask() {
|
||||
if (taskID != - 1) {
|
||||
if (seeChunkMap.keySet().size() == 0) {
|
||||
Bukkit.getScheduler().cancelTask(taskID);
|
||||
taskID = - 1;
|
||||
}
|
||||
} else {
|
||||
startTask();
|
||||
}
|
||||
}
|
||||
|
||||
private void startTask() {
|
||||
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Iterator<String> itr = seeChunkMap.keySet().iterator();
|
||||
while (itr.hasNext()) {
|
||||
Object nameObject = itr.next();
|
||||
String name = nameObject + "";
|
||||
Player player = Bukkit.getPlayer(name);
|
||||
showBorders(player);
|
||||
}
|
||||
manageTask();
|
||||
}
|
||||
}, 0, interval);
|
||||
}
|
||||
|
||||
private void showBorders(Player me) {
|
||||
World world = me.getWorld();
|
||||
FLocation flocation = new FLocation(me);
|
||||
int chunkX = (int) flocation.getX();
|
||||
int chunkZ = (int) flocation.getZ();
|
||||
|
||||
int blockX;
|
||||
int blockZ;
|
||||
|
||||
blockX = chunkX * 16;
|
||||
blockZ = chunkZ * 16;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
|
||||
|
||||
blockX = chunkX * 16 + 15;
|
||||
blockZ = chunkZ * 16;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
|
||||
blockX = chunkX * 16;
|
||||
blockZ = chunkZ * 16 + 15;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
|
||||
blockX = chunkX * 16 + 15;
|
||||
blockZ = chunkZ * 16 + 15;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
}
|
||||
|
||||
private void showPillar(Player player, World world, int blockX, int blockZ) {
|
||||
List<Player> onePlayer = Arrays.asList(player);
|
||||
for (int blockY = 0; blockY < player.getLocation().getBlockY() + 30; blockY++) {
|
||||
Location loc = new Location(world, blockX, blockY, blockZ).add(0.5, 0, 0.5);
|
||||
if (loc.getBlock().getType() != Material.AIR) {
|
||||
continue;
|
||||
}
|
||||
if (useParticles) {
|
||||
if (SavageFactions.plugin.useNonPacketParticles) {
|
||||
// Dust options only exists in the 1.13 API, so we use an
|
||||
// alternative method to achieve this in lower versions.
|
||||
if (SavageFactions.plugin.mc113) {
|
||||
player.spawnParticle(Particle.REDSTONE, loc, 0, new Particle.DustOptions(Color.RED, 1));
|
||||
} else {
|
||||
player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 255, 0, 0, 1);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.effect.display(0, 0, 0, 0, 1, loc, player);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
Material type = blockY % 5 == 0 ? SavageFactions.plugin.REDSTONE_LAMP_ON : SavageFactions.plugin.STAINED_GLASS;
|
||||
VisualizeUtil.addLocation(player, loc, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.GENERIC_PLACEHOLDER;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,6 +16,7 @@ public class CmdSetBanner extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
|
||||
@@ -19,7 +19,8 @@ public class CmdSetDefaultRole extends FCommand {
|
||||
this.senderMustBePlayer = true;
|
||||
senderMustBeColeader = false;
|
||||
|
||||
this.permission = Permission.DEFAULTRANK.node;
|
||||
|
||||
this.permission = Permission.DEFAULTRANK.node;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,8 @@ public class CmdSetFWarp extends FCommand {
|
||||
|
||||
this.senderMustBeMember = true;
|
||||
this.senderMustBeModerator = false;
|
||||
this.senderMustBePlayer = true;
|
||||
|
||||
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,9 +30,11 @@ public class CmdTop extends FCommand {
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
// Can sort by: money, members, online, allies, enemies, power, land.
|
||||
// Get all Factions and remove non player ones.
|
||||
|
||||
@@ -21,6 +21,7 @@ public class CmdTpBanner extends FCommand {
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeColeader = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,8 @@ public class CmdUnban extends FCommand {
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
senderMustBeAdmin = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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()) {
|
||||
sender.sendMessage(p.txt.parse("<b>You are not member of any faction."));
|
||||
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)) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction moderators can %s.", this.getHelpShort()));
|
||||
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)) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction coleaders can %s.", this.getHelpShort()));
|
||||
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)) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction admins can %s.", this.getHelpShort()));
|
||||
if (informSenderIfNot) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction admins can %s.", this.getHelpShort()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user