package com.massivecraft.factions.cmd; import java.util.Map.Entry; import com.massivecraft.factions.event.EventFactionsExpansions; import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; import com.massivecraft.massivecore.util.Txt; public class CmdFactionsExpansions extends FactionsCommand { // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // public CmdFactionsExpansions() { // Aliases this.addAliases("expansions"); // Requirements this.addRequirements(ReqHasPerm.get(Perm.EXPANSIONS.node)); } // -------------------------------------------- // // OVERRIDE // -------------------------------------------- // @Override public void perform() { // Event EventFactionsExpansions event = new EventFactionsExpansions(sender); event.run(); // Title msg(Txt.titleize("Factions Expansions")); // Lines for (Entry entry : event.getExpansions().entrySet()) { String name = entry.getKey(); Boolean installed = entry.getValue(); String format = (installed ? "[X] %s" : "[ ] %s"); msg(format, name); } // URL Suggestion msg("Learn all about expansions in the online documentation:"); msg("http://www.massivecraft.com/factions"); } }