0.5h - TypeNullable does not work well with TypeContainer.

This commit is contained in:
ulumulu1510 2016-02-26 15:13:29 +01:00 committed by Olof Larsson
parent 47332f96d5
commit 08024bd4f9
2 changed files with 3 additions and 5 deletions

View File

@ -20,7 +20,6 @@ import com.massivecraft.massivecore.collections.MassiveList;
import com.massivecraft.massivecore.collections.MassiveSet;
import com.massivecraft.massivecore.command.Parameter;
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.command.type.TypeNullable;
import com.massivecraft.massivecore.command.type.container.TypeSet;
import com.massivecraft.massivecore.pager.Pager;
import com.massivecraft.massivecore.pager.Stringifier;
@ -47,7 +46,7 @@ public class CmdFactionsRelationList extends FactionsCommand
// Parameter
this.addParameter(Parameter.getPage());
this.addParameter(TypeFaction.get(), "faction", "you");
this.addParameter(TypeNullable.get(TypeSet.get(TypeRelation.get()), "all"), "relation|all", "all");
this.addParameter(TypeSet.get(TypeRelation.get()), "relations", "all");
// Requirements
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_LIST.node));
@ -64,8 +63,7 @@ public class CmdFactionsRelationList extends FactionsCommand
// Args
int page = this.readArg();
final Faction faction = this.readArg(msenderFaction);
final Set<Rel> rel = this.readArg();
final Set<Rel> relations = rel == null ? RELEVANT_RELATIONS : rel;
final Set<Rel> relations = this.readArg(RELEVANT_RELATIONS);
// Pager Create
final Pager<String> pager = new Pager<String>(this, "", page, new Stringifier<String>()

View File

@ -38,7 +38,7 @@ public class CmdFactionsRelationWishes extends FactionsCommand
this.addParameter(TypeFaction.get(), "faction", "you");
// Requirements
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_LIST.node));
this.addRequirements(RequirementHasPerm.get(Perm.RELATION_WISHES.node));
this.addRequirements(ReqHasFaction.get());
}