mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2026-02-05 11:57:14 +01:00
remove unused code
This commit is contained in:
@@ -85,51 +85,6 @@ public final class PlaceholderCommandRouter extends AbstractCommand {
|
|||||||
this.commands = commands;
|
this.commands = commands;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// @NotNull
|
|
||||||
// public CompletableFuture<Void> acceptCall(@NotNull final CommandSender sender, @NotNull final ParserContext parserContext,
|
|
||||||
// @NotNull final ParseResult parseResult) {
|
|
||||||
//// if (sender instanceof Player || sender instanceof PlayerRef) {
|
|
||||||
//// return CompletableFuture.completedFuture(null);
|
|
||||||
//// }
|
|
||||||
//
|
|
||||||
// final String[] args = parserContext.getInputString().replace("papi ", "").split(" ");
|
|
||||||
//
|
|
||||||
// if (args.length == 0) {
|
|
||||||
// final PlaceholderCommand fallback = commands.get("version");
|
|
||||||
// if (fallback != null) {
|
|
||||||
// fallback.evaluate(plugin, sender, "", Collections.emptyList());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return CompletableFuture.completedFuture(null);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final String search = args[0].toLowerCase(Locale.ROOT);
|
|
||||||
// final PlaceholderCommand target = commands.get(search);
|
|
||||||
//
|
|
||||||
// if (target == null) {
|
|
||||||
// sender.sendMessage(Message.raw("Unknown command ").color(Color.RED).insert(Message.raw(search).color(Color.GRAY)));
|
|
||||||
//
|
|
||||||
//// Msg.msg(sender, "&cUnknown command &7" + search);
|
|
||||||
// return CompletableFuture.completedFuture(null);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final String permission = target.getPermission();
|
|
||||||
// if (permission != null && !permission.isEmpty() && !sender.hasPermission(permission)) {
|
|
||||||
// sender.sendMessage(Message.raw("You do not have permission to do this!").color(Color.RED));
|
|
||||||
//
|
|
||||||
//// Msg.msg(sender, "&cYou do not have permission to do this!");
|
|
||||||
// return CompletableFuture.completedFuture(null);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// target
|
|
||||||
// .evaluate(plugin, sender, search, Arrays.asList(Arrays.copyOfRange(args, 1, args.length)));
|
|
||||||
//
|
|
||||||
// return CompletableFuture.completedFuture(null);
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected @Nullable CompletableFuture<Void> execute(@NotNull final CommandContext context) {
|
protected @Nullable CompletableFuture<Void> execute(@NotNull final CommandContext context) {
|
||||||
final String[] args = context.getInputString().replace("papi", "").replace("placeholderapi", "").trim().split(" ");
|
final String[] args = context.getInputString().replace("papi", "").replace("placeholderapi", "").trim().split(" ");
|
||||||
@@ -150,7 +105,6 @@ public final class PlaceholderCommandRouter extends AbstractCommand {
|
|||||||
if (target == null) {
|
if (target == null) {
|
||||||
sender.sendMessage(Message.raw("Unknown command ").color(Color.RED).insert(Message.raw(search).color(Color.GRAY)));
|
sender.sendMessage(Message.raw("Unknown command ").color(Color.RED).insert(Message.raw(search).color(Color.GRAY)));
|
||||||
|
|
||||||
// Msg.msg(sender, "&cUnknown command &7" + search);
|
|
||||||
return CompletableFuture.completedFuture(null);
|
return CompletableFuture.completedFuture(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,7 +112,6 @@ public final class PlaceholderCommandRouter extends AbstractCommand {
|
|||||||
if (permission != null && !permission.isEmpty() && !sender.hasPermission(permission)) {
|
if (permission != null && !permission.isEmpty() && !sender.hasPermission(permission)) {
|
||||||
sender.sendMessage(Message.raw("You do not have permission to do this!").color(Color.RED));
|
sender.sendMessage(Message.raw("You do not have permission to do this!").color(Color.RED));
|
||||||
|
|
||||||
// Msg.msg(sender, "&cYou do not have permission to do this!");
|
|
||||||
return CompletableFuture.completedFuture(null);
|
return CompletableFuture.completedFuture(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,73 +121,4 @@ public final class PlaceholderCommandRouter extends AbstractCommand {
|
|||||||
return CompletableFuture.completedFuture(null);
|
return CompletableFuture.completedFuture(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// protected void execute(@NotNull final CommandContext context, @NotNull final Store<EntityStore> var2, @NotNull final Ref<EntityStore> var3, @NotNull final PlayerRef var4, @NotNull final World var5) {
|
|
||||||
// final String[] args = context.getInputString().replace("papi ", "").split(" ");
|
|
||||||
// final CommandSender sender = context.sender();
|
|
||||||
//
|
|
||||||
// if (args.length == 0) {
|
|
||||||
// final PlaceholderCommand fallback = commands.get("version");
|
|
||||||
// if (fallback != null) {
|
|
||||||
// fallback.evaluate(plugin, sender, "", Collections.emptyList());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final String search = args[0].toLowerCase(Locale.ROOT);
|
|
||||||
// final PlaceholderCommand target = commands.get(search);
|
|
||||||
//
|
|
||||||
// if (target == null) {
|
|
||||||
// sender.sendMessage(Message.raw("Unknown command ").color(Color.RED).insert(Message.raw(search).color(Color.GRAY)));
|
|
||||||
//
|
|
||||||
//// Msg.msg(sender, "&cUnknown command &7" + search);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final String permission = target.getPermission();
|
|
||||||
// if (permission != null && !permission.isEmpty() && !sender.hasPermission(permission)) {
|
|
||||||
// sender.sendMessage(Message.raw("You do not have permission to do this!").color(Color.RED));
|
|
||||||
//
|
|
||||||
//// Msg.msg(sender, "&cYou do not have permission to do this!");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// target
|
|
||||||
// .evaluate(plugin, sender, search, Arrays.asList(Arrays.copyOfRange(args, 1, args.length)));
|
|
||||||
//
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// @Nullable
|
|
||||||
// protected CompletableFuture<Void> execute(@NotNull final CommandContext commandContext) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public List<String> onTabComplete(@NotNull final CommandSender sender,
|
|
||||||
// @NotNull final Command command, @NotNull final String alias, @NotNull final String[] args) {
|
|
||||||
// final List<String> suggestions = new ArrayList<>();
|
|
||||||
//
|
|
||||||
// if (args.length > 1) {
|
|
||||||
// final PlaceholderCommand target = this.commands.get(args[0].toLowerCase(Locale.ROOT));
|
|
||||||
//
|
|
||||||
// if (target != null) {
|
|
||||||
// target.complete(plugin, sender, args[0].toLowerCase(Locale.ROOT),
|
|
||||||
// Arrays.asList(Arrays.copyOfRange(args, 1, args.length)), suggestions);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return suggestions;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final Stream<String> targets = PlaceholderCommand
|
|
||||||
// .filterByPermission(sender, commands.values().stream()).map(PlaceholderCommand::getLabels)
|
|
||||||
// .flatMap(Collection::stream);
|
|
||||||
// PlaceholderCommand.suggestByParameter(targets, suggestions, args.length == 0 ? null : args[0]);
|
|
||||||
//
|
|
||||||
// return suggestions;
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,23 +86,6 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public void complete(@NotNull final PlaceholderAPIBootstrap plugin,
|
|
||||||
// @NotNull final CommandSender sender, @NotNull final String alias,
|
|
||||||
// @NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
|
||||||
// switch (alias.toLowerCase(Locale.ROOT)) {
|
|
||||||
// case "parserel":
|
|
||||||
// completeParseRelation(params, suggestions);
|
|
||||||
// break;
|
|
||||||
// case "parse":
|
|
||||||
// case "bcparse":
|
|
||||||
// case "cmdparse":
|
|
||||||
// completeParseSingular(sender, params, suggestions);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
private void evaluateParseSingular(@NotNull final CommandSender sender,
|
private void evaluateParseSingular(@NotNull final CommandSender sender,
|
||||||
@NotNull @Unmodifiable final List<String> params, final boolean broadcast,
|
@NotNull @Unmodifiable final List<String> params, final boolean broadcast,
|
||||||
final boolean command) {
|
final boolean command) {
|
||||||
@@ -112,10 +95,6 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
.insert(Message.raw(command ? "cmdparse" : (broadcast ? "bcparse" : "parse")).color(Color.CYAN))
|
.insert(Message.raw(command ? "cmdparse" : (broadcast ? "bcparse" : "parse")).color(Color.CYAN))
|
||||||
.insert(Message.raw(" {target}").color(Color.GRAY))
|
.insert(Message.raw(" {target}").color(Color.GRAY))
|
||||||
.insert(Message.raw(" {message}").color(Color.GREEN)));
|
.insert(Message.raw(" {message}").color(Color.GREEN)));
|
||||||
// Msg.msg(sender,
|
|
||||||
// "&cYou must provide a target and message: &b/papi "
|
|
||||||
// + (command ? "cmdparse" : (broadcast ? "bcparse" : "parse"))
|
|
||||||
// + " &7{target} &a{message}");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +103,6 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
if ("me".equalsIgnoreCase(params.getFirst())) {
|
if ("me".equalsIgnoreCase(params.getFirst())) {
|
||||||
if (!(sender instanceof Player) && !(sender instanceof PlayerRef)) {
|
if (!(sender instanceof Player) && !(sender instanceof PlayerRef)) {
|
||||||
sender.sendMessage(Message.raw("You must be a player to use ").color(Color.RED).insert(Message.raw("me").color(Color.GRAY)).insert(Message.raw(" as a target!").color(Color.RED)));
|
sender.sendMessage(Message.raw("You must be a player to use ").color(Color.RED).insert(Message.raw("me").color(Color.GRAY)).insert(Message.raw(" as a target!").color(Color.RED)));
|
||||||
// Msg.msg(sender, "&cYou must be a player to use &7me&c as a target!");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +117,6 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
final PlayerRef target = resolvePlayer(params.get(0));
|
final PlayerRef target = resolvePlayer(params.get(0));
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
sender.sendMessage(Message.raw("Failed to find player: ").color(Color.RED).insert(Message.raw(params.get(0)).color(Color.WHITE)));
|
sender.sendMessage(Message.raw("Failed to find player: ").color(Color.RED).insert(Message.raw(params.get(0)).color(Color.WHITE)));
|
||||||
// Msg.msg(sender, "&cFailed to find player: &7" + params.get(0));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,13 +128,11 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
|
|
||||||
if (command) {
|
if (command) {
|
||||||
sender.sendMessage(Message.raw("To be implemented")); // todo: implement
|
sender.sendMessage(Message.raw("To be implemented")); // todo: implement
|
||||||
// Bukkit.dispatchCommand(sender, message);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (broadcast) {
|
if (broadcast) {
|
||||||
Universe.get().sendMessage(Message.raw(message));
|
Universe.get().sendMessage(Message.raw(message));
|
||||||
// Bukkit.broadcastMessage(message);
|
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(Message.raw(message));
|
sender.sendMessage(Message.raw(message));
|
||||||
}
|
}
|
||||||
@@ -170,9 +145,6 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
.insert(Message.raw("/papi parserel ").color(Color.CYAN))
|
.insert(Message.raw("/papi parserel ").color(Color.CYAN))
|
||||||
.insert(Message.raw("{target one} {target two} ").color(Color.GRAY))
|
.insert(Message.raw("{target one} {target two} ").color(Color.GRAY))
|
||||||
.insert(Message.raw("{message}").color(Color.GREEN)));
|
.insert(Message.raw("{message}").color(Color.GREEN)));
|
||||||
// Msg.msg(sender,
|
|
||||||
// "&cYou must supply two targets, and a message: &b/papi parserel &7{target one} "
|
|
||||||
// + "{target two} &a{message}");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +155,6 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
sender.sendMessage(Message.raw("You must be a player to use ").color(Color.RED)
|
sender.sendMessage(Message.raw("You must be a player to use ").color(Color.RED)
|
||||||
.insert(Message.raw("me").color(Color.GRAY))
|
.insert(Message.raw("me").color(Color.GRAY))
|
||||||
.insert(Message.raw(" as a target!").color(Color.RED)));
|
.insert(Message.raw(" as a target!").color(Color.RED)));
|
||||||
// Msg.msg(sender, "&cYou must be a player to use &7me&c as a target!");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,9 +167,8 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
playerOne = resolvePlayer(params.get(0));
|
playerOne = resolvePlayer(params.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playerOne == null/* || !playerOne.isOnline()*/) {
|
if (playerOne == null) {
|
||||||
sender.sendMessage(Message.raw("Failed to find player: ").color(Color.RED).insert(Message.raw(params.get(0)).color(Color.WHITE)));
|
sender.sendMessage(Message.raw("Failed to find player: ").color(Color.RED).insert(Message.raw(params.get(0)).color(Color.WHITE)));
|
||||||
// Msg.msg(sender, "&cFailed to find player: &f" + params.get(0));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +177,6 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
if ("me".equalsIgnoreCase(params.get(1))) {
|
if ("me".equalsIgnoreCase(params.get(1))) {
|
||||||
if (!(sender instanceof Player) && !(sender instanceof PlayerRef)) {
|
if (!(sender instanceof Player) && !(sender instanceof PlayerRef)) {
|
||||||
sender.sendMessage(Message.raw("You must be a player to use ").color(Color.RED).insert(Message.raw("me").color(Color.GRAY)).insert(Message.raw(" as a target!").color(Color.RED)));
|
sender.sendMessage(Message.raw("You must be a player to use ").color(Color.RED).insert(Message.raw("me").color(Color.GRAY)).insert(Message.raw(" as a target!").color(Color.RED)));
|
||||||
// Msg.msg(sender, "&cYou must be a player to use &7me&c as a target!");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,9 +189,8 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
playerTwo = resolvePlayer(params.get(1));
|
playerTwo = resolvePlayer(params.get(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playerTwo == null/* || !playerTwo.isOnline()*/) {
|
if (playerTwo == null) {
|
||||||
sender.sendMessage(Message.raw("Failed to find player: ").color(Color.RED).insert(Message.raw(params.get(1)).color(Color.WHITE)));
|
sender.sendMessage(Message.raw("Failed to find player: ").color(Color.RED).insert(Message.raw(params.get(1)).color(Color.WHITE)));
|
||||||
// Msg.msg(sender, "&cFailed to find player: &f" + params.get(1));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +215,6 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Stream<String> names = Universe.get().getPlayers().stream().map(PlayerRef::getUsername);
|
final Stream<String> names = Universe.get().getPlayers().stream().map(PlayerRef::getUsername);
|
||||||
// final Stream<String> names = Bukkit.getOnlinePlayers().stream().map(Player::getName);
|
|
||||||
suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));
|
suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user