Saber-Factions/src/main/java/com/massivecraft/factions/cmd/CmdSetBanner.java

40 lines
946 B
Java
Raw Normal View History

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
*/
public CmdSetBanner() {
super();
aliases.addAll(Aliases.setBanner);
this.requirements = new CommandRequirements.Builder(Permission.BANNER)
.playerOnly()
.build();
}
@Override
public void perform(CommandContext context) {
if (!context.player.getItemInHand().getType().toString().contains("BANNER")) {
context.msg(TL.COMMAND_SETBANNER_NOTBANNER);
return;
}
context.faction.setBannerPattern(context.player.getItemInHand());
context.msg(TL.COMMAND_SETBANNER_SUCCESS);
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_SETBANNER_DESCRIPTION;
}
}