2018-03-27 01:42:26 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
2019-09-14 21:13:01 +02:00
|
|
|
import com.massivecraft.factions.FactionsPlugin;
|
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-09-14 21:13:01 +02:00
|
|
|
|
2019-12-02 19:55:38 +01:00
|
|
|
/**
|
|
|
|
* @author Illyria Team
|
|
|
|
*/
|
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public CmdTpBanner() {
|
|
|
|
super();
|
2020-01-02 02:59:31 +01:00
|
|
|
this.aliases.addAll(Aliases.tpBanner);
|
2019-09-15 11:19:06 +02:00
|
|
|
|
|
|
|
this.requirements = new CommandRequirements.Builder(Permission.TPBANNER)
|
|
|
|
.playerOnly()
|
|
|
|
.memberOnly()
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform(CommandContext context) {
|
|
|
|
if (!FactionsPlugin.getInstance().getConfig().getBoolean("fbanners.Enabled")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (FactionsBlockListener.bannerLocations.containsKey(context.fPlayer.getTag())) {
|
|
|
|
context.msg(TL.COMMAND_TPBANNER_SUCCESS);
|
|
|
|
context.doWarmUp(WarmUpUtil.Warmup.BANNER, TL.WARMUPS_NOTIFY_TELEPORT, "Banner", () -> {
|
|
|
|
context.player.teleport(FactionsBlockListener.bannerLocations.get(context.fPlayer.getTag()));
|
|
|
|
}, FactionsPlugin.getInstance().getConfig().getLong("warmups.f-banner", 0));
|
|
|
|
} else {
|
|
|
|
context.msg(TL.COMMAND_TPBANNER_NOTSET);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_TPBANNER_DESCRIPTION;
|
|
|
|
}
|
2018-03-27 01:42:26 +02:00
|
|
|
}
|