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-03-03 04:51:21 +01:00
|
|
|
public CmdSetBanner() {
|
|
|
|
super();
|
|
|
|
aliases.add("setbanner");
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
permission = Permission.BANNER.node;
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = false;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeAdmin = true;
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2018-12-21 22:46:10 +01:00
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
}
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
public void perform() {
|
|
|
|
if (!me.getItemInHand().getType().toString().contains("BANNER")) {
|
|
|
|
fme.msg(TL.COMMAND_SETBANNER_NOTBANNER);
|
|
|
|
return;
|
|
|
|
}
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
fme.getFaction().setBannerPattern(me.getItemInHand());
|
|
|
|
fme.msg(TL.COMMAND_SETBANNER_SUCCESS);
|
2018-05-12 00:47:58 +02:00
|
|
|
|
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
}
|
2018-05-12 00:47:58 +02:00
|
|
|
|
2019-03-03 04:51:21 +01:00
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_SETBANNER_DESCRIPTION;
|
|
|
|
}
|
2018-05-12 00:47:58 +02:00
|
|
|
|
|
|
|
}
|