2018-03-27 01:42:26 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
2019-08-02 23:01:33 +02:00
|
|
|
import com.massivecraft.factions.P;
|
2018-10-24 17:48:08 +02:00
|
|
|
import com.massivecraft.factions.listeners.FactionsBlockListener;
|
2018-03-27 01:42:26 +02:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.util.WarmUpUtil;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdTpBanner extends FCommand {
|
2019-03-03 04:51:21 +01:00
|
|
|
public CmdTpBanner() {
|
|
|
|
super();
|
|
|
|
|
|
|
|
this.aliases.add("tpbanner");
|
|
|
|
|
|
|
|
this.permission = Permission.TPBANNER.node;
|
|
|
|
this.disableOnLock = true;
|
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = true;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeColeader = false;
|
|
|
|
senderMustBeAdmin = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
2019-08-02 23:01:33 +02:00
|
|
|
if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
|
2019-03-03 04:51:21 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (FactionsBlockListener.bannerLocations.containsKey(fme.getTag())) {
|
|
|
|
fme.msg(TL.COMMAND_TPBANNER_SUCCESS);
|
2019-04-16 15:02:31 +02:00
|
|
|
this.doWarmUp(WarmUpUtil.Warmup.BANNER, TL.WARMUPS_NOTIFY_TELEPORT, "Banner", () -> me.teleport(FactionsBlockListener.bannerLocations.get(fme.getTag())), this.p.getConfig().getLong("warmups.f-banner", 0));
|
2019-03-03 04:51:21 +01:00
|
|
|
} else {
|
|
|
|
fme.msg(TL.COMMAND_TPBANNER_NOTSET);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_TPBANNER_DESCRIPTION;
|
|
|
|
}
|
2018-03-27 01:42:26 +02:00
|
|
|
}
|