lot of progress
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package us.ajg0702.queue.api;
|
||||
|
||||
import us.ajg0702.queue.api.commands.ICommandSender;
|
||||
import us.ajg0702.queue.api.players.AdaptedPlayer;
|
||||
import us.ajg0702.queue.api.players.QueuePlayer;
|
||||
import us.ajg0702.queue.api.queues.QueueServer;
|
||||
@@ -23,4 +24,11 @@ public interface PlatformMethods {
|
||||
*/
|
||||
void sendPluginMessage(AdaptedPlayer player, String channel, String... data);
|
||||
|
||||
/**
|
||||
* Converts a command sender to an AdaptedPlayer
|
||||
* @param sender the commandsender
|
||||
* @return the AdaptedPlayer
|
||||
*/
|
||||
AdaptedPlayer senderToPlayer(ICommandSender sender);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package us.ajg0702.queue.api.commands;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import us.ajg0702.utils.common.Messages;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IBaseCommand {
|
||||
|
||||
String getName();
|
||||
|
||||
ImmutableList<String> getAliases();
|
||||
|
||||
ImmutableList<ISubCommand> getSubCommands();
|
||||
|
||||
String getPermission();
|
||||
|
||||
Messages getMessages();
|
||||
|
||||
void addSubCommand(ISubCommand subCommand);
|
||||
|
||||
void execute(ICommandSender ssender, String[] args);
|
||||
|
||||
List<String> autoComplete(ICommandSender sender, String[] args);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package us.ajg0702.queue.api.commands;
|
||||
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import us.ajg0702.queue.api.util.Handle;
|
||||
|
||||
public interface ICommandSender extends Handle, Audience {
|
||||
boolean hasPermission(String permission);
|
||||
boolean isPlayer();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package us.ajg0702.queue.api.commands;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISubCommand extends IBaseCommand {
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package us.ajg0702.queue.api.players;
|
||||
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import us.ajg0702.queue.api.server.AdaptedServer;
|
||||
import us.ajg0702.queue.api.util.Handle;
|
||||
@@ -9,7 +10,7 @@ import java.util.UUID;
|
||||
/**
|
||||
* Represents a cross-platform player
|
||||
*/
|
||||
public interface AdaptedPlayer extends Handle {
|
||||
public interface AdaptedPlayer extends Handle, Audience {
|
||||
|
||||
/**
|
||||
* Check if the plauer is currently connected
|
||||
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package us.ajg0702.queue.api;
|
||||
package us.ajg0702.queue.api.server;
|
||||
|
||||
import us.ajg0702.queue.api.queues.QueueServer;
|
||||
import us.ajg0702.queue.api.server.AdaptedServer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ServerBuilder {
|
||||
List<QueueServer> getServers();
|
||||
List<QueueServer> buildServers();
|
||||
|
||||
AdaptedServer getServer(String name);
|
||||
|
||||
QueueServer buildGroup(String name, List<AdaptedServer> servers);
|
||||
}
|
||||
Reference in New Issue
Block a user