Saber-Factions/src/main/java/com/massivecraft/factions/cmd/CmdSetBanner.java
2019-09-15 05:02:53 -04:00

36 lines
926 B
Java

package com.massivecraft.factions.cmd;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
public class CmdSetBanner extends FCommand {
public CmdSetBanner() {
super();
aliases.add("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;
}
}