fix: remove all unused imports, fields, and variables across codebase
This commit is contained in:
@@ -125,7 +125,7 @@ public final class NickCorePlugin extends JavaPlugin {
|
||||
Bukkit.getPluginManager().registerEvents(chatService, this);
|
||||
Bukkit.getPluginManager().registerEvents(guiManager, this);
|
||||
Bukkit.getPluginManager().registerEvents(
|
||||
new CommandPreprocessListener(nameOverrideService, getLogger()), this);
|
||||
new CommandPreprocessListener(nameOverrideService), this);
|
||||
Bukkit.getPluginManager().registerEvents(
|
||||
new TabCompleteListener(nameOverrideService), this);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.nickcore.paper.command;
|
||||
|
||||
import com.nickcore.common.model.NickHistory;
|
||||
import com.nickcore.common.model.NickProfile;
|
||||
import com.nickcore.common.validation.InputSanitizer;
|
||||
import com.nickcore.paper.gui.GuiManager;
|
||||
@@ -39,7 +38,6 @@ public final class NickCommand implements CommandExecutor, TabCompleter {
|
||||
private static final String PERM_RESET = "nickcore.reset";
|
||||
private static final String PERM_RANK = "nickcore.rank.select";
|
||||
private static final String PERM_SKIN = "nickcore.skin.select";
|
||||
private static final String PERM_ADMIN = "nickcore.admin";
|
||||
private static final String PERM_RELOAD = "nickcore.reload";
|
||||
private static final String PERM_FORCE = "nickcore.force";
|
||||
private static final String PERM_INFO = "nickcore.info";
|
||||
|
||||
@@ -54,7 +54,7 @@ public final class GuiManager implements Listener {
|
||||
|
||||
public void openRankMenu(Player player) {
|
||||
RankMenuGui gui = new RankMenuGui(player, this, nickService, rankService,
|
||||
profileCache, placeholderService, nametagService);
|
||||
placeholderService, nametagService);
|
||||
openGuis.put(player.getUniqueId(), gui);
|
||||
gui.open();
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public final class GuiManager implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryClick(InventoryClickEvent event) {
|
||||
if (!(event.getWhoClicked() instanceof Player player)) return;
|
||||
if (!(event.getWhoClicked() instanceof Player)) return;
|
||||
if (!(event.getInventory().getHolder() instanceof AbstractGui gui)) return;
|
||||
gui.handleClick(event);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.nickcore.paper.gui;
|
||||
|
||||
import com.nickcore.common.model.NickProfile;
|
||||
import com.nickcore.common.model.RankDefinition;
|
||||
import com.nickcore.paper.cache.ProfileCache;
|
||||
import com.nickcore.paper.service.NickService;
|
||||
import com.nickcore.paper.service.NametagService;
|
||||
import com.nickcore.paper.service.PlaceholderService;
|
||||
@@ -24,20 +22,18 @@ public final class RankMenuGui extends AbstractGui {
|
||||
private final GuiManager guiManager;
|
||||
private final NickService nickService;
|
||||
private final RankService rankService;
|
||||
private final ProfileCache profileCache;
|
||||
private final PlaceholderService placeholderService;
|
||||
private final NametagService nametagService;
|
||||
private final MiniMessage mm = MiniMessage.miniMessage();
|
||||
private int page = 0;
|
||||
|
||||
public RankMenuGui(Player viewer, GuiManager guiManager, NickService nickService,
|
||||
RankService rankService, ProfileCache profileCache,
|
||||
PlaceholderService placeholderService, NametagService nametagService) {
|
||||
RankService rankService, PlaceholderService placeholderService,
|
||||
NametagService nametagService) {
|
||||
super(viewer, 54, Component.text("Select Rank", NamedTextColor.GOLD, TextDecoration.BOLD));
|
||||
this.guiManager = guiManager;
|
||||
this.nickService = nickService;
|
||||
this.rankService = rankService;
|
||||
this.profileCache = profileCache;
|
||||
this.placeholderService = placeholderService;
|
||||
this.nametagService = nametagService;
|
||||
}
|
||||
|
||||
@@ -9,9 +9,6 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Intercepts player commands and replaces nick names with real names before dispatch.
|
||||
@@ -25,14 +22,9 @@ import java.util.regex.Pattern;
|
||||
public final class CommandPreprocessListener implements Listener {
|
||||
|
||||
private final NameOverrideService nameOverrideService;
|
||||
private final Logger logger;
|
||||
|
||||
/** Pattern to split command into parts while preserving structure. */
|
||||
private static final Pattern WORD_BOUNDARY = Pattern.compile("\\s+");
|
||||
|
||||
public CommandPreprocessListener(NameOverrideService nameOverrideService, Logger logger) {
|
||||
public CommandPreprocessListener(NameOverrideService nameOverrideService) {
|
||||
this.nameOverrideService = Objects.requireNonNull(nameOverrideService);
|
||||
this.logger = Objects.requireNonNull(logger);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.nickcore.paper.listener;
|
||||
|
||||
import com.nickcore.common.model.NickProfile;
|
||||
import com.nickcore.common.validation.InputSanitizer;
|
||||
import com.nickcore.paper.service.*;
|
||||
import com.nickcore.paper.scheduler.SchedulerAdapter;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@@ -29,7 +26,6 @@ public final class PlayerConnectionListener implements Listener {
|
||||
private final NameOverrideService nameOverrideService;
|
||||
private final SchedulerAdapter scheduler;
|
||||
private final Logger logger;
|
||||
private final MiniMessage mm = MiniMessage.miniMessage();
|
||||
|
||||
public PlayerConnectionListener(Plugin plugin, NickService nickService,
|
||||
SkinService skinService, PlaceholderService placeholderService,
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.nickcore.common.model.NickProfile;
|
||||
import com.nickcore.paper.cache.ProfileCache;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -28,7 +27,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
public final class NameOverrideService {
|
||||
|
||||
private final ProfileCache profileCache;
|
||||
private final MiniMessage miniMessage = MiniMessage.miniMessage();
|
||||
|
||||
/** nick (lowercase) -> real player UUID */
|
||||
private final ConcurrentHashMap<String, UUID> nickToUuid = new ConcurrentHashMap<>(512);
|
||||
|
||||
Reference in New Issue
Block a user