Added /ajq pausequeueserver command, which will temporarily not queue you when you are in queue-servers
This commit is contained in:
+9
@@ -2,11 +2,14 @@ package us.ajg0702.queue.platforms.velocity.commands;
|
||||
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.ConsoleCommandSource;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import us.ajg0702.queue.api.commands.ICommandSender;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class VelocitySender implements ICommandSender {
|
||||
|
||||
final CommandSource handle;
|
||||
@@ -26,6 +29,12 @@ public class VelocitySender implements ICommandSender {
|
||||
return !(handle instanceof ConsoleCommandSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getUniqueId() throws IllegalStateException {
|
||||
if(!(handle instanceof Player)) throw new IllegalStateException("Cannot get UUID of non-player!");
|
||||
return ((Player) handle).getUniqueId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(@NotNull Component message) {
|
||||
if(PlainTextComponentSerializer.plainText().serialize(message).isEmpty()) return;
|
||||
|
||||
+14
@@ -18,6 +18,7 @@ import us.ajg0702.queue.common.QueueMain;
|
||||
import us.ajg0702.queue.common.utils.Debug;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -205,4 +206,17 @@ public class VelocityPlayer implements AdaptedPlayer, Audience {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
VelocityPlayer that = (VelocityPlayer) o;
|
||||
return handle.equals(that.handle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(handle);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user