From 74365780a7547850146924b1461e02a1423001f7 Mon Sep 17 00:00:00 2001 From: NEZNAMY Date: Sat, 23 Nov 2024 14:27:26 +0100 Subject: [PATCH] [Code style] Minor fixes from PR --- .../api/integration/VanishIntegration.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/api/src/main/java/me/neznamy/tab/api/integration/VanishIntegration.java b/api/src/main/java/me/neznamy/tab/api/integration/VanishIntegration.java index 7fa52862e..9a07cec07 100644 --- a/api/src/main/java/me/neznamy/tab/api/integration/VanishIntegration.java +++ b/api/src/main/java/me/neznamy/tab/api/integration/VanishIntegration.java @@ -1,23 +1,24 @@ package me.neznamy.tab.api.integration; import lombok.Getter; +import lombok.RequiredArgsConstructor; import me.neznamy.tab.api.TabPlayer; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; +import java.util.Collections; import java.util.List; @Getter +@RequiredArgsConstructor public abstract class VanishIntegration { - // Name of the plugin this integration is associated with - @NotNull - String plugin; + /** List of all registered VanishIntegration handlers */ + private static final List HANDLERS = new ArrayList<>(); - // Constructor to initialize the plugin name - public VanishIntegration(@NotNull String plugin) { - this.plugin = plugin; - } + /** Name of the plugin this integration is associated with */ + @NotNull + private final String plugin; /** * Determines if a viewer can see a target player. @@ -73,15 +74,12 @@ public static void unregisterHandler(VanishIntegration handler) { HANDLERS.remove(handler); } - // A list of all registered VanishIntegration handlers - private static final List HANDLERS = new ArrayList<>(); - /** * Retrieves the list of all registered VanishIntegration handlers. * * @return A list of registered VanishIntegration handlers */ public static List getHandlers() { - return HANDLERS; + return Collections.unmodifiableList(HANDLERS); } }