Introduced Brigadier Command System. More Formatting Coming in next commit.
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.listeners.FactionsBlockListener;
|
||||
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;
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.TPBANNER)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!P.p.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
public void perform(CommandContext context) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("fbanners.Enabled")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (FactionsBlockListener.bannerLocations.containsKey(fme.getTag())) {
|
||||
fme.msg(TL.COMMAND_TPBANNER_SUCCESS);
|
||||
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));
|
||||
final FactionsPlayerListener fpl = new FactionsPlayerListener();
|
||||
|
||||
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 {
|
||||
fme.msg(TL.COMMAND_TPBANNER_NOTSET);
|
||||
context.msg(TL.COMMAND_TPBANNER_NOTSET);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user