Switched to cosmos (1.21.6)
This commit is contained in:
parent
95bb1e90fe
commit
c163885345
|
|
@ -36,8 +36,8 @@ tasks {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
// Galaxy
|
||||
compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT") {
|
||||
// Cosmos
|
||||
compileOnly("com.alttd.cosmos:cosmos-api:1.21.6-R0.1-SNAPSHOT") {
|
||||
isChanging = true
|
||||
}
|
||||
// Lombok
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.alttd.commands.subcommands.CommandHelp;
|
|||
import com.alttd.commands.subcommands.CommandReload;
|
||||
import com.alttd.config.Config;
|
||||
import com.alttd.util.Logger;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.command.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
|
@ -15,6 +16,7 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
public class CommandManager implements CommandExecutor, TabExecutor {
|
||||
private final List<SubCommand> subCommands;
|
||||
|
||||
|
|
@ -45,7 +47,7 @@ public class CommandManager implements CommandExecutor, TabExecutor {
|
|||
subCommand = getSubCommand(args[0]);
|
||||
|
||||
if (!commandSender.hasPermission(subCommand.getPermission())) {
|
||||
commandSender.sendMiniMessage(Config.NO_PERMISSION, null);
|
||||
commandSender.sendRichMessage(Config.NO_PERMISSION);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +63,7 @@ public class CommandManager implements CommandExecutor, TabExecutor {
|
|||
.filter(subCommand -> commandSender.hasPermission(subCommand.getPermission()))
|
||||
.map(SubCommand::getName)
|
||||
.filter(name -> args.length == 0 || name.startsWith(args[0]))
|
||||
.collect(Collectors.toList())
|
||||
.toList()
|
||||
);
|
||||
} else {
|
||||
SubCommand subCommand = getSubCommand(args[0]);
|
||||
|
|
@ -71,14 +73,10 @@ public class CommandManager implements CommandExecutor, TabExecutor {
|
|||
return res;
|
||||
}
|
||||
|
||||
public List<SubCommand> getSubCommands() {
|
||||
return subCommands;
|
||||
}
|
||||
|
||||
private SubCommand getSubCommand(String cmdName) {
|
||||
return subCommands.stream()
|
||||
.filter(subCommand -> subCommand.getName().equals(cmdName))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public class CommandGUI extends SubCommand {
|
|||
@Override
|
||||
public boolean onCommand(CommandSender commandSender, String[] args) {
|
||||
if (!(commandSender instanceof Player player)) {
|
||||
commandSender.sendMiniMessage(Config.NO_CONSOLE, null);
|
||||
commandSender.sendRichMessage(Config.NO_CONSOLE);
|
||||
return true;
|
||||
}
|
||||
new OpenParticleGUI(player).open(player);
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ public class CommandHelp extends SubCommand {
|
|||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender commandSender, String[] args) {
|
||||
commandSender.sendMiniMessage(Config.HELP_MESSAGE_WRAPPER.replaceAll("<commands>", commandManager
|
||||
commandSender.sendRichMessage(Config.HELP_MESSAGE_WRAPPER.replaceAll("<commands>", commandManager
|
||||
.getSubCommands().stream()
|
||||
.filter(subCommand -> commandSender.hasPermission(subCommand.getPermission()))
|
||||
.map(SubCommand::getHelpMessage)
|
||||
.collect(Collectors.joining("\n"))), null);
|
||||
.collect(Collectors.joining("\n"))));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class CommandReload extends SubCommand {
|
|||
@Override
|
||||
public boolean onCommand(CommandSender commandSender, String[] args) {
|
||||
AltitudeParticles.getInstance().reload();
|
||||
commandSender.sendMiniMessage("<green>Reloaded AltitudeParticles config.</green>", null);
|
||||
commandSender.sendRichMessage("<green>Reloaded AltitudeParticles config.</green>");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user