Saber-Factions/src/main/java/com/massivecraft/factions/missions/CmdMissions.java

41 lines
1.2 KiB
Java
Raw Normal View History

package com.massivecraft.factions.missions;
2019-09-15 10:14:15 +02:00
import com.massivecraft.factions.FactionsPlugin;
import com.massivecraft.factions.cmd.CommandContext;
import com.massivecraft.factions.cmd.CommandRequirements;
import com.massivecraft.factions.cmd.FCommand;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
public class CmdMissions extends FCommand {
public CmdMissions() {
this.aliases.add("missions");
this.aliases.add("mission");
this.aliases.add("objectives");
this.aliases.add("objective");
2019-09-15 10:14:15 +02:00
this.requirements = new CommandRequirements.Builder(Permission.MISSIONS)
.memberOnly()
.playerOnly()
.build();
}
@Override
2019-09-15 10:14:15 +02:00
public void perform(CommandContext context) {
if (context.faction == null) {
return;
}
2019-09-15 10:14:15 +02:00
final MissionGUI missionsGUI = new MissionGUI(FactionsPlugin.getInstance(), context.fPlayer);
missionsGUI.build();
2019-09-15 10:14:15 +02:00
context.player.openInventory(missionsGUI.getInventory());
}
2019-09-15 10:14:15 +02:00
@Override
public TL getUsageTranslation() {
return TL.COMMAND_MISSION_DESCRIPTION;
}
}