update kencommandapi ig
This commit is contained in:
parent
a55d985773
commit
be248bfea9
22 changed files with 93 additions and 93 deletions
|
|
@ -21,15 +21,14 @@ public class CoreImplPlugin extends JavaPlugin {
|
|||
public void onEnable() {
|
||||
ScrowAPISurface.initScrowAPI(this);
|
||||
{
|
||||
ScrowAPI.getCommandApi().register(new CoinsCommand().getRootNode());
|
||||
ScrowAPI.getCommandApi().register(new CoinsCommand().getRootLiteral());
|
||||
ScrowAPI.getCommandApi().register(FriendCommand.create());
|
||||
var instanceCache = new InstanceCache();
|
||||
ScrowAPI.getCommandApi().register(InstanceCommand.create(instanceCache));
|
||||
ScrowAPI.getCommandApi().register(new PlayCommand().getRootNode());
|
||||
ScrowAPI.getCommandApi().register(new LobbyCommand().getRootNode());
|
||||
ScrowAPI.getCommandApi().register(new PlayCommand().getRootLiteral());
|
||||
ScrowAPI.getCommandApi().register(new LobbyCommand().getRootLiteral());
|
||||
}
|
||||
|
||||
// Listeners
|
||||
getServer().getPluginManager().registerEvents(new ChatStyleListener(), this);
|
||||
|
||||
// TODO/FIXME
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import com.leakyabstractions.result.api.Result;
|
|||
import com.leakyabstractions.result.core.Results;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.node.RootCommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.api.literal.RootLiteral;
|
||||
import de.kentoj.kencommandapi.api.platform.MessageStyle;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrow.bukkit.scheduler.Tasks;
|
||||
|
|
@ -18,22 +18,22 @@ import java.util.concurrent.CompletableFuture;
|
|||
|
||||
public class CoinsCommand implements CommandExecutor<CommandSender> {
|
||||
@Getter
|
||||
private final RootCommandNode<CommandSender> rootNode;
|
||||
private final RootLiteral<CommandSender> rootLiteral;
|
||||
private final MessageStyle style;
|
||||
|
||||
public CoinsCommand() {
|
||||
style = ScrowMessageStyle.GENERIC;
|
||||
rootNode = CommandNode.rootNode(style, "coins", "bal", "balance");
|
||||
rootNode.setPermission("command.coins.get.self");
|
||||
rootNode.setExecutor(this);
|
||||
rootLiteral = Literal.rootLiteral(style, "coins", "bal", "balance");
|
||||
rootLiteral.setPermission("command.coins.get.self");
|
||||
rootLiteral.setExecutor(this);
|
||||
|
||||
var setLiteral = new CoinsSetLiteral(style).getLiteral();
|
||||
setLiteral.setPermission("command.coins.set");
|
||||
rootNode.addLiteral(setLiteral);
|
||||
rootLiteral.addLiteral(setLiteral);
|
||||
|
||||
var getLiteral = new CoinsGetLiteral(style).getLiteral();
|
||||
getLiteral.setPermission("command.coins.get.others");
|
||||
rootNode.addLiteral(getLiteral);
|
||||
rootLiteral.addLiteral(getLiteral);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.leakyabstractions.result.core.Results;
|
|||
import de.kentoj.kencommandapi.api.argument.CommandArgument;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.api.platform.MessageStyle;
|
||||
import de.kentoj.kencommandapi.type.OfflinePlayerArgumentType;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
|
|
@ -19,7 +19,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
public class CoinsGetLiteral implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> literal;
|
||||
private final Literal<CommandSender> literal;
|
||||
|
||||
private final MessageStyle style;
|
||||
private final CommandArgument<CommandSender, OfflinePlayer> playerArg;
|
||||
|
|
@ -30,7 +30,7 @@ public class CoinsGetLiteral implements CommandExecutor<CommandSender> {
|
|||
playerArg = CommandArgument.arg("player", OfflinePlayerArgumentType.getInstance());
|
||||
playerArg.setDefaultValueProvider(sender -> (OfflinePlayer) sender);
|
||||
|
||||
literal = CommandNode.node("get");
|
||||
literal = Literal.literal("get");
|
||||
literal.addArgument(playerArg);
|
||||
literal.setExecutor(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import de.kentoj.kencommandapi.api.argument.CommandArgument;
|
|||
import de.kentoj.kencommandapi.api.argument.types.IntegerArgumentType;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.api.platform.MessageStyle;
|
||||
import de.kentoj.kencommandapi.type.OfflinePlayerArgumentType;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
|
|
@ -20,7 +20,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
public class CoinsSetLiteral implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> literal;
|
||||
private final Literal<CommandSender> literal;
|
||||
|
||||
private final MessageStyle style;
|
||||
private final CommandArgument<CommandSender, OfflinePlayer> playerArg;
|
||||
|
|
@ -32,7 +32,7 @@ public class CoinsSetLiteral implements CommandExecutor<CommandSender> {
|
|||
playerArg = CommandArgument.arg("player", OfflinePlayerArgumentType.getInstance());
|
||||
amountArg = CommandArgument.arg("amount", new IntegerArgumentType<>());
|
||||
|
||||
literal = CommandNode.node("set");
|
||||
literal = Literal.literal("set");
|
||||
literal.addArgument(playerArg);
|
||||
literal.addArgument(amountArg);
|
||||
literal.setExecutor(this);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.leakyabstractions.result.core.Results;
|
|||
import de.kentoj.kencommandapi.api.argument.CommandArgument;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.type.OfflinePlayerArgumentType;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrowlib.friends.FriendRequestService;
|
||||
|
|
@ -31,7 +31,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
public class FriendAddLiteral implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> literal;
|
||||
private final Literal<CommandSender> literal;
|
||||
private final CommandArgument<CommandSender, OfflinePlayer> playerArg;
|
||||
private final ScrowMessageStyle style;
|
||||
private final FriendRequestService requestService = ScrowAPI.getFriendRequestService();
|
||||
|
|
@ -40,7 +40,7 @@ public class FriendAddLiteral implements CommandExecutor<CommandSender> {
|
|||
public FriendAddLiteral(ScrowMessageStyle style) {
|
||||
this.style = style;
|
||||
playerArg = CommandArgument.arg("player", OfflinePlayerArgumentType.getInstance());
|
||||
literal = CommandNode.node("add");
|
||||
literal = Literal.literal("add");
|
||||
literal.addArgument(playerArg);
|
||||
literal.setExecutor(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package de.kentoj.scrow.bukkit.command.friends;
|
||||
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.node.RootCommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.api.literal.RootLiteral;
|
||||
import de.kentoj.scrowlib.convention.ScrowMessageStyle;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -13,15 +13,15 @@ import org.bukkit.command.CommandSender;
|
|||
|
||||
@NoArgsConstructor(access = AccessLevel.NONE)
|
||||
public class FriendCommand {
|
||||
public static RootCommandNode<CommandSender> create() {
|
||||
public static RootLiteral<CommandSender> create() {
|
||||
var style = new ScrowMessageStyle("Friends", NamedTextColor.AQUA);
|
||||
RootCommandNode<CommandSender> rootNode = CommandNode.rootNode(style, "f", "friend");
|
||||
rootNode.addLiteral(new FriendListLiteral(style).getLiteral());
|
||||
rootNode.addLiteral(new FriendAddLiteral(style).getLiteral());
|
||||
rootNode.addLiteral(new FriendRemoveLiteral(style).getLiteral());
|
||||
rootNode.addLiteral(new FriendRequestDeclineLiteral(style).getLiteral());
|
||||
rootNode.addLiteral(new FriendRequestsLiteral(style).getLiteral());
|
||||
return rootNode;
|
||||
RootLiteral<CommandSender> rootLiteral = Literal.rootLiteral(style, "f", "friend");
|
||||
rootLiteral.addLiteral(new FriendListLiteral(style).getLiteral());
|
||||
rootLiteral.addLiteral(new FriendAddLiteral(style).getLiteral());
|
||||
rootLiteral.addLiteral(new FriendRemoveLiteral(style).getLiteral());
|
||||
rootLiteral.addLiteral(new FriendRequestDeclineLiteral(style).getLiteral());
|
||||
rootLiteral.addLiteral(new FriendRequestsLiteral(style).getLiteral());
|
||||
return rootLiteral;
|
||||
}
|
||||
|
||||
public static Component friendRequestOptions(String requestSenderName, boolean runInstantly) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.leakyabstractions.result.api.Result;
|
|||
import com.leakyabstractions.result.core.Results;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrow.bukkit.scheduler.Tasks;
|
||||
import de.kentoj.scrowlib.convention.ScrowMessageStyle;
|
||||
|
|
@ -26,12 +26,12 @@ import static net.kyori.adventure.text.Component.text;
|
|||
public class FriendListLiteral implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> literal;
|
||||
private final Literal<CommandSender> literal;
|
||||
private final ScrowMessageStyle style;
|
||||
|
||||
public FriendListLiteral(ScrowMessageStyle style) {
|
||||
this.style = style;
|
||||
this.literal = CommandNode.node("list");
|
||||
this.literal = Literal.literal("list");
|
||||
literal.setExecutor(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.leakyabstractions.result.core.Results;
|
|||
import de.kentoj.kencommandapi.api.argument.CommandArgument;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.type.OfflinePlayerArgumentType;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrow.bukkit.scheduler.Tasks;
|
||||
|
|
@ -19,14 +19,14 @@ import java.util.concurrent.CompletableFuture;
|
|||
|
||||
public class FriendRemoveLiteral implements CommandExecutor<CommandSender> {
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> literal;
|
||||
private final Literal<CommandSender> literal;
|
||||
private final CommandArgument<CommandSender, OfflinePlayer> playerArg;
|
||||
private final ScrowMessageStyle style;
|
||||
|
||||
public FriendRemoveLiteral(ScrowMessageStyle style) {
|
||||
this.style = style;
|
||||
this.playerArg = CommandArgument.arg("player", OfflinePlayerArgumentType.getInstance());
|
||||
this.literal = CommandNode.node("remove");
|
||||
this.literal = Literal.literal("remove");
|
||||
this.literal.addArgument(playerArg);
|
||||
this.literal.setExecutor(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.leakyabstractions.result.core.Results;
|
|||
import de.kentoj.kencommandapi.api.argument.CommandArgument;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.type.OfflinePlayerArgumentType;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrowlib.friends.FriendRequestService;
|
||||
|
|
@ -23,7 +23,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
public class FriendRequestDeclineLiteral implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> literal;
|
||||
private final Literal<CommandSender> literal;
|
||||
private final CommandArgument<CommandSender, OfflinePlayer> playerArg;
|
||||
private final ScrowMessageStyle style;
|
||||
private final FriendRequestService requestService = ScrowAPI.getFriendRequestService();
|
||||
|
|
@ -31,7 +31,7 @@ public class FriendRequestDeclineLiteral implements CommandExecutor<CommandSende
|
|||
public FriendRequestDeclineLiteral(ScrowMessageStyle style) {
|
||||
this.style = style;
|
||||
playerArg = CommandArgument.arg("player", OfflinePlayerArgumentType.getInstance());
|
||||
literal = CommandNode.node("reject", "decline");
|
||||
literal = Literal.literal("reject", "decline");
|
||||
literal.addArgument(playerArg);
|
||||
literal.setExecutor(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.leakyabstractions.result.api.Result;
|
|||
import com.leakyabstractions.result.core.Results;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrowlib.friends.FriendRequest;
|
||||
import de.kentoj.scrow.bukkit.scheduler.Tasks;
|
||||
|
|
@ -25,12 +25,12 @@ import static net.kyori.adventure.text.Component.text;
|
|||
public class FriendRequestsLiteral implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> literal;
|
||||
private final Literal<CommandSender> literal;
|
||||
private final ScrowMessageStyle style;
|
||||
|
||||
public FriendRequestsLiteral(ScrowMessageStyle style) {
|
||||
this.style = style;
|
||||
literal = CommandNode.node("requests");
|
||||
literal = Literal.literal("requests");
|
||||
literal.setExecutor(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package de.kentoj.scrow.bukkit.command.instance;
|
||||
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.node.RootCommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.api.literal.RootLiteral;
|
||||
import de.kentoj.scrowlib.convention.ScrowMessageStyle;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -10,12 +10,12 @@ import org.bukkit.command.CommandSender;
|
|||
|
||||
@NoArgsConstructor(access = AccessLevel.NONE)
|
||||
public class InstanceCommand {
|
||||
public static RootCommandNode<CommandSender> create(InstanceCache instanceCache) {
|
||||
public static RootLiteral<CommandSender> create(InstanceCache instanceCache) {
|
||||
var style = new ScrowMessageStyle("server-manager", NamedTextColor.RED);
|
||||
RootCommandNode<CommandSender> rootNode = CommandNode.rootNode(style, "instance", "server-manager");
|
||||
rootNode.addLiteral(new InstanceListLiteral(style).getNode());
|
||||
rootNode.addLiteral(new InstanceDeployLiteral(style).getLiteral());
|
||||
rootNode.addLiteral(new InstanceDestroyLiteral(instanceCache, style).getLiteral());
|
||||
return rootNode;
|
||||
RootLiteral<CommandSender> rootLiteral = Literal.rootLiteral(style, "instance", "server-manager");
|
||||
rootLiteral.addLiteral(new InstanceListLiteral(style).getNode());
|
||||
rootLiteral.addLiteral(new InstanceDeployLiteral(style).getLiteral());
|
||||
rootLiteral.addLiteral(new InstanceDestroyLiteral(instanceCache, style).getLiteral());
|
||||
return rootLiteral;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import de.kentoj.kencommandapi.api.argument.CommandArgument;
|
|||
import de.kentoj.kencommandapi.api.argument.types.StringArgumentType;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrow.bukkit.scheduler.Tasks;
|
||||
import de.kentoj.scrowlib.convention.ScrowMessageStyle;
|
||||
|
|
@ -18,7 +18,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
public class InstanceDeployLiteral implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> literal;
|
||||
private final Literal<CommandSender> literal;
|
||||
private final CommandArgument<CommandSender, String> templateArg;
|
||||
private final ScrowMessageStyle style;
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ public class InstanceDeployLiteral implements CommandExecutor<CommandSender> {
|
|||
|
||||
templateArg = CommandArgument.arg("template", new StringArgumentType<>());
|
||||
|
||||
literal = CommandNode.node("deploy");
|
||||
literal = Literal.literal("deploy");
|
||||
literal.addArgument(templateArg);
|
||||
literal.setExecutor(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import de.kentoj.kencommandapi.api.argument.CommandArgument;
|
|||
import de.kentoj.kencommandapi.api.argument.types.StringArgumentType;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrow.bukkit.scheduler.Tasks;
|
||||
import de.kentoj.scrowlib.convention.ScrowMessageStyle;
|
||||
|
|
@ -19,7 +19,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
public class InstanceDestroyLiteral implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> literal;
|
||||
private final Literal<CommandSender> literal;
|
||||
private final CommandArgument<CommandSender, String> handleArg;
|
||||
private final ScrowMessageStyle style;
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ public class InstanceDestroyLiteral implements CommandExecutor<CommandSender> {
|
|||
handleArg.setSuggestionProvider(ctx -> cache.getInstances().stream()
|
||||
.map(ServerInstance::getHandle)
|
||||
.toList());
|
||||
literal = CommandNode.node("destroy");
|
||||
literal = Literal.literal("destroy");
|
||||
literal.addArgument(handleArg);
|
||||
literal.setExecutor(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.leakyabstractions.result.api.Result;
|
|||
import com.leakyabstractions.result.core.Results;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrow.bukkit.scheduler.Tasks;
|
||||
import de.kentoj.scrowlib.convention.ScrowMessageStyle;
|
||||
|
|
@ -17,12 +17,12 @@ import java.util.concurrent.CompletableFuture;
|
|||
public class InstanceListLiteral implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final CommandNode<CommandSender> node;
|
||||
private final Literal<CommandSender> node;
|
||||
private final ScrowMessageStyle style;
|
||||
|
||||
public InstanceListLiteral(ScrowMessageStyle style) {
|
||||
this.style = style;
|
||||
this.node = CommandNode.node("list");
|
||||
this.node = Literal.literal("list");
|
||||
this.node.setExecutor(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import com.leakyabstractions.result.api.Result;
|
|||
import com.leakyabstractions.result.core.Results;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.SyncCommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.node.RootCommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.api.literal.RootLiteral;
|
||||
import de.kentoj.kencommandapi.api.platform.MessageStyle;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
|
|
@ -14,11 +14,11 @@ import org.bukkit.command.CommandSender;
|
|||
public class LobbyCommand implements SyncCommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final RootCommandNode<CommandSender> rootNode;
|
||||
private final RootLiteral<CommandSender> rootLiteral;
|
||||
|
||||
public LobbyCommand() {
|
||||
this.rootNode = CommandNode.rootNode(MessageStyle.PLAIN, "lobby", "l", "hub");
|
||||
this.rootNode.setExecutor(this);
|
||||
this.rootLiteral = Literal.rootLiteral(MessageStyle.PLAIN, "lobby", "l", "hub");
|
||||
this.rootLiteral.setExecutor(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import de.kentoj.kencommandapi.api.argument.CommandArgument;
|
|||
import de.kentoj.kencommandapi.api.argument.types.StringArgumentType;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.invocation.CommandExecutor;
|
||||
import de.kentoj.kencommandapi.api.node.CommandNode;
|
||||
import de.kentoj.kencommandapi.api.node.RootCommandNode;
|
||||
import de.kentoj.kencommandapi.api.literal.Literal;
|
||||
import de.kentoj.kencommandapi.api.literal.RootLiteral;
|
||||
import de.kentoj.scrow.bukkit.ScrowAPI;
|
||||
import de.kentoj.scrow.bukkit.scheduler.Tasks;
|
||||
import de.kentoj.scrowlib.convention.ScrowMessageStyle;
|
||||
|
|
@ -20,7 +20,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
public class PlayCommand implements CommandExecutor<CommandSender> {
|
||||
|
||||
@Getter
|
||||
private final RootCommandNode<CommandSender> rootNode;
|
||||
private final RootLiteral<CommandSender> rootLiteral;
|
||||
private final CommandArgument<CommandSender, String> gamemodeArg;
|
||||
|
||||
public PlayCommand() {
|
||||
|
|
@ -28,9 +28,9 @@ public class PlayCommand implements CommandExecutor<CommandSender> {
|
|||
|
||||
gamemodeArg = CommandArgument.arg("gamemode", new StringArgumentType<>());
|
||||
|
||||
rootNode = CommandNode.rootNode(style, "play", "queue");
|
||||
rootNode.addArgument(this.gamemodeArg);
|
||||
rootNode.setExecutor(this);
|
||||
rootLiteral = Literal.rootLiteral(style, "play", "queue");
|
||||
rootLiteral.addArgument(this.gamemodeArg);
|
||||
rootLiteral.setExecutor(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.bukkit.event.EventHandler;
|
|||
import org.bukkit.event.Listener;
|
||||
|
||||
public class ChatStyleListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onChat(AsyncChatEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue