From 71eb53c38f9e06da859f1518aa6b5299505d4446 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 2 Aug 2018 16:45:56 +0200 Subject: [PATCH] Add documentation --- .../IWorldGuardImplementation.java | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/implementation/interface/src/main/java/org/codemc/worldguardwrapper/implementation/IWorldGuardImplementation.java b/implementation/interface/src/main/java/org/codemc/worldguardwrapper/implementation/IWorldGuardImplementation.java index 01dc719..d70ef36 100644 --- a/implementation/interface/src/main/java/org/codemc/worldguardwrapper/implementation/IWorldGuardImplementation.java +++ b/implementation/interface/src/main/java/org/codemc/worldguardwrapper/implementation/IWorldGuardImplementation.java @@ -10,15 +10,54 @@ import lombok.NonNull; public interface IWorldGuardImplementation { + /** + * Get an instance of the WorldGuardPlugin class + * + * @return The WorldGuard plugin + */ JavaPlugin getWorldGuardPlugin(); + /** + * Get the API version of the loaded WorldGuard plugin (e.g. 6 or 7). + * + * @return The API version + */ int getApiVersion(); - - Optional queryStateFlag(Player player, @NonNull Location location, @NonNull String flagId); - boolean registerStateFlag(@NonNull String flagId, @NonNull Boolean defaultValue); + /** + * Query a StateFlag's value for a given player at a given location. + * + * @param player The player + * @param location The location + * @param flag The flag's name + * @return The flag's value + */ + Optional queryStateFlag(Player player, @NonNull Location location, @NonNull String flagName); + /** + * Register a {@code StateFlag}. + * + * @param flagName The name of the flag + * @param defaultValue The flag's default value + * @return Whether the flag has been registered + */ + boolean registerStateFlag(@NonNull String flagName, @NonNull Boolean defaultValue); + + /** + * Query a flag's value for a given player at a given location. + * + * @param player The player + * @param location The location + * @param flag The flag + * @return The flag's value + */ Optional queryFlag(Player player, @NonNull Location location, @NonNull AbstractFlag flag); + /** + * Register a flag to WorldGuard's flag registry. + * + * @param flag The flag to register + * @return Whether the flag has been registered + */ boolean registerFlag(@NonNull AbstractFlag flag); }