Updated Cloud dependency to v2

This commit is contained in:
OakLoaf
2024-08-16 11:07:03 +01:00
parent 44d23573b3
commit 922cd35e84
13 changed files with 133 additions and 138 deletions

View File

@@ -1,8 +1,5 @@
package com.dfsek.terra.addons.commands.addons;
import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.CommandManager;
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
import com.dfsek.terra.api.Platform;
import com.dfsek.terra.api.addon.BaseAddon;
@@ -12,6 +9,9 @@ import com.dfsek.terra.api.event.events.platform.CommandRegistrationEvent;
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
import com.dfsek.terra.api.inject.annotations.Inject;
import org.incendo.cloud.CommandManager;
import org.incendo.cloud.description.Description;
public class AddonsCommandAddon implements AddonInitializer {
@Inject
@@ -30,7 +30,7 @@ public class AddonsCommandAddon implements AddonInitializer {
CommandManager<CommandSender> manager = event.getCommandManager();
manager.command(
manager.commandBuilder("addons", ArgumentDescription.of("List installed Terra addons"))
manager.commandBuilder("addons", Description.of("List installed Terra addons"))
.permission("terra.addons")
.handler(context -> {
StringBuilder addons = new StringBuilder("Installed addons:\n");
@@ -41,7 +41,7 @@ public class AddonsCommandAddon implements AddonInitializer {
.append('@')
.append(addon.getVersion().getFormatted())
.append('\n'));
context.getSender().sendMessage(addons.toString());
context.sender().sendMessage(addons.toString());
})
)
.command(
@@ -61,7 +61,7 @@ public class AddonsCommandAddon implements AddonInitializer {
.append('@')
.append(versions.getFormatted())
.append('\n'));
context.getSender().sendMessage(addonInfo.toString());
context.sender().sendMessage(addonInfo.toString());
})
);
});