508f953ce9
various little tweaks and improvements to other code moderate speed boost to FLocation code made commandDisable permissions work for any command alias of a command, instead of just the first one
60 lines
1.4 KiB
Java
60 lines
1.4 KiB
Java
package com.massivecraft.factions.commands;
|
|
|
|
import java.util.Set;
|
|
import java.util.Iterator;
|
|
|
|
import com.massivecraft.factions.Board;
|
|
import com.massivecraft.factions.Conf;
|
|
import com.massivecraft.factions.FLocation;
|
|
import com.massivecraft.factions.Faction;
|
|
import com.massivecraft.factions.Factions;
|
|
|
|
|
|
public class FCommandOwnerList extends FBaseCommand {
|
|
|
|
public FCommandOwnerList() {
|
|
aliases.add("ownerlist");
|
|
|
|
helpDescription = "list owner(s) of this claimed land";
|
|
}
|
|
|
|
@Override
|
|
public void perform() {
|
|
boolean hasBypass = Factions.hasPermAdminBypass(player);
|
|
|
|
if ( ! hasBypass && ! assertHasFaction()) {
|
|
return;
|
|
}
|
|
|
|
if ( ! Conf.ownedAreasEnabled) {
|
|
me.sendMessage("Owned areas are disabled on this server.");
|
|
return;
|
|
}
|
|
|
|
Faction myFaction = me.getFaction();
|
|
FLocation flocation = new FLocation(me);
|
|
|
|
if (Board.getIdAt(flocation) != myFaction.getId()) {
|
|
if (!hasBypass) {
|
|
me.sendMessage("This land is not claimed by your faction.");
|
|
return;
|
|
}
|
|
|
|
myFaction = Board.getFactionAt(flocation);
|
|
if (!myFaction.isNormal()) {
|
|
me.sendMessage("This land is not claimed by any faction, thus no owners.");
|
|
return;
|
|
}
|
|
}
|
|
|
|
String owners = myFaction.getOwnerListString(flocation);
|
|
|
|
if (owners == null || owners.isEmpty()) {
|
|
me.sendMessage("No owners are set here; everyone in the faction has access.");
|
|
return;
|
|
}
|
|
|
|
me.sendMessage("Current owner(s) of this land: "+owners);
|
|
}
|
|
}
|