mirror of
https://github.com/plexusorg/Module-Guilds.git
synced 2026-06-05 11:16:54 +00:00
Compatibility with newer versions of Plex
This commit is contained in:
@@ -6,7 +6,6 @@ import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.guild.Guild;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -15,13 +14,14 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "create", aliases = "make", usage = "/guild <command> <name>", description = "Creates a guild with a specified name")
|
||||
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.IN_GAME, permission = "plex.guilds.create")
|
||||
@CommandPermissions(source = RequiredCommandSource.IN_GAME, permission = "plex.guilds.create")
|
||||
public class CreateSubCommand extends PlexCommand
|
||||
{
|
||||
public CreateSubCommand()
|
||||
{
|
||||
super(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender commandSender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -34,7 +34,8 @@ public class CreateSubCommand extends PlexCommand
|
||||
{
|
||||
return messageComponent("alreadyInGuild");
|
||||
}
|
||||
Guilds.get().getSqlGuildManager().insertGuild(Guild.create(player, StringUtils.join(args, " "))).whenComplete((guild, throwable) -> {
|
||||
Guilds.get().getSqlGuildManager().insertGuild(Guild.create(player, StringUtils.join(args, " "))).whenComplete((guild, throwable) ->
|
||||
{
|
||||
Guilds.get().getGuildHolder().addGuild(guild);
|
||||
send(player, mmString("Created guild named " + guild.getName()));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user