This commit is contained in:
ajgeiss0702
2021-07-29 14:28:09 -07:00
parent 07721809fb
commit bbf644109b
8 changed files with 15 additions and 23 deletions
@@ -20,6 +20,7 @@ public class BaseCommand implements IBaseCommand {
return null;
}
@SuppressWarnings("unused")
@Override
public ImmutableList<ISubCommand> getSubCommands() {
return null;
@@ -35,6 +36,7 @@ public class BaseCommand implements IBaseCommand {
return null;
}
@SuppressWarnings("unused")
@Override
public void addSubCommand(ISubCommand subCommand) {
@@ -14,12 +14,11 @@ import us.ajg0702.utils.common.TimeUtils;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
public class QueueManagerImpl implements QueueManager {
private List<QueueServer> servers = new ArrayList<>();
private final List<QueueServer> servers = new ArrayList<>();
private final QueueMain main;
private final Messages msgs;
@@ -283,7 +282,6 @@ public class QueueManagerImpl implements QueueManager {
@Override
public void sendMessages() {
if(servers == null) return;
try {
for(QueueServer server : servers) {
for(QueuePlayer queuePlayer : server.getQueue()) {
@@ -109,6 +109,7 @@ public class TaskManager {
return scheduleAtFixedRate(executor, command, 0, period, unit);
}
@SuppressWarnings("UnusedReturnValue")
public ScheduledFuture<?> runLater(Runnable runnable, long delay, TimeUnit unit) {
return executor.schedule(runnable, delay, unit);
}
@@ -28,18 +28,14 @@ import java.util.List;
public class BungeeQueue extends Plugin implements Listener {
private QueueLogger logger;
private QueueMain main;
private File dataFolder;
List<IBaseCommand> commands;
@Override
public void onEnable() {
logger = new BungeeLogger(getLogger());
dataFolder = getDataFolder();
QueueLogger logger = new BungeeLogger(getLogger());
File dataFolder = getDataFolder();
main = new QueueMain(
logger,
@@ -60,7 +56,7 @@ public class BungeeQueue extends Plugin implements Listener {
for(IBaseCommand command : commands) {
getProxy().getPluginManager()
.registerCommand(this, new BungeeCommand(main, (BaseCommand) command));
.registerCommand(this, new BungeeCommand((BaseCommand) command));
}
getProxy().getPluginManager().registerListener(this, this);
@@ -5,14 +5,11 @@ import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.plugin.Command;
import net.md_5.bungee.api.plugin.TabExecutor;
import us.ajg0702.queue.commands.BaseCommand;
import us.ajg0702.queue.common.QueueMain;
public class BungeeCommand extends Command implements TabExecutor {
QueueMain main;
BaseCommand command;
public BungeeCommand(QueueMain main, BaseCommand command) {
final BaseCommand command;
public BungeeCommand(BaseCommand command) {
super(command.getName(), command.getPermission(), command.getAliases().toArray(new String[0]));
this.main = main;
this.command = command;
}
@@ -2,12 +2,8 @@ package us.ajg0702.queue.platforms.bungeecord.players;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.chat.BaseComponentSerializer;
import org.jetbrains.annotations.NotNull;
import us.ajg0702.queue.api.players.AdaptedPlayer;
import us.ajg0702.queue.api.server.AdaptedServer;
+2 -2
View File
@@ -35,11 +35,11 @@ tasks.withType<ProcessResources> {
}
tasks.jar {
exclude("**/*.java");
exclude("**/*.java")
}
tasks.compileJava {
source = tasks.getByName("processResources").outputs.files.asFileTree;
source = tasks.getByName("processResources").outputs.files.asFileTree
}
@@ -118,7 +118,8 @@ public class Placeholders extends PlaceholderExpansion {
*
* @return possibly-null String of the requested identifier.
*/
@Override
@SuppressWarnings("SuspiciousMethodCalls")
@Override
public String onPlaceholderRequest(Player player, final String identifier){
//Bukkit.getLogger().info("itentifier: "+identifier);
@@ -180,7 +181,8 @@ public class Placeholders extends PlaceholderExpansion {
return null;
}
private String parsePlaceholder(Player player, String identifier) {
@SuppressWarnings("SameReturnValue")
private String parsePlaceholder(Player player, String identifier) {
if(identifier.equalsIgnoreCase("queued")) {
plugin.sendMessage(player, "queuename", "");
}