the basics are working on velocity now
This commit is contained in:
+5
-1
@@ -9,6 +9,8 @@ import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import us.ajg0702.queue.commands.BaseCommand;
|
||||
import us.ajg0702.queue.commands.commands.leavequeue.LeaveCommand;
|
||||
import us.ajg0702.queue.commands.commands.listqueues.ListCommand;
|
||||
import us.ajg0702.queue.commands.commands.manage.ManageCommand;
|
||||
import us.ajg0702.queue.commands.commands.queue.QueueCommand;
|
||||
import us.ajg0702.queue.common.QueueMain;
|
||||
import us.ajg0702.queue.platforms.velocity.commands.VelocityCommand;
|
||||
@@ -59,7 +61,9 @@ public class VelocityQueue {
|
||||
|
||||
List<BaseCommand> commands = Arrays.asList(
|
||||
new QueueCommand(main),
|
||||
new LeaveCommand(main)
|
||||
new LeaveCommand(main),
|
||||
new ListCommand(main),
|
||||
new ManageCommand(main)
|
||||
);
|
||||
|
||||
for(BaseCommand command : commands) {
|
||||
|
||||
+2
-1
@@ -1,11 +1,11 @@
|
||||
package us.ajg0702.queue.platforms.velocity.players;
|
||||
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import com.velocitypowered.api.proxy.ServerConnection;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
import us.ajg0702.queue.api.players.AdaptedPlayer;
|
||||
import us.ajg0702.queue.api.server.AdaptedServer;
|
||||
|
||||
@@ -27,6 +27,7 @@ public class VelocityPlayer implements AdaptedPlayer, Audience {
|
||||
|
||||
@Override
|
||||
public void sendMessage(Component message) {
|
||||
if(PlainTextComponentSerializer.plainText().serialize(message).isEmpty()) return;
|
||||
handle.sendMessage(message);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -27,14 +27,14 @@ public class VelocityServerPing implements AdaptedServerPing {
|
||||
@Override
|
||||
public int getPlayerCount() {
|
||||
Optional<ServerPing.Players> players = handle.getPlayers();
|
||||
if(players.isPresent()) return 0;
|
||||
if(!players.isPresent()) return 0;
|
||||
return players.get().getOnline();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxPlayers() {
|
||||
Optional<ServerPing.Players> players = handle.getPlayers();
|
||||
if(players.isPresent()) return 0;
|
||||
if(!players.isPresent()) return 0;
|
||||
return players.get().getMax();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user