2019-08-07 20:35:19 +02:00
|
|
|
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;
|
2019-08-07 20:35:19 +02:00
|
|
|
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");
|
2019-08-17 21:02:38 +02:00
|
|
|
this.aliases.add("objectives");
|
|
|
|
this.aliases.add("objective");
|
2019-08-07 20:35:19 +02:00
|
|
|
|
2019-09-15 10:14:15 +02:00
|
|
|
this.requirements = new CommandRequirements.Builder(Permission.MISSIONS)
|
|
|
|
.memberOnly()
|
|
|
|
.playerOnly()
|
|
|
|
.build();
|
2019-08-07 20:35:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
2019-09-15 10:14:15 +02:00
|
|
|
public void perform(CommandContext context) {
|
|
|
|
if (context.faction == null) {
|
2019-08-07 20:35:19 +02:00
|
|
|
return;
|
|
|
|
}
|
2019-09-15 10:14:15 +02:00
|
|
|
final MissionGUI missionsGUI = new MissionGUI(FactionsPlugin.getInstance(), context.fPlayer);
|
2019-08-07 20:35:19 +02:00
|
|
|
missionsGUI.build();
|
2019-09-15 10:14:15 +02:00
|
|
|
context.player.openInventory(missionsGUI.getInventory());
|
2019-08-07 20:35:19 +02:00
|
|
|
}
|
|
|
|
|
2019-09-15 10:14:15 +02:00
|
|
|
|
2019-08-07 20:35:19 +02:00
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_MISSION_DESCRIPTION;
|
|
|
|
}
|
|
|
|
}
|