Saber-Factions/src/main/java/com/massivecraft/factions/cmd/CmdOwnerList.java

55 lines
1.6 KiB
Java
Raw Normal View History

2011-10-09 21:57:43 +02:00
package com.massivecraft.factions.cmd;
2011-07-31 03:17:00 +02:00
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FLocation;
2011-10-09 18:35:39 +02:00
import com.massivecraft.factions.struct.Permission;
2011-07-31 03:17:00 +02:00
2014-04-04 20:55:21 +02:00
public class CmdOwnerList extends FCommand {
public CmdOwnerList() {
2014-07-01 21:52:40 +02:00
super(); this.aliases.add("ownerlist");
2014-04-04 20:55:21 +02:00
//this.requiredArgs.add("");
//this.optionalArgs.put("", "");
2014-07-01 21:52:40 +02:00
this.permission = Permission.OWNERLIST.node; this.disableOnLock = false;
2014-04-04 20:55:21 +02:00
2014-07-01 21:52:40 +02:00
senderMustBePlayer = true; senderMustBeMember = false; senderMustBeModerator = false; senderMustBeAdmin = false;
2014-04-04 20:55:21 +02:00
}
@Override
public void perform() {
boolean hasBypass = fme.isAdminBypassing();
if (!hasBypass && !assertHasFaction()) {
return;
}
if (!Conf.ownedAreasEnabled) {
2014-07-01 21:52:40 +02:00
fme.msg("<b>Owned areas are disabled on this server."); return;
2014-04-04 20:55:21 +02:00
}
FLocation flocation = new FLocation(fme);
if (Board.getFactionAt(flocation) != myFaction) {
if (!hasBypass) {
2014-07-01 21:52:40 +02:00
fme.msg("<b>This land is not claimed by your faction."); return;
2014-04-04 20:55:21 +02:00
}
2014-07-01 21:52:40 +02:00
myFaction = Board.getFactionAt(flocation); if (!myFaction.isNormal()) {
fme.msg("<i>This land is not claimed by any faction, thus no owners."); return;
2014-04-04 20:55:21 +02:00
}
}
String owners = myFaction.getOwnerListString(flocation);
if (owners == null || owners.isEmpty()) {
2014-07-01 21:52:40 +02:00
fme.msg("<i>No owners are set here; everyone in the faction has access."); return;
2014-04-04 20:55:21 +02:00
}
fme.msg("<i>Current owner(s) of this land: %s", owners);
}
2011-07-31 03:17:00 +02:00
}