From 456df87c33a7669538d3ee38ae366348dffc13d3 Mon Sep 17 00:00:00 2001 From: unurled Date: Mon, 18 Mar 2024 21:16:32 +0100 Subject: [PATCH] code refactoring --- .../sr/commands/admin/ClientBuildCommand.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/unurled/sacredrealms/sr/commands/admin/ClientBuildCommand.java b/src/main/java/me/unurled/sacredrealms/sr/commands/admin/ClientBuildCommand.java index 6e36418..be54029 100644 --- a/src/main/java/me/unurled/sacredrealms/sr/commands/admin/ClientBuildCommand.java +++ b/src/main/java/me/unurled/sacredrealms/sr/commands/admin/ClientBuildCommand.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map.Entry; import me.unurled.sacredrealms.sr.components.clientbuild.ClientBuild; import me.unurled.sacredrealms.sr.components.clientbuild.ClientBuildManager; +import me.unurled.sacredrealms.sr.managers.Manager; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.block.data.BlockData; @@ -180,8 +181,7 @@ public class ClientBuildCommand implements TabExecutor, Listener { return true; } - ClientBuildManager clientBuildManager = - ClientBuildManager.getInstance(ClientBuildManager.class); + ClientBuildManager clientBuildManager = Manager.getInstance(ClientBuildManager.class); if (args.length == 1) { if (args[0].equalsIgnoreCase("list")) { list(sender, clientBuildManager); @@ -252,7 +252,7 @@ public class ClientBuildCommand implements TabExecutor, Listener { /** * Requests a list of possible completions for a command argument. * - * @param sender Source of the command. For players tab-completing a command inside of a command + * @param sender Source of the command. For players tab-completing a command inside a command * block, this will be the player, not the command block. * @param command Command which was executed * @param label Alias of the command which was used @@ -273,8 +273,7 @@ public class ClientBuildCommand implements TabExecutor, Listener { && (args[0].equalsIgnoreCase(DELETE) || args[0].equalsIgnoreCase(MODIFY) || args[0].equalsIgnoreCase(DISPLAY))) { - ClientBuildManager clientBuildManager = - ClientBuildManager.getInstance(ClientBuildManager.class); + ClientBuildManager clientBuildManager = Manager.getInstance(ClientBuildManager.class); List buildNames = clientBuildManager.getBuildNames(); if (nameCompletions.isEmpty() || !new HashSet<>(nameCompletions).containsAll(buildNames)) { nameCompletions = buildNames;