Cancel tpbanner command if banners are disabled.

This commit is contained in:
ProSavage 2018-07-17 10:07:54 -05:00
parent cfb64ea316
commit 410e932826

View File

@ -24,14 +24,19 @@ public class CmdTpBanner extends FCommand {
@Override @Override
public void perform() { public void perform() {
if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
return;
}
final FactionsPlayerListener fpl = new FactionsPlayerListener(P.p); final FactionsPlayerListener fpl = new FactionsPlayerListener(P.p);
if (fpl.bannerLocations.containsKey(fme.getTag())) { if (FactionsPlayerListener.bannerLocations.containsKey(fme.getTag())) {
fme.msg(TL.COMMAND_TPBANNER_SUCCESS); fme.msg(TL.COMMAND_TPBANNER_SUCCESS);
this.doWarmUp(WarmUpUtil.Warmup.BANNER, TL.WARMUPS_NOTIFY_TELEPORT, "Banner", new Runnable() { this.doWarmUp(WarmUpUtil.Warmup.BANNER, TL.WARMUPS_NOTIFY_TELEPORT, "Banner", new Runnable() {
@Override @Override
public void run() { public void run() {
me.teleport(fpl.bannerLocations.get(fme.getTag())); me.teleport(FactionsPlayerListener.bannerLocations.get(fme.getTag()));
} }
}, this.p.getConfig().getLong("warmups.f-banner", 0)); }, this.p.getConfig().getLong("warmups.f-banner", 0));
} else { } else {