Add warp documentation command

This commit is contained in:
Magnus Ulf
2019-02-01 08:37:23 +01:00
parent 9e81d6d865
commit 1b0f2d29f8
6 changed files with 113 additions and 0 deletions

View File

@ -6,6 +6,8 @@ import com.massivecraft.factions.FactionsIndex;
import com.massivecraft.factions.FactionsParticipator;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.RelationParticipator;
import com.massivecraft.factions.cmd.CmdFactionsPermShow;
import com.massivecraft.factions.entity.MPerm.MPermable;
import com.massivecraft.factions.predicate.PredicateCommandSenderFaction;
import com.massivecraft.factions.predicate.PredicateMPlayerRank;
import com.massivecraft.factions.util.MiscUtil;
@ -820,6 +822,18 @@ public class Faction extends Entity<Faction> implements FactionsParticipator, MP
return getPermitted(mperm.getId());
}
public Set<MPermable> getPermittedPermables(String permId)
{
return getPermitted(permId).stream()
.map(CmdFactionsPermShow::idToMPermable)
.collect(Collectors.toSet());
}
public Set<MPermable> getPermittedPermables(MPerm mperm)
{
return getPermittedPermables(mperm.getId());
}
public boolean isPermitted(String permableId, String permId)
{
if (permableId == null) throw new NullPointerException("permableId");