2018-03-27 01:42:26 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.P;
|
|
|
|
import com.massivecraft.factions.listeners.FactionsPlayerListener;
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.util.WarmUpUtil;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdTpBanner extends FCommand {
|
|
|
|
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() {
|
2018-07-17 17:07:54 +02:00
|
|
|
if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-27 01:42:26 +02:00
|
|
|
final FactionsPlayerListener fpl = new FactionsPlayerListener(P.p);
|
|
|
|
|
2018-07-17 17:07:54 +02:00
|
|
|
if (FactionsPlayerListener.bannerLocations.containsKey(fme.getTag())) {
|
2018-03-27 01:42:26 +02:00
|
|
|
fme.msg(TL.COMMAND_TPBANNER_SUCCESS);
|
|
|
|
this.doWarmUp(WarmUpUtil.Warmup.BANNER, TL.WARMUPS_NOTIFY_TELEPORT, "Banner", new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
2018-07-17 17:07:54 +02:00
|
|
|
me.teleport(FactionsPlayerListener.bannerLocations.get(fme.getTag()));
|
2018-03-27 01:42:26 +02:00
|
|
|
}
|
|
|
|
}, this.p.getConfig().getLong("warmups.f-banner", 0));
|
|
|
|
} else {
|
|
|
|
fme.msg(TL.COMMAND_TPBANNER_NOTSET);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_TPBANNER_DESCRIPTION;
|
|
|
|
}
|
|
|
|
}
|