Update Guilds module (wip)

This commit is contained in:
2026-05-28 17:07:38 -04:00
parent 3fa3cdfc39
commit e1a6884db7
27 changed files with 693 additions and 488 deletions
@@ -2,7 +2,6 @@ package dev.plex.command.sub;
import com.google.common.collect.ImmutableList;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.guild.Guild;
import dev.plex.guild.data.GuildRole;
@@ -19,7 +18,7 @@ import java.util.List;
import java.util.Objects;
import java.util.UUID;
public class AcceptSubCommand extends SimplePlexCommand
public class AcceptSubCommand extends GuildSubCommand
{
public AcceptSubCommand()
{
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.guild.data.Member;
import java.util.Collections;
@@ -16,7 +15,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class ChatSubCommand extends SimplePlexCommand
public class ChatSubCommand extends GuildSubCommand
{
public ChatSubCommand()
{
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.guild.Guild;
import java.util.Collections;
@@ -13,7 +12,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class CreateSubCommand extends SimplePlexCommand
public class CreateSubCommand extends GuildSubCommand
{
public CreateSubCommand()
{
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.storage.entity.GuildInviteEntity;
import net.kyori.adventure.text.Component;
@@ -12,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.UUID;
public class DenySubCommand extends SimplePlexCommand
public class DenySubCommand extends GuildSubCommand
{
public DenySubCommand()
{
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import net.kyori.adventure.text.Component;
import org.bukkit.command.CommandSender;
@@ -9,7 +8,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class DisbandSubCommand extends SimplePlexCommand
public class DisbandSubCommand extends GuildSubCommand
{
public DisbandSubCommand()
{
@@ -0,0 +1,28 @@
package dev.plex.command.sub;
import dev.plex.command.CommandSpec;
import dev.plex.command.SimplePlexCommand;
import java.util.List;
import net.kyori.adventure.text.Component;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public abstract class GuildSubCommand extends SimplePlexCommand
{
protected GuildSubCommand(CommandSpec commandSpec)
{
super(commandSpec);
}
public final Component executeSubCommand(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
{
return execute(sender, player, args);
}
public final @NotNull List<String> suggestSubCommand(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args)
{
return suggestions(sender, alias, args);
}
}
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import java.util.Collections;
import java.util.List;
@@ -11,7 +10,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class HomeSubCommand extends SimplePlexCommand
public class HomeSubCommand extends GuildSubCommand
{
public HomeSubCommand()
{
@@ -2,7 +2,6 @@ package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.api.player.PlexPlayerView;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.guild.Guild;
import java.time.format.DateTimeFormatter;
@@ -16,7 +15,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class InfoSubCommand extends SimplePlexCommand
public class InfoSubCommand extends GuildSubCommand
{
public InfoSubCommand()
{
@@ -2,7 +2,6 @@ package dev.plex.command.sub;
import com.google.common.collect.ImmutableList;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import net.kyori.adventure.text.Component;
import org.bukkit.command.CommandSender;
@@ -14,7 +13,7 @@ import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.List;
public class InviteSubCommand extends SimplePlexCommand
public class InviteSubCommand extends GuildSubCommand
{
public InviteSubCommand()
{
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.guild.data.Member;
import net.kyori.adventure.text.Component;
@@ -12,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.Objects;
public class LeaveSubCommand extends SimplePlexCommand
public class LeaveSubCommand extends GuildSubCommand
{
public LeaveSubCommand()
{
@@ -2,7 +2,6 @@ package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.api.player.PlexPlayerView;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.guild.data.GuildRole;
import dev.plex.guild.data.Member;
@@ -14,7 +13,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class OwnerSubCommand extends SimplePlexCommand
public class OwnerSubCommand extends GuildSubCommand
{
public OwnerSubCommand()
{
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.util.GuildUtil;
import java.util.Collections;
@@ -13,7 +12,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class PrefixSubCommand extends SimplePlexCommand
public class PrefixSubCommand extends GuildSubCommand
{
public PrefixSubCommand()
{
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.util.CustomLocation;
import java.util.Collections;
@@ -12,7 +11,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SetHomeSubCommand extends SimplePlexCommand
public class SetHomeSubCommand extends GuildSubCommand
{
public SetHomeSubCommand()
{
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.util.CustomLocation;
import java.util.Collections;
@@ -14,7 +13,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SetWarpSubCommand extends SimplePlexCommand
public class SetWarpSubCommand extends GuildSubCommand
{
public SetWarpSubCommand()
{
@@ -2,7 +2,6 @@ package dev.plex.command.sub;
import com.google.common.collect.Lists;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.guild.Guild;
import java.util.Collections;
@@ -14,7 +13,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class WarpListSubCommand extends SimplePlexCommand
public class WarpListSubCommand extends GuildSubCommand
{
public WarpListSubCommand()
{
@@ -1,7 +1,6 @@
package dev.plex.command.sub;
import dev.plex.Guilds;
import dev.plex.command.SimplePlexCommand;
import dev.plex.command.source.RequiredCommandSource;
import java.util.Collections;
import java.util.List;
@@ -12,7 +11,7 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class WarpSubCommand extends SimplePlexCommand
public class WarpSubCommand extends GuildSubCommand
{
public WarpSubCommand()
{