2015-01-09 22:36:12 +01:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.entity.MPerm;
|
2015-02-12 12:00:55 +01:00
|
|
|
import com.massivecraft.massivecore.MassiveException;
|
2015-11-06 02:10:29 +01:00
|
|
|
import com.massivecraft.massivecore.command.Parameter;
|
2015-01-09 22:36:12 +01:00
|
|
|
import com.massivecraft.massivecore.util.Txt;
|
|
|
|
|
2017-03-24 13:05:58 +01:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2015-01-09 22:36:12 +01:00
|
|
|
public class CmdFactionsPermList extends FactionsCommand
|
|
|
|
{
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public CmdFactionsPermList()
|
|
|
|
{
|
2015-10-21 19:35:41 +02:00
|
|
|
// Parameters
|
|
|
|
this.addParameter(Parameter.getPage());
|
2015-01-09 22:36:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
2015-02-12 12:00:55 +01:00
|
|
|
public void perform() throws MassiveException
|
2015-01-09 22:36:12 +01:00
|
|
|
{
|
|
|
|
// Args
|
2015-05-13 23:00:53 +02:00
|
|
|
int page = this.readArg();
|
2015-01-09 22:36:12 +01:00
|
|
|
|
|
|
|
// Create messages
|
|
|
|
List<String> messages = new ArrayList<String>();
|
|
|
|
|
|
|
|
for (MPerm perm : MPerm.getAll())
|
|
|
|
{
|
2016-02-02 19:03:11 +01:00
|
|
|
if ( ! perm.isVisible() && ! msender.isOverriding()) continue;
|
2015-01-09 22:36:12 +01:00
|
|
|
messages.add(perm.getDesc(true, true));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Send messages
|
2015-09-05 13:44:24 +02:00
|
|
|
message(Txt.getPage(messages, page, "Available Faction Perms", this));
|
2015-01-09 22:36:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|