2018-05-12 00:47:58 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdSetBanner extends FCommand {
|
|
|
|
|
2019-12-02 19:55:38 +01:00
|
|
|
/**
|
|
|
|
* @author Illyria Team
|
|
|
|
*/
|
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public CmdSetBanner() {
|
|
|
|
super();
|
2020-01-02 02:59:31 +01:00
|
|
|
aliases.addAll(Aliases.setBanner);
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
this.requirements = new CommandRequirements.Builder(Permission.BANNER)
|
|
|
|
.playerOnly()
|
|
|
|
.build();
|
|
|
|
}
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
@Override
|
|
|
|
public void perform(CommandContext context) {
|
|
|
|
if (!context.player.getItemInHand().getType().toString().contains("BANNER")) {
|
|
|
|
context.msg(TL.COMMAND_SETBANNER_NOTBANNER);
|
|
|
|
return;
|
|
|
|
}
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
context.faction.setBannerPattern(context.player.getItemInHand());
|
|
|
|
context.msg(TL.COMMAND_SETBANNER_SUCCESS);
|
2018-05-12 00:47:58 +02:00
|
|
|
|
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
}
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_SETBANNER_DESCRIPTION;
|
|
|
|
}
|
2018-05-12 00:47:58 +02:00
|
|
|
|
|
|
|
}
|