diff --git a/.github/ISSUE_TEMPLATE/addon_suggestion.md b/.github/ISSUE_TEMPLATE/addon_suggestion.md index 62e949d1..8116ce65 100644 --- a/.github/ISSUE_TEMPLATE/addon_suggestion.md +++ b/.github/ISSUE_TEMPLATE/addon_suggestion.md @@ -9,33 +9,43 @@ assignees: 'Euphillya' **English Version** ## Addon Name + *What is the proposed name of the addon?* ## Detailed Description + *Provide a comprehensive description of the addon and its functionalities.* ## Proposed Features + *List and describe the features that this addon would include.* ## Benefits to Users + *Explain how this addon would benefit the users and enhance their experience.* ## Use Case Examples + *Provide specific scenarios or examples where this addon would be useful.* **Version Française** ## Nom de l'Addon + *Quel est le nom proposé pour l'addon ?* ## Description détaillée + *Fournissez une description complète de l'addon et de ses fonctionnalités.* ## Fonctionnalités proposées + *Listez et décrivez les fonctionnalités que cet addon inclurait.* ## Avantages pour les utilisateurs + *Expliquez comment cet addon profiterait aux utilisateurs et améliorerait leur expérience.* ## Exemples d'utilisation + *Fournissez des scénarios ou des exemples spécifiques où cet addon serait utile.* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9bb5ef51..a975499e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,20 +13,24 @@ First off, thank you for considering contributing to Skyllia! It's people like y ### Reporting Bugs -This section guides you through submitting a bug report for Skyllia. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. +This section guides you through submitting a bug report for Skyllia. Following these guidelines helps maintainers and +the community understand your report, reproduce the behavior, and find related reports. #### Before Submitting A Bug Report -- **Perform a [search](https://github.com/Euphillya/Skyllia/issues)** to see if the bug has already been reported. If it has, and the issue is still open, add a comment to the existing issue instead of opening a new one. +- **Perform a [search](https://github.com/Euphillya/Skyllia/issues)** to see if the bug has already been reported. If it + has, and the issue is still open, add a comment to the existing issue instead of opening a new one. #### How Do I Submit A (Good) Bug Report? -Bugs are tracked as GitHub issues. Create an issue and provide the following information by filling in the provided template. +Bugs are tracked as GitHub issues. Create an issue and provide the following information by filling in the provided +template. - **Use a clear and descriptive title** for the issue to identify the problem. - **Describe the exact steps which reproduce the problem** in as many details as possible. - **Provide specific examples to demonstrate the steps**. -- **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. +- **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that + behavior. - **Explain which behavior you expected to see instead and why.** - **Include screenshots and animated GIFs** which show the problem and explain how to reproduce the problem. - **If the problem is related to performance or memory**, include a CPU profile capture with your report. @@ -34,15 +38,18 @@ Bugs are tracked as GitHub issues. Create an issue and provide the following inf ### Suggesting Enhancements -This section guides you through submitting an enhancement suggestion for Skyllia, including completely new features and minor improvements to existing functionality. +This section guides you through submitting an enhancement suggestion for Skyllia, including completely new features and +minor improvements to existing functionality. #### Before Submitting An Enhancement Suggestion -- **Perform a [search](https://github.com/Euphillya/Skyllia/issues)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +- **Perform a [search](https://github.com/Euphillya/Skyllia/issues)** to see if the enhancement has already been + suggested. If it has, add a comment to the existing issue instead of opening a new one. #### How Do I Submit A (Good) Enhancement Suggestion? -Enhancement suggestions are tracked as GitHub issues. Create an issue on the repository and provide the following information: +Enhancement suggestions are tracked as GitHub issues. Create an issue on the repository and provide the following +information: - **Use a clear and descriptive title** for the issue to identify the suggestion. - **Provide a step-by-step description of the suggested enhancement** in as many details as possible. @@ -56,7 +63,8 @@ Enhancement suggestions are tracked as GitHub issues. Create an issue on the rep - **Follow the project's coding style**. - **Ensure any install or build dependencies are removed before the end of the layer when doing a build**. - **Update the documentation with the details of the pull request**. -- **Increase the version numbers in any examples files and the README.md to the new version that this pull request would represent**. +- **Increase the version numbers in any examples files and the README.md to the new version that this pull request would + represent**. #### How Do I Submit A (Good) Pull Request? diff --git a/addons/InsightsSkyllia/readme.md b/addons/InsightsSkyllia/readme.md index c35512e5..7bdd460a 100644 --- a/addons/InsightsSkyllia/readme.md +++ b/addons/InsightsSkyllia/readme.md @@ -1,12 +1,18 @@ # SkylliaInsight -**SkylliaInsightAddon** is an addon for the [Insights](https://github.com/InsightsPlugin/Insights) plugin, designed to integrate the Skyllia platform's island management features with Insights' region limiting capabilities. This addon allows server administrators to monitor and enforce limits on player islands, ensuring a balanced and optimized gameplay experience. +**SkylliaInsightAddon** is an addon for the [Insights](https://github.com/InsightsPlugin/Insights) plugin, designed to +integrate the Skyllia platform's island management features with Insights' region limiting capabilities. This addon +allows server administrators to monitor and enforce limits on player islands, ensuring a balanced and optimized gameplay +experience. ## Features -- **Region Integration:** Seamlessly integrates Skyllia islands with Insights, enabling region-based limits on island activities. -- **Custom Limit Configurations:** Utilize Insights' powerful limits configuration to manage tile, group, and permission-based restrictions on islands. -- **Dynamic Region Detection:** Automatically detects island regions based on chunk locations, ensuring accurate limit enforcement. +- **Region Integration:** Seamlessly integrates Skyllia islands with Insights, enabling region-based limits on island + activities. +- **Custom Limit Configurations:** Utilize Insights' powerful limits configuration to manage tile, group, and + permission-based restrictions on islands. +- **Dynamic Region Detection:** Automatically detects island regions based on chunk locations, ensuring accurate limit + enforcement. - **Folia Support:** Optimized for Folia, ensuring enhanced performance on multithreaded servers. - **Permission-Based Access:** Control access to various functionalities with granular permissions for administrators. @@ -17,30 +23,32 @@ - **Insights Plugin:** Required for region limiting and monitoring functionalities. - **Java:** Java 21 is required for optimal performance. - **Dependencies:** - - **SkylliaOre:** Optional, for displaying generator types. - - **SkylliaBankAddon:** Optional, for displaying bank-related information. - - **SkylliaValue:** Optional, for displaying island values (proprietary plugin). + - **SkylliaOre:** Optional, for displaying generator types. + - **SkylliaBankAddon:** Optional, for displaying bank-related information. + - **SkylliaValue:** Optional, for displaying island values (proprietary plugin). ## Installation 1. **Download SkylliaInsightAddon:** - - Obtain the latest version of SkylliaInsightAddon from the [official repository](https://github.com/Euphillya/Skyllia/tree/dev/addons/SkylliaInsight). + - Obtain the latest version of SkylliaInsightAddon from + the [official repository](https://github.com/Euphillya/Skyllia/tree/dev/addons/SkylliaInsight). 2. **Install Dependencies:** - - Ensure that the Skyllia and Insights plugins are installed and properly configured on your server. - - Install any optional dependencies (SkylliaOre, SkylliaBankAddon) if you wish to utilize their features. - - For SkylliaValue, ensure you have the proprietary plugin installed as it is required for displaying island values. + - Ensure that the Skyllia and Insights plugins are installed and properly configured on your server. + - Install any optional dependencies (SkylliaOre, SkylliaBankAddon) if you wish to utilize their features. + - For SkylliaValue, ensure you have the proprietary plugin installed as it is required for displaying island values. 3. **Configure the Plugin:** - - Place the `SkylliaInsightAddon.jar` file into your server's `plugins/Insights/addons/` directory. - - Ensure that the `Insights` plugin is properly configured according to your server's requirements. + - Place the `SkylliaInsightAddon.jar` file into your server's `plugins/Insights/addons/` directory. + - Ensure that the `Insights` plugin is properly configured according to your server's requirements. 4. **Restart the Server:** - - Restart your Minecraft server to load the SkylliaInsight plugin. + - Restart your Minecraft server to load the SkylliaInsight plugin. ## Usage -SkylliaInsight works in the background to integrate Skyllia islands with Insights' region limiting system. Administrators can manage and configure limits through the Insights configuration files. +SkylliaInsight works in the background to integrate Skyllia islands with Insights' region limiting system. +Administrators can manage and configure limits through the Insights configuration files. ### Setting Up Limits @@ -119,7 +127,8 @@ limit: ## Configuration -Customize the limits and how they apply to Skyllia islands by editing the `limits.yml` file in the Insights plugin directory. Below is an overview of the configuration options: +Customize the limits and how they apply to Skyllia islands by editing the `limits.yml` file in the Insights plugin +directory. Below is an overview of the configuration options: ### Basic Layout @@ -158,7 +167,8 @@ For support, please join our [Discord server](https://discord.gg/uUJQEB7XNN). ## Contributing -Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull request. +Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull +request. ## License diff --git a/addons/InsightsSkyllia/src/main/java/fr/euphyllia/skyllia_insight_addon/SkylliaInsightAddon.java b/addons/InsightsSkyllia/src/main/java/fr/euphyllia/skyllia_insight_addon/SkylliaInsightAddon.java index 827381bd..9b9943d9 100644 --- a/addons/InsightsSkyllia/src/main/java/fr/euphyllia/skyllia_insight_addon/SkylliaInsightAddon.java +++ b/addons/InsightsSkyllia/src/main/java/fr/euphyllia/skyllia_insight_addon/SkylliaInsightAddon.java @@ -44,32 +44,12 @@ public class SkylliaRegion implements Region { private final Island island; private final World world; + public SkylliaRegion(Island island, World world) { this.island = island; this.world = world; } - @Override - public String getAddon() { - return getPluginName(); - } - - @Override - public String getKey() { - return "SKYLLIA_%s".formatted(this.island.getId()); - } - - @Override - public List toChunkParts() { - List parts = new ArrayList<>(); - - for (Position position : spiralStartCenter(island.getPosition(), island.getSize())) { - parts.add(new ChunkPart(new ChunkLocation(world, position.x(), position.z()))); - } - return parts; - } - - public static List spiralStartCenter(Position islandRegion, double size) { List positions = new ArrayList<>(); @@ -104,5 +84,25 @@ public static List spiralStartCenter(Position islandRegion, double siz } return positions; } + + @Override + public String getAddon() { + return getPluginName(); + } + + @Override + public String getKey() { + return "SKYLLIA_%s".formatted(this.island.getId()); + } + + @Override + public List toChunkParts() { + List parts = new ArrayList<>(); + + for (Position position : spiralStartCenter(island.getPosition(), island.getSize())) { + parts.add(new ChunkPart(new ChunkLocation(world, position.x(), position.z()))); + } + return parts; + } } } \ No newline at end of file diff --git a/addons/PapiSkyllia/readme.md b/addons/PapiSkyllia/readme.md index 72f68d1b..14b52c42 100644 --- a/addons/PapiSkyllia/readme.md +++ b/addons/PapiSkyllia/readme.md @@ -1,6 +1,9 @@ # Skyllia PlaceholderAPI Expansion -**Skyllia Placeholder** is an expansion for [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/) that integrates with the Skyllia Plugin, providing dynamic placeholders to enhance in-game displays such as scoreboards, chat messages, and more. This expansion offers placeholders related to island management, permissions, game rules, and integrates with optional addons like SkylliaOre, SkylliaValue, and SkylliaBank. +**Skyllia Placeholder** is an expansion for [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/) +that integrates with the Skyllia Plugin, providing dynamic placeholders to enhance in-game displays such as scoreboards, +chat messages, and more. This expansion offers placeholders related to island management, permissions, game rules, and +integrates with optional addons like SkylliaOre, SkylliaValue, and SkylliaBank. ## Table of Contents @@ -8,15 +11,15 @@ - [Prerequisites](#prerequisites) - [Installation](#installation) - [Available Placeholders](#available-placeholders) - - [Island Placeholders](#island-placeholders) - - [Permissions Placeholders](#permissions-placeholders) - - [Game Rules Placeholders](#game-rules-placeholders) - - [Addon Placeholders](#addon-placeholders) + - [Island Placeholders](#island-placeholders) + - [Permissions Placeholders](#permissions-placeholders) + - [Game Rules Placeholders](#game-rules-placeholders) + - [Addon Placeholders](#addon-placeholders) - [Usage](#usage) - [Addons](#addons) - - [SkylliaOre](#skylliaore) - - [SkylliaValue](#skylliavalue) - - [SkylliaBank](#skylliabank) + - [SkylliaOre](#skylliaore) + - [SkylliaValue](#skylliavalue) + - [SkylliaBank](#skylliabank) - [Contributing](#contributing) - [License](#license) @@ -25,7 +28,8 @@ - **Island Information**: Retrieve dynamic data about a player's Skyblock island. - **Permissions Status**: Check and display the status of various permissions. - **Game Rules Status**: Display the status of game rules applied to an island. -- **Addon Integration**: Extend functionality with placeholders from optional addons like Ore management, Value tracking, and Banking systems. +- **Addon Integration**: Extend functionality with placeholders from optional addons like Ore management, Value + tracking, and Banking systems. - **Efficient Caching**: Utilizes caching mechanisms to optimize performance and reduce server load. ## Prerequisites @@ -36,25 +40,28 @@ Before installing Skyllia Placeholder, ensure that the following prerequisites a - **Skyllia Plugin**: Ensure that the Skyllia Plugin is installed and properly configured on your server. - **PlaceholderAPI**: Install [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/) on your server. - **Addons (Optional)**: Depending on the placeholders you intend to use, install the following addons: - - [SkylliaOre](#skylliaore) - - [SkylliaValue](#skylliavalue) - - [SkylliaBank](#skylliabank) + - [SkylliaOre](#skylliaore) + - [SkylliaValue](#skylliavalue) + - [SkylliaBank](#skylliabank) ## Installation 1. **Download**: - - Obtain the latest `PapiSkyllia-1.x.x-all.jar` from the [releases](https://github.com/Euphillya/Skyllia/actions) page of the Skyllia Placeholder repository. + - Obtain the latest `PapiSkyllia-1.x.x-all.jar` from the [releases](https://github.com/Euphillya/Skyllia/actions) + page of the Skyllia Placeholder repository. 2. **Installation**: - - Place the `PapiSkyllia-1.x.x-all.jar` file into your server's `plugins/PlaceholderAPI/expansions` directory. - - Start or restart your server to generate the necessary configuration files and load the expansion. + - Place the `PapiSkyllia-1.x.x-all.jar` file into your server's `plugins/PlaceholderAPI/expansions` directory. + - Start or restart your server to generate the necessary configuration files and load the expansion. 3. **Enable Expansion**: - - Skyllia Placeholder automatically registers itself with PlaceholderAPI upon server startup. Ensure there are no errors in the server console related to the expansion. + - Skyllia Placeholder automatically registers itself with PlaceholderAPI upon server startup. Ensure there are no + errors in the server console related to the expansion. ## Available Placeholders -Skyllia Placeholder provides a variety of placeholders categorized into Island, Permissions, Game Rules, and Addon-specific placeholders. +Skyllia Placeholder provides a variety of placeholders categorized into Island, Permissions, Game Rules, and +Addon-specific placeholders. ### Island Placeholders @@ -98,9 +105,9 @@ Extend functionality with placeholders from optional addons. #### SkylliaOre Addon -| **Placeholder** | **Description** | -|--------------------------------------|---------------------------------------------------------------| -| `%skyllia_ore_generator_name%` | Returns the name of the ore generator on the island. | +| **Placeholder** | **Description** | +|--------------------------------|------------------------------------------------------| +| `%skyllia_ore_generator_name%` | Returns the name of the ore generator on the island. | #### SkylliaValue Addon @@ -140,7 +147,8 @@ Represents various game rules that can be applied to a Skyblock island. ### Permissions -Skyllia utilizes a robust permissions system to control player actions and interactions on their islands. Permissions are categorized into different types: **ISLAND**, **COMMANDS**, and **INVENTORY**. +Skyllia utilizes a robust permissions system to control player actions and interactions on their islands. Permissions +are categorized into different types: **ISLAND**, **COMMANDS**, and **INVENTORY**. #### 1. **Island Permissions (`PermissionsIsland`)** @@ -222,70 +230,71 @@ Controls access to various inventory-related blocks and features on the island. ### Integrating Placeholders 1. **Identify the Placeholder**: - - Determine which placeholder you want to use based on the available placeholders listed above. + - Determine which placeholder you want to use based on the available placeholders listed above. 2. **Insert Placeholder**: - - Use the placeholder in your server's configuration files or within plugins that support PlaceholderAPI. - - **Example**: Adding placeholders to a scoreboard configuration: - ```yaml - lines: - - "Island Size: %skyllia_island_size%" - - "Members: %skyllia_island_members_size%/%skyllia_island_members_max_size%" - - "Rank: %skyllia_island_rank%" - - "TPS: %skyllia_island_tps%" - ``` + - Use the placeholder in your server's configuration files or within plugins that support PlaceholderAPI. + - **Example**: Adding placeholders to a scoreboard configuration: + ```yaml + lines: + - "Island Size: %skyllia_island_size%" + - "Members: %skyllia_island_members_size%/%skyllia_island_members_max_size%" + - "Rank: %skyllia_island_rank%" + - "TPS: %skyllia_island_tps%" + ``` ## Addons -Skyllia Placeholder supports several addons to extend its functionality. Ensure that these addons are installed in your `plugins` directory to utilize their respective placeholders. +Skyllia Placeholder supports several addons to extend its functionality. Ensure that these addons are installed in your +`plugins` directory to utilize their respective placeholders. ### SkylliaOre Enhances ore management on your Skyblock islands by providing placeholders related to ore generation and management. - **Placeholders**: - - `%skyllia_ore_generator_name%` - Returns the name of the ore generator on the island. + - `%skyllia_ore_generator_name%` - Returns the name of the ore generator on the island. ### SkylliaValue Tracks and manages experience and level values for players on their islands. - **Placeholders**: - - `%skyllia_value_experience%` - Displays the player's experience. - - `%skyllia_value_level%` - Displays the player's level based on experience. + - `%skyllia_value_experience%` - Displays the player's experience. + - `%skyllia_value_level%` - Displays the player's level based on experience. ### SkylliaBank Introduces a banking system for players to manage their in-game currency. - **Placeholders**: - - `%skyllia_bank_live%` - Shows the live balance in the player's bank account. - - `%skyllia_bank_cached%` - Shows the cached balance for performance optimization. + - `%skyllia_bank_live%` - Shows the live balance in the player's bank account. + - `%skyllia_bank_cached%` - Shows the cached balance for performance optimization. ## Contributing Contributions are welcome! To contribute to Skyllia Placeholder, please follow these steps: 1. **Fork the Repository**: - - Click the "Fork" button on the repository page to create your own copy. + - Click the "Fork" button on the repository page to create your own copy. 2. **Create a New Branch**: - - ```bash - git checkout -b feature/YourFeature + - ```bash + git checkout -b feature/YourFeature ``` 3. **Commit Your Changes**: - - ```bash - git commit -am 'Add some feature' + - ```bash + git commit -am 'Add some feature' ``` 4. **Push to the Branch**: - - ```bash - git push origin feature/YourFeature + - ```bash + git push origin feature/YourFeature ``` 5. **Open a Pull Request**: - - Navigate to your forked repository and click "Compare & pull request". + - Navigate to your forked repository and click "Compare & pull request". Please ensure that your contributions adhere to the project's coding standards and include appropriate documentation. diff --git a/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/PlaceholderProcessor.java b/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/PlaceholderProcessor.java index e3fcc908..4325c59b 100644 --- a/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/PlaceholderProcessor.java +++ b/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/PlaceholderProcessor.java @@ -59,13 +59,6 @@ public class PlaceholderProcessor { * Indicates if the SkylliaBank addon is enabled. */ private static final boolean SKYLLIA_BANK_ADDON; - - static { - SKYLLIA_ORE_ADDON = Bukkit.getPluginManager().getPlugin("SkylliaOre") != null; - SKYLLIA_VALUE_ADDON = Bukkit.getPluginManager().getPlugin("SkylliaValue") != null; - SKYLLIA_BANK_ADDON = Bukkit.getPluginManager().getPlugin("SkylliaBank") != null; - } - /** * Cache that maps a player's UUID to their island. *

@@ -99,7 +92,6 @@ public class PlaceholderProcessor { return CompletableFuture.supplyAsync(() -> loadIslandByUUID(playerId), executor); } }); - /** * Cache that stores the final result of a placeholder (String) based on the playerId and the placeholder. * Uses the same expiration and refresh logic as {@link #ISLAND_CACHE}. @@ -137,6 +129,12 @@ public class PlaceholderProcessor { } }); + static { + SKYLLIA_ORE_ADDON = Bukkit.getPluginManager().getPlugin("SkylliaOre") != null; + SKYLLIA_VALUE_ADDON = Bukkit.getPluginManager().getPlugin("SkylliaValue") != null; + SKYLLIA_BANK_ADDON = Bukkit.getPluginManager().getPlugin("SkylliaBank") != null; + } + /** * Entry point for retrieving a placeholder value. * @@ -191,8 +189,8 @@ public static String process(UUID playerId, String placeholder) { /** * Processes placeholders related to the player's island. * - * @param islandOpt the player's island wrapped in an {@link Optional} - * @param playerId the player's UUID + * @param islandOpt the player's island wrapped in an {@link Optional} + * @param playerId the player's UUID * @param placeholder the placeholder to process * @return the placeholder value as a string */ @@ -230,8 +228,8 @@ private static String processIsland(Optional islandOpt, UUID playerId, S /** * Processes placeholders related to permissions. * - * @param island the player's island - * @param playerId the player's UUID + * @param island the player's island + * @param playerId the player's UUID * @param placeholder the placeholder to process * @return the placeholder value as a string */ @@ -286,7 +284,7 @@ private static String processPermissionsPlaceholder(Island island, UUID playerId /** * Processes placeholders related to game rules. * - * @param island the player's island + * @param island the player's island * @param placeholder the placeholder to process * @return the placeholder value as a string */ @@ -313,8 +311,9 @@ private static String processGamerulePlaceholder(Island island, String placehold /** * Record representing a cache key with playerId and placeholder. * - * @param playerId the player's UUID + * @param playerId the player's UUID * @param placeholder the placeholder string */ - private record CacheKey(UUID playerId, String placeholder) {} + private record CacheKey(UUID playerId, String placeholder) { + } } diff --git a/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/BankPlaceHolder.java b/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/BankPlaceHolder.java index 3ae91da2..88fe3374 100644 --- a/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/BankPlaceHolder.java +++ b/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/BankPlaceHolder.java @@ -82,8 +82,8 @@ private static String getLiveBalance(Island island) { /** * Processes bank-related placeholders. * - * @param island the player's island - * @param playerId the player's UUID + * @param island the player's island + * @param playerId the player's UUID * @param placeholder the placeholder to process * @return the placeholder value as a string */ diff --git a/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/OrePlaceHolder.java b/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/OrePlaceHolder.java index cba664c3..5dd61a79 100644 --- a/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/OrePlaceHolder.java +++ b/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/OrePlaceHolder.java @@ -11,8 +11,8 @@ public class OrePlaceHolder { /** * Processes ore-related placeholders. * - * @param island the player's island - * @param playerId the player's UUID + * @param island the player's island + * @param playerId the player's UUID * @param placeholder the placeholder to process * @return the placeholder value as a string */ diff --git a/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/ValuePlaceHolder.java b/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/ValuePlaceHolder.java index 8e53b9c2..2c06c8d1 100644 --- a/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/ValuePlaceHolder.java +++ b/addons/PapiSkyllia/src/main/java/fr/euphyllia/skyllia_papi/hook/ValuePlaceHolder.java @@ -21,8 +21,8 @@ public class ValuePlaceHolder { /** * Processes value-related placeholders. * - * @param island the player's island - * @param playerId the player's UUID + * @param island the player's island + * @param playerId the player's UUID * @param placeholder the placeholder to process * @return the placeholder value as a string */ @@ -65,7 +65,7 @@ public static String processPlaceholder(Island island, UUID playerId, String pla case "value_level" -> String.valueOf(value / expressionValue); default -> "-1"; }; - } catch (Exception e) { + } catch (Exception e) { return "-1"; } } diff --git a/addons/SkylliaBank/readme.md b/addons/SkylliaBank/readme.md index c093f8d3..3a52f780 100644 --- a/addons/SkylliaBank/readme.md +++ b/addons/SkylliaBank/readme.md @@ -1,17 +1,24 @@ # SkylliaBank -**SkylliaBank** is a powerful and feature-rich banking extension designed for Skyblock servers running on the Skyllia platform. This plugin seamlessly integrates with Vault to provide robust economic management for player islands, enhancing the overall gameplay experience by allowing players to manage their island's finances with ease. +**SkylliaBank** is a powerful and feature-rich banking extension designed for Skyblock servers running on the Skyllia +platform. This plugin seamlessly integrates with Vault to provide robust economic management for player islands, +enhancing the overall gameplay experience by allowing players to manage their island's finances with ease. ## Features - **Comprehensive Banking System:** Manage island balances, deposits, withdrawals, and balance inquiries effortlessly. -- **Admin Commands:** Administrators can oversee and modify player island balances, ensuring fair play and effective server management. +- **Admin Commands:** Administrators can oversee and modify player island balances, ensuring fair play and effective + server management. - **Vault Integration:** Fully compatible with Vault, allowing integration with a wide range of economy plugins. -- **Asynchronous Database Operations:** Utilizes MariaDB for reliable and efficient data storage, ensuring smooth performance even under heavy load. -- **Permission-Based Access:** Granular permissions to control access to various banking functionalities for players and administrators. -- **User-Friendly Commands:** Intuitive command structure for both players and admins to interact with the banking system seamlessly. +- **Asynchronous Database Operations:** Utilizes MariaDB for reliable and efficient data storage, ensuring smooth + performance even under heavy load. +- **Permission-Based Access:** Granular permissions to control access to various banking functionalities for players and + administrators. +- **User-Friendly Commands:** Intuitive command structure for both players and admins to interact with the banking + system seamlessly. - **Folia Support:** Optimized for Folia, providing enhanced performance on multithreaded servers. -- +- + ## Requirements - **Minecraft Server:** Compatible with Paper/Folia servers. @@ -22,7 +29,8 @@ ## Installation 1. **Download SkylliaBank:** - - Obtain the latest version of SkylliaBank from the [official repository](https://github.com/Euphillya/Skyllia/tree/dev/addons/SkylliaBank). + - Obtain the latest version of SkylliaBank from + the [official repository](https://github.com/Euphillya/Skyllia/tree/dev/addons/SkylliaBank). 2. **Install Dependencies:** - Ensure that Vault and Skyllia are installed on your server. @@ -54,7 +62,8 @@ For support, please join our [Discord server](https://discord.gg/uUJQEB7XNN). ## Contributing -Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull request. +Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull +request. ## License diff --git a/addons/SkylliaChat/readme.md b/addons/SkylliaChat/readme.md index d0cc70f6..c720a9e3 100644 --- a/addons/SkylliaChat/readme.md +++ b/addons/SkylliaChat/readme.md @@ -1,6 +1,8 @@ # SkylliaChat -**SkylliaChat** is a versatile and user-friendly chat extension designed for Skyblock servers running on the Skyllia platform. This plugin enhances in-game communication by enabling island-specific messaging, allowing players to interact seamlessly with their island members. +**SkylliaChat** is a versatile and user-friendly chat extension designed for Skyblock servers running on the Skyllia +platform. This plugin enhances in-game communication by enabling island-specific messaging, allowing players to interact +seamlessly with their island members. ## Features @@ -20,25 +22,26 @@ ## Installation 1. **Download SkylliaChat:** - - Obtain the latest version of SkylliaChat from the [official repository](https://github.com/Euphillya/Skyllia/tree/dev/addons/SkylliaChat). + - Obtain the latest version of SkylliaChat from + the [official repository](https://github.com/Euphillya/Skyllia/tree/dev/addons/SkylliaChat). 2. **Install Dependencies:** - - Ensure that the Skyllia plugin is installed and properly configured on your server. + - Ensure that the Skyllia plugin is installed and properly configured on your server. 3. **Configure the Plugin:** - - Place the `SkylliaChat.jar` file into your server's `plugins` directory. - - Edit the configuration file (`config.yml`) to customize chat formats and messages as desired. + - Place the `SkylliaChat.jar` file into your server's `plugins` directory. + - Edit the configuration file (`config.yml`) to customize chat formats and messages as desired. 4. **Reload the Plugin:** - - Use the admin command `/isadmin chat_reload` to apply configuration changes without restarting the server. + - Use the admin command `/isadmin chat_reload` to apply configuration changes without restarting the server. ## Usage - **Player Commands:** - - `/is chat` - Toggle island messaging on or off. - + - `/is chat` - Toggle island messaging on or off. + - **Admin Commands:** - - `/isadmin chat_reload` - Reload the plugin's configuration files. + - `/isadmin chat_reload` - Reload the plugin's configuration files. ## Permissions @@ -47,7 +50,8 @@ ## Configuration -Customize the chat format and messages by editing the `config.yml` file. Below is an example of the configuration options: +Customize the chat format and messages by editing the `config.yml` file. Below is an example of the configuration +options: ```yaml chat: @@ -67,7 +71,8 @@ For support, please join our [Discord server](https://discord.gg/uUJQEB7XNN). ## Contributing -Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull request. +Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull +request. ## License diff --git a/addons/SkylliaChat/src/main/java/fr/euphyllia/skylliachat/Main.java b/addons/SkylliaChat/src/main/java/fr/euphyllia/skylliachat/Main.java index 6c339e09..f4f53e70 100644 --- a/addons/SkylliaChat/src/main/java/fr/euphyllia/skylliachat/Main.java +++ b/addons/SkylliaChat/src/main/java/fr/euphyllia/skylliachat/Main.java @@ -1,7 +1,6 @@ package fr.euphyllia.skylliachat; import fr.euphyllia.skyllia.api.SkylliaAPI; -import fr.euphyllia.skyllia.api.commands.SubCommandRegistry; import fr.euphyllia.skylliachat.commands.IslandChatCommand; import fr.euphyllia.skylliachat.commands.IslandChatReloadCommand; import org.bukkit.entity.Player; diff --git a/addons/SkylliaInfo/readme.md b/addons/SkylliaInfo/readme.md index 5bb7bfcc..f9d36d43 100644 --- a/addons/SkylliaInfo/readme.md +++ b/addons/SkylliaInfo/readme.md @@ -1,15 +1,22 @@ # SkylliaInfo -**SkylliaInfo** is a comprehensive information extension designed for Skyblock servers running on the Skyllia platform. This plugin provides detailed insights into player islands, enhancing the gaming experience by allowing players and administrators to access vital island statistics and information effortlessly. +**SkylliaInfo** is a comprehensive information extension designed for Skyblock servers running on the Skyllia platform. +This plugin provides detailed insights into player islands, enhancing the gaming experience by allowing players and +administrators to access vital island statistics and information effortlessly. ## Features -- **Detailed Island Information:** Retrieve comprehensive details about any player's island, including owner, size, members, creation date, and location. -- **Integration with Skyllia Extensions:** Seamlessly integrates with other Skyllia plugins such as SkylliaBank, SkylliaOre, and SkylliaValue to display extended information like bank balances, generator types, and island values. -- **Customizable Chat Formats:** Define how information is displayed using customizable chat formats to match your server's theme. -- **Admin and Player Commands:** Provides both player and admin commands for accessing island information and managing configurations. +- **Detailed Island Information:** Retrieve comprehensive details about any player's island, including owner, size, + members, creation date, and location. +- **Integration with Skyllia Extensions:** Seamlessly integrates with other Skyllia plugins such as SkylliaBank, + SkylliaOre, and SkylliaValue to display extended information like bank balances, generator types, and island values. +- **Customizable Chat Formats:** Define how information is displayed using customizable chat formats to match your + server's theme. +- **Admin and Player Commands:** Provides both player and admin commands for accessing island information and managing + configurations. - **Folia Support:** Optimized for Folia, ensuring enhanced performance on multithreaded servers. -- **Permission-Based Access:** Control access to various functionalities with granular permissions for players and administrators. +- **Permission-Based Access:** Control access to various functionalities with granular permissions for players and + administrators. ## Requirements @@ -17,35 +24,40 @@ - **Skyllia Platform:** Ensure the Skyllia plugin is installed and active on your server. - **Java:** Java 21 or higher is recommended for optimal performance. - **Dependencies:** - - **Skyllia:** Required for core functionalities. - - **SkylliaOre:** Optional, for displaying generator types. - - **SkylliaBankAddon:** Optional, for displaying bank-related information. - - **SkylliaValue:** Optional, for displaying island values (**Proprietary to excalia.fr**). Contact [excalia.fr](https://www.excalia.fr) or [discord.gg](http://discord.gg/excalia) for access. + - **Skyllia:** Required for core functionalities. + - **SkylliaOre:** Optional, for displaying generator types. + - **SkylliaBankAddon:** Optional, for displaying bank-related information. + - **SkylliaValue:** Optional, for displaying island values (**Proprietary to excalia.fr**). + Contact [excalia.fr](https://www.excalia.fr) or [discord.gg](http://discord.gg/excalia) for access. ## Installation 1. **Download SkylliaInfo:** - - Obtain the latest version of SkylliaInfo from the [official repository](https://github.com/Euphillya/Skyllia/tree/dev/addons/SkylliaInfo). + - Obtain the latest version of SkylliaInfo from + the [official repository](https://github.com/Euphillya/Skyllia/tree/dev/addons/SkylliaInfo). 2. **Install Dependencies:** - - Ensure that the Skyllia plugin is installed and properly configured on your server. - - Install any optional dependencies (SkylliaOre, SkylliaBankAddon, SkylliaValue) if you wish to utilize their features. + - Ensure that the Skyllia plugin is installed and properly configured on your server. + - Install any optional dependencies (SkylliaOre, SkylliaBankAddon, SkylliaValue) if you wish to utilize their + features. 3. **Configure the Plugin:** - - Place the `SkylliaInfo.jar` file into your server's `plugins` directory. - - Edit the `config.yml` file to customize message formats and other settings as desired. + - Place the `SkylliaInfo.jar` file into your server's `plugins` directory. + - Edit the `config.yml` file to customize message formats and other settings as desired. 4. **Reload the Plugin:** - - Restart your Minecraft server to load the SkylliaInfo plugin. + - Restart your Minecraft server to load the SkylliaInfo plugin. ## Usage - **Player Commands:** - - `/is info` or `/skyllia info` - Display detailed information about your island. - - `/is info ` or `/skyllia info ` - Display detailed information about another player's island (requires appropriate permissions). + - `/is info` or `/skyllia info` - Display detailed information about your island. + - `/is info ` or `/skyllia info ` - Display detailed information about another player's island ( + requires appropriate permissions). - **Admin Commands:** - - `/isadmin info reload` or `/skylliadmin info reload` - Reload the plugin's configuration without restarting the server. + - `/isadmin info reload` or `/skylliadmin info reload` - Reload the plugin's configuration without restarting the + server. ## Permissions @@ -54,7 +66,8 @@ ## Configuration -Customize the chat formats and messages by editing the `config.yml` file. Below is an example of the configuration options: +Customize the chat formats and messages by editing the `config.yml` file. Below is an example of the configuration +options: ```yaml chat: @@ -70,7 +83,8 @@ message: ### Configuration Options -- **chat.format:** Defines the format of the island chat messages. You can customize the colors and placeholders as needed. +- **chat.format:** Defines the format of the island chat messages. You can customize the colors and placeholders as + needed. - **message.config.reloaded:** Message displayed when the configuration is successfully reloaded. - **message.chat.enabled:** Message displayed when island messaging is enabled for a player. - **message.chat.disabled:** Message displayed when island messaging is disabled for a player. @@ -93,7 +107,8 @@ message: ``` /isadmin info reload ``` - Reloads the `config.yml` file to apply any changes without restarting the server. Requires `skylliainfo.admin.reload` permission. + Reloads the `config.yml` file to apply any changes without restarting the server. Requires `skylliainfo.admin.reload` + permission. ## Support @@ -101,7 +116,8 @@ For support, please join our [Discord server](https://discord.gg/uUJQEB7XNN). ## Contributing -Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull request. +Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull +request. ## License diff --git a/addons/SkylliaInfo/src/main/java/fr/euphyllia/skylliainfo/Main.java b/addons/SkylliaInfo/src/main/java/fr/euphyllia/skylliainfo/Main.java index 791d95d5..368623d7 100644 --- a/addons/SkylliaInfo/src/main/java/fr/euphyllia/skylliainfo/Main.java +++ b/addons/SkylliaInfo/src/main/java/fr/euphyllia/skylliainfo/Main.java @@ -1,7 +1,6 @@ package fr.euphyllia.skylliainfo; import fr.euphyllia.skyllia.api.SkylliaAPI; -import fr.euphyllia.skyllia.api.commands.SubCommandRegistry; import org.bukkit.plugin.java.JavaPlugin; public final class Main extends JavaPlugin { diff --git a/addons/SkylliaInfo/src/main/java/fr/euphyllia/skylliainfo/hook/SkylliaValueHook.java b/addons/SkylliaInfo/src/main/java/fr/euphyllia/skylliainfo/hook/SkylliaValueHook.java index 51110842..a99c473b 100644 --- a/addons/SkylliaInfo/src/main/java/fr/euphyllia/skylliainfo/hook/SkylliaValueHook.java +++ b/addons/SkylliaInfo/src/main/java/fr/euphyllia/skylliainfo/hook/SkylliaValueHook.java @@ -35,7 +35,8 @@ public static void sendMessage(MiniMessage miniMessage, Player player, UUID isla player.sendMessage(miniMessage.deserialize( "Island Value: " + islandValue + "")); - } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | + InvocationTargetException e) { e.printStackTrace(); } } diff --git a/addons/SkylliaOre/readme.md b/addons/SkylliaOre/readme.md index 9b659fa6..72cb5d62 100644 --- a/addons/SkylliaOre/readme.md +++ b/addons/SkylliaOre/readme.md @@ -16,7 +16,8 @@ This plugin manages custom block generators for SkyBlock islands, with support f ## Configuration -The configuration file `config.yml` should be located in the `plugins/SkylliaOre/` directory. Here is an example configuration for a generator: +The configuration file `config.yml` should be located in the `plugins/SkylliaOre/` directory. Here is an example +configuration for a generator: ```yml generator_default: test @@ -63,7 +64,9 @@ generators: chance: 10.0 ``` -In this example, the default generator is set to "test". The generator named "test" will replace `cobblestone` and `stone` blocks in the `sky-overworld` world. It has a 90% chance to generate `cobblestone` and a 10% chance to generate `oraxen:ore`. +In this example, the default generator is set to "test". The generator named "test" will replace `cobblestone` and +`stone` blocks in the `sky-overworld` world. It has a 90% chance to generate `cobblestone` and a 10% chance to generate +`oraxen:ore`. ## Usage @@ -85,7 +88,8 @@ For support, please join our [Discord server](https://discord.gg/uUJQEB7XNN). ## Contributing -Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull request. +Contributions are welcome! Please read the [contribution guidelines](../../CONTRIBUTING.md) before submitting a pull +request. ## License diff --git a/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/Main.java b/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/Main.java index 9bc27641..a4cdded9 100644 --- a/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/Main.java +++ b/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/Main.java @@ -1,7 +1,6 @@ package fr.euphyllia.skylliaore; import fr.euphyllia.skyllia.api.SkylliaAPI; -import fr.euphyllia.skyllia.api.commands.SubCommandRegistry; import fr.euphyllia.skyllia.sgbd.exceptions.DatabaseException; import fr.euphyllia.skylliaore.commands.OreCommands; import fr.euphyllia.skylliaore.config.DefaultConfig; @@ -10,7 +9,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bukkit.Bukkit; -import org.bukkit.command.PluginCommand; import org.bukkit.plugin.java.JavaPlugin; import org.jetbrains.annotations.NotNull; diff --git a/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/database/MariaDBInit.java b/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/database/MariaDBInit.java index 632f63af..2aecd3ad 100644 --- a/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/database/MariaDBInit.java +++ b/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/database/MariaDBInit.java @@ -1,7 +1,7 @@ package fr.euphyllia.skylliaore.database; -import fr.euphyllia.skyllia.configuration.ConfigToml; import fr.euphyllia.skyllia.api.database.DatabaseInitializeQuery; +import fr.euphyllia.skyllia.configuration.ConfigToml; import fr.euphyllia.skyllia.sgbd.DatabaseLoader; import fr.euphyllia.skyllia.sgbd.MariaDB; import fr.euphyllia.skyllia.sgbd.exceptions.DatabaseException; diff --git a/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/listeners/OreEvent.java b/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/listeners/OreEvent.java index 99f3d2ff..948accae 100644 --- a/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/listeners/OreEvent.java +++ b/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/listeners/OreEvent.java @@ -15,11 +15,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ThreadLocalRandom; -import java.util.Collections; public class OreEvent implements Listener { diff --git a/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/utils/OptimizedGenerator.java b/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/utils/OptimizedGenerator.java index 39dae99c..4109ae8f 100644 --- a/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/utils/OptimizedGenerator.java +++ b/addons/SkylliaOre/src/main/java/fr/euphyllia/skylliaore/utils/OptimizedGenerator.java @@ -36,5 +36,6 @@ public double getTotalChance() { return totalChance; } - public record BlockProbability(String blockKey, double cumulativeChance) {} + public record BlockProbability(String blockKey, double cumulativeChance) { + } } diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/SkylliaAPI.java b/api/src/main/java/fr/euphyllia/skyllia/api/SkylliaAPI.java index a17da863..be216946 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/SkylliaAPI.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/SkylliaAPI.java @@ -3,7 +3,6 @@ import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; import fr.euphyllia.skyllia.api.skyblock.model.Position; -import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.World; @@ -30,7 +29,7 @@ public final class SkylliaAPI { /** * Sets the implementation for the SkylliaAPI. * - * @param plugin The plugin instance. + * @param plugin The plugin instance. * @param skylliaImplementation The implementation of the SkylliaAPI. */ public static void setImplementation(Plugin plugin, SkylliaImplementation skylliaImplementation) { diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/commands/SkylliaCommandInterface.java b/api/src/main/java/fr/euphyllia/skyllia/api/commands/SkylliaCommandInterface.java index 61ab9a52..831cb197 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/commands/SkylliaCommandInterface.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/commands/SkylliaCommandInterface.java @@ -1,8 +1,6 @@ package fr.euphyllia.skyllia.api.commands; import io.papermc.paper.command.brigadier.BasicCommand; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.TabCompleter; public interface SkylliaCommandInterface extends BasicCommand { } diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/commands/SubCommandInterface.java b/api/src/main/java/fr/euphyllia/skyllia/api/commands/SubCommandInterface.java index c88d4d16..f07e77a6 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/commands/SubCommandInterface.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/commands/SubCommandInterface.java @@ -1,10 +1,8 @@ package fr.euphyllia.skyllia.api.commands; -import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.List; @@ -20,9 +18,9 @@ public interface SubCommandInterface { /** * Handles the execution of a sub-command. * - * @param plugin the {@link Plugin} instance that is executing the command - * @param sender the {@link CommandSender} who issued the command - * @param args the arguments provided with the command + * @param plugin the {@link Plugin} instance that is executing the command + * @param sender the {@link CommandSender} who issued the command + * @param args the arguments provided with the command * @return {@code true} if the command was successfully handled, {@code false} otherwise */ boolean onCommand(@NotNull Plugin plugin, @NotNull CommandSender sender, @NotNull String[] args); @@ -30,9 +28,9 @@ public interface SubCommandInterface { /** * Provides tab completion suggestions for the sub-command. * - * @param plugin the {@link Plugin} instance that is executing the command - * @param sender the {@link CommandSender} who is tab completing - * @param args the arguments provided with the command so far + * @param plugin the {@link Plugin} instance that is executing the command + * @param sender the {@link CommandSender} who is tab completing + * @param args the arguments provided with the command so far * @return a {@link List} of suggestions for tab completion, or {@code null} if no suggestions are available */ @NotNull diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandDataQuery.java b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandDataQuery.java index 6698b7e9..aa048635 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandDataQuery.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandDataQuery.java @@ -20,7 +20,7 @@ public abstract class IslandDataQuery { * * @param playerId the UUID of the island owner * @return a {@link CompletableFuture} that will complete with the retrieved {@link Island}, - * or {@code null} if no matching island is found + * or {@code null} if no matching island is found */ public abstract CompletableFuture<@Nullable Island> getIslandByOwnerId(UUID playerId); @@ -29,7 +29,7 @@ public abstract class IslandDataQuery { * * @param playerId the UUID of the player * @return a {@link CompletableFuture} that will complete with the retrieved {@link Island}, - * or {@code null} if no matching island is found + * or {@code null} if no matching island is found */ public abstract CompletableFuture<@Nullable Island> getIslandByPlayerId(UUID playerId); @@ -38,7 +38,7 @@ public abstract class IslandDataQuery { * * @param futurIsland the {@link Island} to be inserted * @return a {@link CompletableFuture} that will complete with {@code true} if the insertion - * was successful, or {@code false} otherwise + * was successful, or {@code false} otherwise */ public abstract CompletableFuture insertIslands(Island futurIsland); @@ -47,7 +47,7 @@ public abstract class IslandDataQuery { * * @param islandId the UUID of the island * @return a {@link CompletableFuture} that will complete with the retrieved {@link Island}, - * or {@code null} if no island with the specified UUID is found + * or {@code null} if no island with the specified UUID is found */ public abstract CompletableFuture<@Nullable Island> getIslandByIslandId(UUID islandId); diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandMemberQuery.java b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandMemberQuery.java index 469e26f7..aa9d49ac 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandMemberQuery.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandMemberQuery.java @@ -24,7 +24,7 @@ public abstract class IslandMemberQuery { * @param island the {@link Island} the player belongs to * @param players the player's membership details * @return a {@link CompletableFuture} that completes with {@code true} if the update succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture updateMember(Island island, Players players); @@ -43,7 +43,7 @@ public abstract class IslandMemberQuery { * @param island the {@link Island} to search * @param playerName the player's name * @return a {@link CompletableFuture} that completes with the {@link Players} object, - * or {@code null} if the player is not found + * or {@code null} if the player is not found */ public abstract CompletableFuture<@Nullable Players> getPlayersIsland(Island island, String playerName); @@ -52,7 +52,7 @@ public abstract class IslandMemberQuery { * * @param island the {@link Island} whose members are to be retrieved * @return a {@link CompletableFuture} that completes with a list of {@link Players}, - * or {@code null} if no members are found + * or {@code null} if no members are found */ public abstract CompletableFuture<@Nullable CopyOnWriteArrayList> getMembersInIsland(Island island); @@ -61,7 +61,7 @@ public abstract class IslandMemberQuery { * * @param island the {@link Island} to query * @return a {@link CompletableFuture} that completes with the owner as a {@link Players} object, - * or {@code null} if no owner is found + * or {@code null} if no owner is found */ public abstract CompletableFuture<@Nullable Players> getOwnerInIslandId(Island island); @@ -71,7 +71,7 @@ public abstract class IslandMemberQuery { * @param playerId the UUID of the player * @param cause the {@link RemovalCause} for the removal * @return a {@link CompletableFuture} that completes with {@code true} if the operation succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture addMemberClear(UUID playerId, RemovalCause cause); @@ -81,7 +81,7 @@ public abstract class IslandMemberQuery { * @param playerId the UUID of the player * @param cause the {@link RemovalCause} for the removal * @return a {@link CompletableFuture} that completes with {@code true} if the deletion succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture deleteMemberClear(UUID playerId, RemovalCause cause); @@ -91,7 +91,7 @@ public abstract class IslandMemberQuery { * @param playerId the UUID of the player * @param cause the {@link RemovalCause} for the removal * @return a {@link CompletableFuture} that completes with {@code true} if the record exists, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture checkClearMemberExist(UUID playerId, RemovalCause cause); @@ -101,7 +101,7 @@ public abstract class IslandMemberQuery { * @param island the {@link Island} from which the member will be removed * @param oldMember the {@link Players} object representing the member to be removed * @return a {@link CompletableFuture} that completes with {@code true} if the removal succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture deleteMember(Island island, Players oldMember); } diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandPermissionQuery.java b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandPermissionQuery.java index 78ddea9f..d9805ab4 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandPermissionQuery.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandPermissionQuery.java @@ -26,7 +26,7 @@ public abstract class IslandPermissionQuery { * @param roleType the role type (e.g., OWNER, MEMBER) for which permissions are updated * @param permissions the new permission flags as a {@code long} value * @return a {@link CompletableFuture} that completes with {@code true} if the update succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture updateIslandsPermission( Island island, @@ -43,7 +43,7 @@ public abstract CompletableFuture updateIslandsPermission( * @param permissionsType the type of permission to retrieve * @param roleType the role type (e.g., OWNER, MEMBER) * @return a {@link CompletableFuture} that completes with the corresponding - * {@link PermissionRoleIsland} object + * {@link PermissionRoleIsland} object */ public abstract CompletableFuture getIslandPermission( UUID islandId, @@ -65,7 +65,7 @@ public abstract CompletableFuture getIslandPermission( * @param island the {@link Island} whose game rule is to be updated * @param value the new game rule value as a {@code long} * @return a {@link CompletableFuture} that completes with {@code true} if the update succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture updateIslandGameRule(Island island, long value); } diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandUpdateQuery.java b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandUpdateQuery.java index c4ef0a17..f4f2ac43 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandUpdateQuery.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandUpdateQuery.java @@ -19,7 +19,7 @@ public abstract class IslandUpdateQuery { * @param island the {@link Island} to update * @param disable {@code true} to disable the island, {@code false} to enable it * @return a {@link CompletableFuture} that completes with {@code true} if the update succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture updateDisable(Island island, boolean disable); @@ -29,7 +29,7 @@ public abstract class IslandUpdateQuery { * @param island the {@link Island} to update * @param privateIsland {@code true} to set the island as private, {@code false} to make it public * @return a {@link CompletableFuture} that completes with {@code true} if the update succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture updatePrivate(Island island, boolean privateIsland); @@ -38,7 +38,7 @@ public abstract class IslandUpdateQuery { * * @param island the {@link Island} to check * @return a {@link CompletableFuture} that completes with {@code true} if the island is disabled, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture isDisabledIsland(Island island); @@ -47,7 +47,7 @@ public abstract class IslandUpdateQuery { * * @param island the {@link Island} to check * @return a {@link CompletableFuture} that completes with {@code true} if the island is private, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture isPrivateIsland(Island island); @@ -57,17 +57,17 @@ public abstract class IslandUpdateQuery { * @param island the {@link Island} to update * @param newValue the new maximum number of members * @return a {@link CompletableFuture} that completes with {@code true} if the update succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture setMaxMemberInIsland(Island island, int newValue); /** * Sets the size of the specified island. * - * @param island the {@link Island} to update + * @param island the {@link Island} to update * @param newValue the new size of the island (e.g., radius or diameter, depending on implementation) * @return a {@link CompletableFuture} that completes with {@code true} if the update succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture setSizeIsland(Island island, double newValue); } diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandWarpQuery.java b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandWarpQuery.java index 4feba5a5..e0e6214a 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandWarpQuery.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/database/IslandWarpQuery.java @@ -23,7 +23,7 @@ public abstract class IslandWarpQuery { * @param warpName the name of the warp point * @param location the {@link Location} to set for this warp * @return a {@link CompletableFuture} that completes with {@code true} if the update succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture updateWarp(Island island, String warpName, Location location); @@ -33,7 +33,7 @@ public abstract class IslandWarpQuery { * @param island the {@link Island} whose warp is to be retrieved * @param warpName the name of the warp point * @return a {@link CompletableFuture} that completes with the {@link WarpIsland} object, - * or {@code null} if no warp with the specified name is found + * or {@code null} if no warp with the specified name is found */ public abstract CompletableFuture<@Nullable WarpIsland> getWarpByName(Island island, String warpName); @@ -42,7 +42,7 @@ public abstract class IslandWarpQuery { * * @param island the {@link Island} to query * @return a {@link CompletableFuture} that completes with a list of {@link WarpIsland} objects, - * or {@code null} if no warps are found + * or {@code null} if no warps are found */ public abstract CompletableFuture<@Nullable CopyOnWriteArrayList> getListWarp(Island island); @@ -52,7 +52,7 @@ public abstract class IslandWarpQuery { * @param island the {@link Island} to update * @param name the name of the warp point to delete * @return a {@link CompletableFuture} that completes with {@code true} if the deletion succeeds, - * or {@code false} otherwise + * or {@code false} otherwise */ public abstract CompletableFuture deleteWarp(Island island, String name); } diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/entity/PlayerFolia.java b/api/src/main/java/fr/euphyllia/skyllia/api/entity/PlayerFolia.java index 2b6f2a02..1d7e24a5 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/entity/PlayerFolia.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/entity/PlayerFolia.java @@ -12,7 +12,7 @@ public class PlayerFolia { /** * Sets the game mode for the specified player. * - * @param player The player whose game mode is to be set. + * @param player The player whose game mode is to be set. * @param gameMode The new game mode for the player. */ public static void setGameMode(Player player, GameMode gameMode) { diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/event/PlayerChangeWorldSkyblockEvent.java b/api/src/main/java/fr/euphyllia/skyllia/api/event/PlayerChangeWorldSkyblockEvent.java index 4a966181..f6b3c96e 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/event/PlayerChangeWorldSkyblockEvent.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/event/PlayerChangeWorldSkyblockEvent.java @@ -104,9 +104,9 @@ public class PlayerChangeWorldSkyblockEvent extends Event { /** * Constructs a new {@code PlayerChangeWorldSkyblockEvent}. * - * @param player The player changing worlds. - * @param portalType The type of portal used for the transition. - * @param to The destination location. + * @param player The player changing worlds. + * @param portalType The type of portal used for the transition. + * @param to The destination location. * @param checkSafeLocation Whether to perform a safety check on the destination. */ public PlayerChangeWorldSkyblockEvent(Player player, PlayerPrepareChangeWorldSkyblockEvent.PortalType portalType, Location to, boolean checkSafeLocation) { diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangeGameRuleEvent.java b/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangeGameRuleEvent.java index b1d448b7..f0ba6d68 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangeGameRuleEvent.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangeGameRuleEvent.java @@ -125,8 +125,8 @@ public class SkyblockChangeGameRuleEvent extends Event { /** * Constructs a new {@code SkyblockChangeGameRuleEvent}. * - * @param island The {@link Island} where the game rule is being changed. - * @param gamerules The new value of the game rule. + * @param island The {@link Island} where the game rule is being changed. + * @param gamerules The new value of the game rule. */ public SkyblockChangeGameRuleEvent(Island island, long gamerules) { super(true); diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangePermissionEvent.java b/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangePermissionEvent.java index 5f9c3640..3079b8e6 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangePermissionEvent.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangePermissionEvent.java @@ -87,10 +87,10 @@ public class SkyblockChangePermissionEvent extends Event { /** * Constructs a new {@code SkyblockChangePermissionEvent}. * - * @param island The island where the permissions are being changed. - * @param permissionsType The type of permissions being changed. - * @param roleType The role type affected by the permission change. - * @param permissions The new value of the permissions. + * @param island The island where the permissions are being changed. + * @param permissionsType The type of permissions being changed. + * @param roleType The role type affected by the permission change. + * @param permissions The new value of the permissions. */ public SkyblockChangePermissionEvent(Island island, PermissionsType permissionsType, RoleType roleType, long permissions) { super(true); diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangeSizeEvent.java b/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangeSizeEvent.java index 1091a1ea..52fdaab7 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangeSizeEvent.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockChangeSizeEvent.java @@ -69,7 +69,7 @@ public class SkyblockChangeSizeEvent extends Event { /** * Constructs a new {@code SkyblockChangeSizeEvent}. * - * @param island The island whose size is being changed. + * @param island The island whose size is being changed. * @param sizeIsland The new radius of the island. */ public SkyblockChangeSizeEvent(Island island, double sizeIsland) { diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockCreateWarpEvent.java b/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockCreateWarpEvent.java index 22f547a2..e57b1bc3 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockCreateWarpEvent.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/event/SkyblockCreateWarpEvent.java @@ -100,9 +100,9 @@ public class SkyblockCreateWarpEvent extends Event implements Cancellable { /** * Constructs a new {@code SkyblockCreateWarpEvent}. * - * @param island The island creating the warp. - * @param warpName The name of the warp. - * @param warpLocation The location of the warp. + * @param island The island creating the warp. + * @param warpName The name of the warp. + * @param warpLocation The location of the warp. */ public SkyblockCreateWarpEvent(Island island, String warpName, Location warpLocation) { super(true); diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/event/players/PlayerPrepareChangeWorldSkyblockEvent.java b/api/src/main/java/fr/euphyllia/skyllia/api/event/players/PlayerPrepareChangeWorldSkyblockEvent.java index de8d0c67..dfb6cb99 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/event/players/PlayerPrepareChangeWorldSkyblockEvent.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/event/players/PlayerPrepareChangeWorldSkyblockEvent.java @@ -92,9 +92,9 @@ public class PlayerPrepareChangeWorldSkyblockEvent extends Event implements Canc /** * Constructs a new {@code PlayerPrepareChangeWorldSkyblockEvent}. * - * @param player The player who touched the portal. - * @param wc The world configuration for the target world. - * @param pt The type of the portal being used. + * @param player The player who touched the portal. + * @param wc The world configuration for the target world. + * @param pt The type of the portal being used. */ public PlayerPrepareChangeWorldSkyblockEvent(Player player, WorldConfig wc, PortalType pt) { super(false); diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/exceptions/MaxIslandSizeExceedException.java b/api/src/main/java/fr/euphyllia/skyllia/api/exceptions/MaxIslandSizeExceedException.java index 4477a0ee..3ceab4cd 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/exceptions/MaxIslandSizeExceedException.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/exceptions/MaxIslandSizeExceedException.java @@ -27,7 +27,7 @@ public MaxIslandSizeExceedException(Throwable cause) { * Constructs a new MaxIslandSizeExceedException with the specified detail message and cause. * * @param message The detail message. - * @param cause The cause of the exception. + * @param cause The cause of the exception. */ public MaxIslandSizeExceedException(String message, Throwable cause) { super(message, cause); diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/exceptions/UnsupportedMinecraftVersionException.java b/api/src/main/java/fr/euphyllia/skyllia/api/exceptions/UnsupportedMinecraftVersionException.java index bed77c43..6582b250 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/exceptions/UnsupportedMinecraftVersionException.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/exceptions/UnsupportedMinecraftVersionException.java @@ -27,7 +27,7 @@ public UnsupportedMinecraftVersionException(Throwable cause) { * Constructs a new UnsupportedMinecraftVersionException with the specified detail message and cause. * * @param message The detail message. - * @param cause The cause of the exception. + * @param cause The cause of the exception. */ public UnsupportedMinecraftVersionException(String message, Throwable cause) { super(message, cause); diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/PermissionManager.java b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/PermissionManager.java index 973f29ce..48716bb4 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/PermissionManager.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/PermissionManager.java @@ -41,7 +41,7 @@ public long getPermissions() { * Defines a specific permission. * * @param permission The permission to set. - * @param value True to enable the permission, false to disable it. + * @param value True to enable the permission, false to disable it. */ public void definePermission(long permission, boolean value) { this.setFlags(permission, value); diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/Players.java b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/Players.java index fcc1be61..379277ca 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/Players.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/Players.java @@ -17,10 +17,10 @@ public class Players { /** * Constructs a new Players object. * - * @param playerId The UUID of the player. + * @param playerId The UUID of the player. * @param playerName The last known name of the player. - * @param islandId The UUID of the island the player is associated with. - * @param role The role of the player on the island. + * @param islandId The UUID of the island the player is associated with. + * @param role The role of the player on the island. */ public Players(UUID playerId, String playerName, UUID islandId, RoleType role) { this.mojangId = playerId; diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/permissions/PermissionsInventory.java b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/permissions/PermissionsInventory.java index 0156766f..c53ddd91 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/permissions/PermissionsInventory.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/permissions/PermissionsInventory.java @@ -1,7 +1,5 @@ package fr.euphyllia.skyllia.api.skyblock.model.permissions; -import io.papermc.paper.annotation.DoNotUse; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -111,8 +109,7 @@ public enum PermissionsInventory implements Permissions { OPEN_SMOKER(524_288), /** - * @deprecated - * Permission to open the new smithing tables (old permission). + * @deprecated Permission to open the new smithing tables (old permission). * This permission is deprecated and should not be used. */ @Deprecated diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/utils/BitwiseFlag.java b/api/src/main/java/fr/euphyllia/skyllia/api/utils/BitwiseFlag.java index 62176a74..46e5b4ab 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/utils/BitwiseFlag.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/utils/BitwiseFlag.java @@ -23,7 +23,7 @@ protected boolean isFlagSet(long flag) { /** * Sets or clears a specific flag. * - * @param flag The flag to set or clear. + * @param flag The flag to set or clear. * @param value True to set the flag, false to clear it. */ protected void setFlags(long flag, boolean value) { diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/utils/Metrics.java b/api/src/main/java/fr/euphyllia/skyllia/api/utils/Metrics.java index 79119ae2..6ec2f1cc 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/utils/Metrics.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/utils/Metrics.java @@ -247,6 +247,23 @@ public MetricsBase( } } + /** + * Gzips the given string. + * + * @param str The string to gzip. + * @return The gzipped string. + */ + private static byte[] compress(final String str) throws IOException { + if (str == null) { + return null; + } + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) { + gzip.write(str.getBytes(StandardCharsets.UTF_8)); + } + return outputStream.toByteArray(); + } + public void addCustomChart(CustomChart chart) { this.customCharts.add(chart); } @@ -367,23 +384,6 @@ private void checkRelocation() { } } } - - /** - * Gzips the given string. - * - * @param str The string to gzip. - * @return The gzipped string. - */ - private static byte[] compress(final String str) throws IOException { - if (str == null) { - return null; - } - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - try (GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) { - gzip.write(str.getBytes(StandardCharsets.UTF_8)); - } - return outputStream.toByteArray(); - } } public static class AdvancedBarChart extends CustomChart { @@ -682,6 +682,34 @@ public JsonObjectBuilder() { builder.append("{"); } + /** + * Escapes the given string like stated in ietf.org. + * + *

This method escapes only the necessary characters '"', '\'. and '\u0000' - '\u001F'. + * Compact escapes are not used (e.g., '\n' is escaped as "\u000a" and not as "\n"). + * + * @param value The value to escape. + * @return The escaped value. + */ + private static String escape(String value) { + final StringBuilder builder = new StringBuilder(); + for (int i = 0; i < value.length(); i++) { + char c = value.charAt(i); + if (c == '"') { + builder.append("\\\""); + } else if (c == '\\') { + builder.append("\\\\"); + } else if (c <= '\u000F') { + builder.append("\\u000").append(Integer.toHexString(c)); + } else if (c <= '\u001F') { + builder.append("\\u00").append(Integer.toHexString(c)); + } else { + builder.append(c); + } + } + return builder.toString(); + } + /** * Appends a null field to the JSON. * @@ -822,34 +850,6 @@ public JsonObject build() { return object; } - /** - * Escapes the given string like stated in ietf.org. - * - *

This method escapes only the necessary characters '"', '\'. and '\u0000' - '\u001F'. - * Compact escapes are not used (e.g., '\n' is escaped as "\u000a" and not as "\n"). - * - * @param value The value to escape. - * @return The escaped value. - */ - private static String escape(String value) { - final StringBuilder builder = new StringBuilder(); - for (int i = 0; i < value.length(); i++) { - char c = value.charAt(i); - if (c == '"') { - builder.append("\\\""); - } else if (c == '\\') { - builder.append("\\\\"); - } else if (c <= '\u000F') { - builder.append("\\u000").append(Integer.toHexString(c)); - } else if (c <= '\u001F') { - builder.append("\\u00").append(Integer.toHexString(c)); - } else { - builder.append(c); - } - } - return builder.toString(); - } - /** * A super simple representation of a JSON object. * diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/utils/VersionUtils.java b/api/src/main/java/fr/euphyllia/skyllia/api/utils/VersionUtils.java index 0d189754..085ee767 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/utils/VersionUtils.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/utils/VersionUtils.java @@ -1,7 +1,6 @@ package fr.euphyllia.skyllia.api.utils; import fr.euphyllia.skyllia.api.SkylliaAPI; -import org.bukkit.Bukkit; /** * The VersionUtils class provides utility methods to check the server's type (Paper or Folia). diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/utils/nms/WorldNMS.java b/api/src/main/java/fr/euphyllia/skyllia/api/utils/nms/WorldNMS.java index 23d8e25d..411d7a99 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/utils/nms/WorldNMS.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/utils/nms/WorldNMS.java @@ -25,7 +25,7 @@ public abstract class WorldNMS { * Resets a chunk at the specified position in the given world. * * @param craftWorld The world where the chunk is to be reset. - * @param position The position of the chunk to reset. + * @param position The position of the chunk to reset. */ public abstract void resetChunk(World craftWorld, Position position); diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/world/WorldFeedback.java b/api/src/main/java/fr/euphyllia/skyllia/api/world/WorldFeedback.java index 14b065b8..f9456941 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/world/WorldFeedback.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/world/WorldFeedback.java @@ -52,7 +52,7 @@ public static class FeedbackWorld { /** * Constructs a new FeedbackWorld with the specified world and feedback. * - * @param world The world associated with the feedback. + * @param world The world associated with the feedback. * @param feedback The feedback state. */ public FeedbackWorld(World world, Feedback feedback) { diff --git a/database/src/main/java/fr/euphyllia/skyllia/sgbd/DatabaseLoader.java b/database/src/main/java/fr/euphyllia/skyllia/sgbd/DatabaseLoader.java index de742c33..42c2d584 100644 --- a/database/src/main/java/fr/euphyllia/skyllia/sgbd/DatabaseLoader.java +++ b/database/src/main/java/fr/euphyllia/skyllia/sgbd/DatabaseLoader.java @@ -66,8 +66,8 @@ public Connection getMariaDBConnection() throws DatabaseException { * and returns the number of affected rows. * * @param connection the active SQL {@link Connection}. - * @param query the SQL query string to be executed. - * @param param a list of parameters (in the correct order) to be bound to the query. + * @param query the SQL query string to be executed. + * @param param a list of parameters (in the correct order) to be bound to the query. * @return the number of rows affected by the query. * @throws SQLException if an error occurs during the SQL execution. */ @@ -79,8 +79,8 @@ public int executeInt(Connection connection, String query, List param) throws * Creates and prepares a {@link PreparedStatement} asynchronously using the provided query and parameters. * * @param connection the active SQL {@link Connection}. - * @param query the SQL query string to prepare. - * @param param a list of parameters to set on the {@link PreparedStatement}. + * @param query the SQL query string to prepare. + * @param param a list of parameters to set on the {@link PreparedStatement}. * @return a {@link CompletableFuture} containing the prepared statement. * @throws SQLException if an error occurs while preparing the statement. */ @@ -106,9 +106,9 @@ private CompletableFuture getStatementFinal(Connection connec * Inserts a value into the {@link PreparedStatement} at the specified parameter index, * supporting multiple data types. * - * @param i the parameter index. + * @param i the parameter index. * @param statement the {@link PreparedStatement} where the value will be inserted. - * @param value the value to set in the statement parameter. + * @param value the value to set in the statement parameter. * @throws SQLException if an error occurs while setting the parameter value. */ private void insertStatement(int i, PreparedStatement statement, Object value) throws SQLException { @@ -140,8 +140,8 @@ private void insertStatement(int i, PreparedStatement statement, Object value) t * Executes an SQL query that may return a result set. * * @param connection the active SQL {@link Connection}. - * @param query the SQL query string to be executed. - * @param param a list of parameters (in the correct order) to be bound to the query. + * @param query the SQL query string to be executed. + * @param param a list of parameters (in the correct order) to be bound to the query. * @return a {@link ResultSet} if the query returns a result, or {@code null} otherwise. * @throws SQLException if an error occurs during the SQL execution. */ diff --git a/database/src/main/java/fr/euphyllia/skyllia/sgbd/configuration/MariaDBConfig.java b/database/src/main/java/fr/euphyllia/skyllia/sgbd/configuration/MariaDBConfig.java index 4f1ce9fa..cc071705 100644 --- a/database/src/main/java/fr/euphyllia/skyllia/sgbd/configuration/MariaDBConfig.java +++ b/database/src/main/java/fr/euphyllia/skyllia/sgbd/configuration/MariaDBConfig.java @@ -2,5 +2,6 @@ public record MariaDBConfig(String hostname, String port, String user, String pass, Boolean useSSL, - Integer maxPool, Integer minPool, Integer timeOut, Long maxLifeTime, Long keepAliveTime, String database, int dbVersion) { + Integer maxPool, Integer minPool, Integer timeOut, Long maxLifeTime, Long keepAliveTime, + String database, int dbVersion) { } diff --git a/database/src/main/java/fr/euphyllia/skyllia/sgbd/execute/MariaDBExecute.java b/database/src/main/java/fr/euphyllia/skyllia/sgbd/execute/MariaDBExecute.java index 6b9fbcac..4af7362c 100644 --- a/database/src/main/java/fr/euphyllia/skyllia/sgbd/execute/MariaDBExecute.java +++ b/database/src/main/java/fr/euphyllia/skyllia/sgbd/execute/MariaDBExecute.java @@ -44,11 +44,9 @@ public static void executeQuery(DatabaseLoader pool, String query) throws Databa * Important: If `work` is not null, the user is responsible for closing the connection. *

* @throws DatabaseException If an error occurs during query execution. - * - * @implSpec - *
    - *
  • If `work` is provided, executes `work.run(connection)` and does not close the connection. The user must close the connection.
  • - *
  • Otherwise, executes the query, invokes the callback if provided, and closes the connection before executing the callback.
  • + * @implSpec
      + *
    • If `work` is provided, executes `work.run(connection)` and does not close the connection. The user must close the connection.
    • + *
    • Otherwise, executes the query, invokes the callback if provided, and closes the connection before executing the callback.
    • *
    */ public static void executeQuery(DatabaseLoader pool, String query, List param, DBCallback callback, DBWork work) throws DatabaseException { @@ -95,11 +93,9 @@ public static void executeQuery(DatabaseLoader pool, String query, List param * Important: If `work` is not null, the user is responsible for closing the connection. *

    * @throws DatabaseException If an error occurs during query execution. - * - * @implSpec - *
      - *
    • If `work` is provided, executes `work.run(connection)` and does not close the connection. The user must close the connection.
    • - *
    • Otherwise, executes the DML query, invokes the callback if provided, and closes the connection before executing the callback.
    • + * @implSpec
        + *
      • If `work` is provided, executes `work.run(connection)` and does not close the connection. The user must close the connection.
      • + *
      • Otherwise, executes the DML query, invokes the callback if provided, and closes the connection before executing the callback.
      • *
      */ public static void executeQueryDML(DatabaseLoader pool, String query, List param, DBCallbackInt callback, DBWork work) throws DatabaseException { diff --git a/database/src/main/java/fr/euphyllia/skyllia/sgbd/model/DBConnect.java b/database/src/main/java/fr/euphyllia/skyllia/sgbd/model/DBConnect.java index 52cbc85b..2d078c50 100644 --- a/database/src/main/java/fr/euphyllia/skyllia/sgbd/model/DBConnect.java +++ b/database/src/main/java/fr/euphyllia/skyllia/sgbd/model/DBConnect.java @@ -13,7 +13,7 @@ public interface DBConnect { * Initializes and loads the database connection. * * @return {@code true} if the connection is successfully established, - * {@code false} otherwise + * {@code false} otherwise * @throws DatabaseException if any error occurs during initialization */ boolean onLoad() throws DatabaseException; diff --git a/nms/v1_20_R1/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R1/WorldNMS.java b/nms/v1_20_R1/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R1/WorldNMS.java index 1a65fc3e..1a3b89e6 100644 --- a/nms/v1_20_R1/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R1/WorldNMS.java +++ b/nms/v1_20_R1/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R1/WorldNMS.java @@ -241,7 +241,7 @@ private double[] getTPSFromRegion(ServerLevel world, int x, int z) { } else { io.papermc.paper.threadedregions.TickRegions.TickRegionData regionData = region.getData(); final long currTime = System.nanoTime(); - return new double[] { + return new double[]{ regionData.getRegionSchedulingHandle().getTickReport5s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport15s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport1m(currTime).tpsData().segmentAll().average(), diff --git a/nms/v1_20_R2/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R2/WorldNMS.java b/nms/v1_20_R2/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R2/WorldNMS.java index c1207dea..5a5e8286 100644 --- a/nms/v1_20_R2/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R2/WorldNMS.java +++ b/nms/v1_20_R2/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R2/WorldNMS.java @@ -241,7 +241,7 @@ private double[] getTPSFromRegion(ServerLevel world, int x, int z) { } else { io.papermc.paper.threadedregions.TickRegions.TickRegionData regionData = region.getData(); final long currTime = System.nanoTime(); - return new double[] { + return new double[]{ regionData.getRegionSchedulingHandle().getTickReport5s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport15s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport1m(currTime).tpsData().segmentAll().average(), diff --git a/nms/v1_20_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R3/BiomeNMS.java b/nms/v1_20_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R3/BiomeNMS.java index bf647d12..b8232489 100644 --- a/nms/v1_20_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R3/BiomeNMS.java +++ b/nms/v1_20_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R3/BiomeNMS.java @@ -7,7 +7,7 @@ import java.util.ArrayList; import java.util.List; -public class BiomeNMS extends BiomesImpl { +public class BiomeNMS extends BiomesImpl { @Override public Biome getBiome(String biomeName) { diff --git a/nms/v1_20_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R3/WorldNMS.java b/nms/v1_20_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R3/WorldNMS.java index 2cb14e12..4c16b423 100644 --- a/nms/v1_20_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R3/WorldNMS.java +++ b/nms/v1_20_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R3/WorldNMS.java @@ -47,8 +47,6 @@ import java.io.File; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.List; import java.util.Locale; @@ -284,7 +282,7 @@ private double[] getTPSFromRegion(ServerLevel world, int x, int z) { } else { io.papermc.paper.threadedregions.TickRegions.TickRegionData regionData = region.getData(); final long currTime = System.nanoTime(); - return new double[] { + return new double[]{ regionData.getRegionSchedulingHandle().getTickReport5s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport15s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport1m(currTime).tpsData().segmentAll().average(), diff --git a/nms/v1_20_R4/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R4/BiomeNMS.java b/nms/v1_20_R4/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R4/BiomeNMS.java index f9dcb9b2..a31b46ba 100644 --- a/nms/v1_20_R4/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R4/BiomeNMS.java +++ b/nms/v1_20_R4/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R4/BiomeNMS.java @@ -3,7 +3,6 @@ import fr.euphyllia.skyllia.api.utils.nms.BiomesImpl; import io.papermc.paper.registry.RegistryAccess; import io.papermc.paper.registry.RegistryKey; -import org.bukkit.Registry; import org.bukkit.block.Biome; import java.util.ArrayList; diff --git a/nms/v1_20_R4/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R4/WorldNMS.java b/nms/v1_20_R4/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R4/WorldNMS.java index ee6a9aaf..48381fcc 100644 --- a/nms/v1_20_R4/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R4/WorldNMS.java +++ b/nms/v1_20_R4/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_20_R4/WorldNMS.java @@ -49,9 +49,6 @@ import java.io.File; import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.List; import java.util.Locale; @@ -66,6 +63,24 @@ static GameType getGameType(GameMode gameMode) { }; } + public static double[] getTPSFromRegion(ServerLevel world, int x, int z) { + io.papermc.paper.threadedregions.ThreadedRegionizer.ThreadedRegion + region = world.regioniser.getRegionAtSynchronised(x, z); + if (region == null) { + return null; + } else { + io.papermc.paper.threadedregions.TickRegions.TickRegionData regionData = region.getData(); + final long currTime = System.nanoTime(); + return new double[]{ + regionData.getRegionSchedulingHandle().getTickReport5s(currTime).tpsData().segmentAll().average(), + regionData.getRegionSchedulingHandle().getTickReport15s(currTime).tpsData().segmentAll().average(), + regionData.getRegionSchedulingHandle().getTickReport1m(currTime).tpsData().segmentAll().average(), + regionData.getRegionSchedulingHandle().getTickReport5m(currTime).tpsData().segmentAll().average(), + regionData.getRegionSchedulingHandle().getTickReport15m(currTime).tpsData().segmentAll().average(), + }; + } + } + @Override public WorldFeedback.FeedbackWorld createWorld(WorldCreator creator) { CraftServer craftServer = (CraftServer) Bukkit.getServer(); @@ -280,22 +295,4 @@ public void resetChunk(World craftWorld, Position position) { final ServerLevel world = ((CraftWorld) chunk.getWorld()).getHandle(); return getTPSFromRegion(world, x, z); } - - public static double[] getTPSFromRegion(ServerLevel world, int x, int z) { - io.papermc.paper.threadedregions.ThreadedRegionizer.ThreadedRegion - region = world.regioniser.getRegionAtSynchronised(x, z); - if (region == null) { - return null; - } else { - io.papermc.paper.threadedregions.TickRegions.TickRegionData regionData = region.getData(); - final long currTime = System.nanoTime(); - return new double[] { - regionData.getRegionSchedulingHandle().getTickReport5s(currTime).tpsData().segmentAll().average(), - regionData.getRegionSchedulingHandle().getTickReport15s(currTime).tpsData().segmentAll().average(), - regionData.getRegionSchedulingHandle().getTickReport1m(currTime).tpsData().segmentAll().average(), - regionData.getRegionSchedulingHandle().getTickReport5m(currTime).tpsData().segmentAll().average(), - regionData.getRegionSchedulingHandle().getTickReport15m(currTime).tpsData().segmentAll().average(), - }; - } - } } diff --git a/nms/v1_21_R1/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R1/WorldNMS.java b/nms/v1_21_R1/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R1/WorldNMS.java index 9c5a7947..8f3dcd78 100644 --- a/nms/v1_21_R1/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R1/WorldNMS.java +++ b/nms/v1_21_R1/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R1/WorldNMS.java @@ -6,7 +6,6 @@ import com.mojang.serialization.Lifecycle; import fr.euphyllia.skyllia.api.skyblock.model.Position; import fr.euphyllia.skyllia.api.world.WorldFeedback; -import net.kyori.adventure.util.TriState; import net.minecraft.core.BlockPos; import net.minecraft.core.RegistryAccess; import net.minecraft.core.registries.Registries; @@ -50,9 +49,6 @@ import java.io.File; import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.List; import java.util.Locale; @@ -291,7 +287,7 @@ private double[] getTPSFromRegion(ServerLevel world, int x, int z) { } else { io.papermc.paper.threadedregions.TickRegions.TickRegionData regionData = region.getData(); final long currTime = System.nanoTime(); - return new double[] { + return new double[]{ regionData.getRegionSchedulingHandle().getTickReport5s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport15s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport1m(currTime).tpsData().segmentAll().average(), diff --git a/nms/v1_21_R2/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R2/WorldNMS.java b/nms/v1_21_R2/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R2/WorldNMS.java index 29e69b4c..9c10ee15 100644 --- a/nms/v1_21_R2/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R2/WorldNMS.java +++ b/nms/v1_21_R2/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R2/WorldNMS.java @@ -6,7 +6,6 @@ import com.mojang.serialization.Lifecycle; import fr.euphyllia.skyllia.api.skyblock.model.Position; import fr.euphyllia.skyllia.api.world.WorldFeedback; -import net.kyori.adventure.util.TriState; import net.minecraft.core.BlockPos; import net.minecraft.core.RegistryAccess; import net.minecraft.core.registries.Registries; @@ -51,8 +50,6 @@ import java.io.File; import java.io.IOException; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.List; import java.util.Locale; @@ -67,6 +64,17 @@ static GameType getGameType(GameMode gameMode) { }; } + private static void setRandomSpawnSelection(ServerLevel serverLevel) throws NoSuchFieldException, IllegalAccessException { + Class clazz = serverLevel.getClass(); + + // Obtention du champ 'randomSpawnSelection' + Field randomSpawnSelectionField = clazz.getDeclaredField("randomSpawnSelection"); + randomSpawnSelectionField.setAccessible(true); + + ChunkPos newValue = new ChunkPos(serverLevel.getChunkSource().randomState().sampler().findSpawnPosition()); + randomSpawnSelectionField.set(serverLevel, newValue); + } + @Override public WorldFeedback.FeedbackWorld createWorld(WorldCreator creator) { CraftServer craftServer = (CraftServer) Bukkit.getServer(); @@ -254,17 +262,6 @@ public void resetChunk(World craftWorld, Position position) { } } - private static void setRandomSpawnSelection(ServerLevel serverLevel) throws NoSuchFieldException, IllegalAccessException { - Class clazz = serverLevel.getClass(); - - // Obtention du champ 'randomSpawnSelection' - Field randomSpawnSelectionField = clazz.getDeclaredField("randomSpawnSelection"); - randomSpawnSelectionField.setAccessible(true); - - ChunkPos newValue = new ChunkPos(serverLevel.getChunkSource().randomState().sampler().findSpawnPosition()); - randomSpawnSelectionField.set(serverLevel, newValue); - } - /** * Gets the current location TPS. * @@ -301,7 +298,7 @@ private double[] getTPSFromRegion(ServerLevel world, int x, int z) { } else { io.papermc.paper.threadedregions.TickRegions.TickRegionData regionData = region.getData(); final long currTime = System.nanoTime(); - return new double[] { + return new double[]{ regionData.getRegionSchedulingHandle().getTickReport5s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport15s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport1m(currTime).tpsData().segmentAll().average(), diff --git a/nms/v1_21_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R3/WorldNMS.java b/nms/v1_21_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R3/WorldNMS.java index 8739f5f1..bed47827 100644 --- a/nms/v1_21_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R3/WorldNMS.java +++ b/nms/v1_21_R3/src/main/java/fr/euphyllia/skyllia/utils/nms/v1_21_R3/WorldNMS.java @@ -6,7 +6,6 @@ import com.mojang.serialization.Lifecycle; import fr.euphyllia.skyllia.api.skyblock.model.Position; import fr.euphyllia.skyllia.api.world.WorldFeedback; -import net.kyori.adventure.util.TriState; import net.minecraft.core.BlockPos; import net.minecraft.core.RegistryAccess; import net.minecraft.core.registries.Registries; @@ -51,8 +50,6 @@ import java.io.File; import java.io.IOException; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.List; import java.util.Locale; @@ -67,6 +64,17 @@ static GameType getGameType(GameMode gameMode) { }; } + private static void setRandomSpawnSelection(ServerLevel serverLevel) throws NoSuchFieldException, IllegalAccessException { + Class clazz = serverLevel.getClass(); + + // Obtention du champ 'randomSpawnSelection' + Field randomSpawnSelectionField = clazz.getDeclaredField("randomSpawnSelection"); + randomSpawnSelectionField.setAccessible(true); + + ChunkPos newValue = new ChunkPos(serverLevel.getChunkSource().randomState().sampler().findSpawnPosition()); + randomSpawnSelectionField.set(serverLevel, newValue); + } + @Override public WorldFeedback.FeedbackWorld createWorld(WorldCreator creator) { CraftServer craftServer = (CraftServer) Bukkit.getServer(); @@ -255,17 +263,6 @@ public void resetChunk(World craftWorld, Position position) { } } - private static void setRandomSpawnSelection(ServerLevel serverLevel) throws NoSuchFieldException, IllegalAccessException { - Class clazz = serverLevel.getClass(); - - // Obtention du champ 'randomSpawnSelection' - Field randomSpawnSelectionField = clazz.getDeclaredField("randomSpawnSelection"); - randomSpawnSelectionField.setAccessible(true); - - ChunkPos newValue = new ChunkPos(serverLevel.getChunkSource().randomState().sampler().findSpawnPosition()); - randomSpawnSelectionField.set(serverLevel, newValue); - } - /** * Gets the current location TPS. * @@ -302,7 +299,7 @@ private double[] getTPSFromRegion(ServerLevel world, int x, int z) { } else { io.papermc.paper.threadedregions.TickRegions.TickRegionData regionData = region.getData(); final long currTime = System.nanoTime(); - return new double[] { + return new double[]{ regionData.getRegionSchedulingHandle().getTickReport5s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport15s(currTime).tpsData().segmentAll().average(), regionData.getRegionSchedulingHandle().getTickReport1m(currTime).tpsData().segmentAll().average(), diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetMaxMembersSubCommands.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetMaxMembersSubCommands.java index 17335b7f..8d1e0366 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetMaxMembersSubCommands.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetMaxMembersSubCommands.java @@ -90,9 +90,7 @@ public boolean onCommand(@NotNull Plugin plugin, @NotNull CommandSender sender, .map(Player::getName) .filter(name -> name.toLowerCase().startsWith(partial)) .collect(Collectors.toList()); - } - - else if (args.length == 2) { + } else if (args.length == 2) { String partial = args[1].trim().toLowerCase(); List possibleValues = Arrays.asList("5", "10", "15", "20", "25"); return possibleValues.stream() diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/AccessSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/AccessSubCommand.java index 9421194f..8619feb9 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/AccessSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/AccessSubCommand.java @@ -4,12 +4,9 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.api.utils.RegionUtils; import fr.euphyllia.skyllia.configuration.ConfigToml; import fr.euphyllia.skyllia.configuration.LanguageToml; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/BanSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/BanSubCommand.java index 842455a8..183e2a38 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/BanSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/BanSubCommand.java @@ -4,12 +4,9 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DebugSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DebugSubCommand.java index 0a1fcb83..bb6c0574 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DebugSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DebugSubCommand.java @@ -4,12 +4,8 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DelWarpSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DelWarpSubCommand.java index e9a633bb..f0da6edf 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DelWarpSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DelWarpSubCommand.java @@ -4,12 +4,8 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.cache.commands.CacheCommands; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DeleteSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DeleteSubCommand.java index df7015ed..a1b64899 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DeleteSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DeleteSubCommand.java @@ -8,6 +8,7 @@ import fr.euphyllia.skyllia.api.skyblock.Players; import fr.euphyllia.skyllia.api.skyblock.enums.RemovalCause; import fr.euphyllia.skyllia.api.skyblock.model.RoleType; +import fr.euphyllia.skyllia.api.utils.RegionUtils; import fr.euphyllia.skyllia.configuration.ConfigToml; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager; @@ -19,6 +20,7 @@ import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.command.CommandSender; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; @@ -129,6 +131,7 @@ public boolean onCommand(@NotNull Plugin plugin, @NotNull CommandSender sender, boolean isDisabled = island.setDisable(true); if (isDisabled) { this.updatePlayer(Main.getPlugin(Main.class), skyblockManager, island); + this.kickAllPlayerOnIsland(island); for (WorldConfig worldConfig : ConfigToml.worldConfigs) { WorldEditUtils.deleteIsland(Main.getPlugin(Main.class), island, Bukkit.getWorld(worldConfig.name())); @@ -163,4 +166,14 @@ private void updatePlayer(Main plugin, SkyblockManager skyblockManager, Island i checkClearPlayer(plugin, skyblockManager, players, RemovalCause.ISLAND_DELETED); } } + + private void kickAllPlayerOnIsland(final Island island) { + ConfigToml.worldConfigs.forEach(worldConfig -> { + RegionUtils.getEntitiesInRegion(Main.getPlugin(Main.class), ConfigToml.regionDistance, EntityType.PLAYER, Bukkit.getWorld(worldConfig.name()), island.getPosition(), island.getSize(), entity -> { + Player playerInIsland = (Player) entity; + if (PermissionImp.hasPermission(entity, "skyllia.island.command.access.bypass")) return; + PlayerUtils.teleportPlayerSpawn(playerInIsland); + }); + }); + } } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DemoteSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DemoteSubCommand.java index aecb8b54..50c20530 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DemoteSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DemoteSubCommand.java @@ -4,12 +4,9 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/ExpelSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/ExpelSubCommand.java index 3e6df2ac..94d5a4ef 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/ExpelSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/ExpelSubCommand.java @@ -4,13 +4,9 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.Position; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.api.utils.helper.RegionHelper; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/GameRuleSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/GameRuleSubCommand.java index 26784a0f..21608f44 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/GameRuleSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/GameRuleSubCommand.java @@ -6,11 +6,8 @@ import fr.euphyllia.skyllia.api.skyblock.Island; import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java index 1c49c809..70c178c4 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java @@ -5,12 +5,9 @@ import fr.euphyllia.skyllia.api.SkylliaAPI; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.cache.InviteCacheExecution; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PermissionSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PermissionSubCommand.java index 8be089ce..9f1b9bee 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PermissionSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PermissionSubCommand.java @@ -128,7 +128,7 @@ public boolean onCommand(@NotNull Plugin plugin, @NotNull CommandSender sender, List permissionValues = switch (permissionsType) { case COMMANDS -> Arrays.stream(PermissionsCommandIsland.values()).map(Enum::name).toList(); - case ISLAND -> Arrays.stream(PermissionsIsland.values()).map(Enum::name).toList(); + case ISLAND -> Arrays.stream(PermissionsIsland.values()).map(Enum::name).toList(); case INVENTORY -> Arrays.stream(PermissionsInventory.values()).map(Enum::name).toList(); }; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PromoteSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PromoteSubCommand.java index 2c06d3bc..33d7ee67 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PromoteSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PromoteSubCommand.java @@ -4,12 +4,9 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetBiomeSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetBiomeSubCommand.java index e59038af..c35e2e10 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetBiomeSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetBiomeSubCommand.java @@ -5,13 +5,9 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.Position; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.api.utils.helper.RegionHelper; import fr.euphyllia.skyllia.api.utils.nms.BiomesImpl; import fr.euphyllia.skyllia.cache.CommandCacheExecution; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetHomeSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetHomeSubCommand.java index 9860bb2d..cdc494d1 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetHomeSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetHomeSubCommand.java @@ -4,13 +4,9 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.Position; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.api.utils.helper.RegionHelper; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetWarpSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetWarpSubCommand.java index 26676b3d..6d4f44ee 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetWarpSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetWarpSubCommand.java @@ -4,13 +4,9 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.Position; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.api.utils.helper.RegionHelper; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; @@ -72,7 +68,6 @@ public boolean onCommand(@NotNull Plugin plugin, @NotNull CommandSender sender, Position islandPosition = island.getPosition(); - try { player.getScheduler().run(plugin, aScheduled -> { int regionLocX = playerLocation.getChunk().getX(); diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TrustSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TrustSubCommand.java index 0ac3eebd..52674de5 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TrustSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TrustSubCommand.java @@ -4,12 +4,8 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.cache.PlayersInIslandCache; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UnbanSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UnbanSubCommand.java index 7ad83dc8..cee5b0d0 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UnbanSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UnbanSubCommand.java @@ -4,12 +4,8 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UntrustSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UntrustSubCommand.java index 127d9c28..9666ffcd 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UntrustSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UntrustSubCommand.java @@ -4,12 +4,8 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.cache.PlayersInIslandCache; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/WarpSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/WarpSubCommand.java index 4e21c337..f432db32 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/WarpSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/WarpSubCommand.java @@ -4,13 +4,9 @@ import fr.euphyllia.skyllia.api.PermissionImp; import fr.euphyllia.skyllia.api.commands.SubCommandInterface; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.WarpIsland; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; import fr.euphyllia.skyllia.cache.commands.CacheCommands; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.PermissionsManagers; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/configuration/model/MariaDB.java b/plugin/src/main/java/fr/euphyllia/skyllia/configuration/model/MariaDB.java index 9051ef4a..25f92f13 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/configuration/model/MariaDB.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/configuration/model/MariaDB.java @@ -46,7 +46,7 @@ private boolean useSSL() { } private int minPool() { - return getInt(path.formatted("minPool"), 3); + return getInt(path.formatted("minPool"), 3); } private Long maxLifeTime() { diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/SpiralBatchInserter.java b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/SpiralBatchInserter.java index 34fae564..8621797f 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/SpiralBatchInserter.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/SpiralBatchInserter.java @@ -79,6 +79,6 @@ public void run(Connection connection) throws DatabaseException { /** * Represents the data for an island. */ - public record IslandData(int id, int regionX, int regionZ) { + public record IslandData(int id, int regionX, int regionZ) { } } \ No newline at end of file diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandData.java b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandData.java index 297b62ca..a9816ff1 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandData.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandData.java @@ -1,11 +1,11 @@ package fr.euphyllia.skyllia.database.mariadb.exec; import fr.euphyllia.skyllia.api.InterneAPI; +import fr.euphyllia.skyllia.api.database.IslandDataQuery; import fr.euphyllia.skyllia.api.event.SkyblockLoadEvent; import fr.euphyllia.skyllia.api.exceptions.MaxIslandSizeExceedException; import fr.euphyllia.skyllia.api.skyblock.Island; import fr.euphyllia.skyllia.api.skyblock.model.Position; -import fr.euphyllia.skyllia.api.database.IslandDataQuery; import fr.euphyllia.skyllia.managers.skyblock.IslandHook; import fr.euphyllia.skyllia.sgbd.exceptions.DatabaseException; import fr.euphyllia.skyllia.sgbd.execute.MariaDBExecute; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandMember.java b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandMember.java index 9b15350c..5f071c77 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandMember.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandMember.java @@ -1,11 +1,11 @@ package fr.euphyllia.skyllia.database.mariadb.exec; import fr.euphyllia.skyllia.api.InterneAPI; +import fr.euphyllia.skyllia.api.database.IslandMemberQuery; import fr.euphyllia.skyllia.api.skyblock.Island; import fr.euphyllia.skyllia.api.skyblock.Players; import fr.euphyllia.skyllia.api.skyblock.enums.RemovalCause; import fr.euphyllia.skyllia.api.skyblock.model.RoleType; -import fr.euphyllia.skyllia.api.database.IslandMemberQuery; import fr.euphyllia.skyllia.sgbd.exceptions.DatabaseException; import fr.euphyllia.skyllia.sgbd.execute.MariaDBExecute; import org.apache.logging.log4j.Level; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandPermission.java b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandPermission.java index 1563149e..5364ace4 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandPermission.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandPermission.java @@ -1,11 +1,11 @@ package fr.euphyllia.skyllia.database.mariadb.exec; import fr.euphyllia.skyllia.api.InterneAPI; +import fr.euphyllia.skyllia.api.database.IslandPermissionQuery; import fr.euphyllia.skyllia.api.skyblock.Island; import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType; -import fr.euphyllia.skyllia.api.database.IslandPermissionQuery; import fr.euphyllia.skyllia.sgbd.exceptions.DatabaseException; import fr.euphyllia.skyllia.sgbd.execute.MariaDBExecute; import org.apache.logging.log4j.Level; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandUpdate.java b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandUpdate.java index fcbf7c6f..90b83969 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandUpdate.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandUpdate.java @@ -1,8 +1,8 @@ package fr.euphyllia.skyllia.database.mariadb.exec; import fr.euphyllia.skyllia.api.InterneAPI; -import fr.euphyllia.skyllia.api.skyblock.Island; import fr.euphyllia.skyllia.api.database.IslandUpdateQuery; +import fr.euphyllia.skyllia.api.skyblock.Island; import fr.euphyllia.skyllia.sgbd.exceptions.DatabaseException; import fr.euphyllia.skyllia.sgbd.execute.MariaDBExecute; import org.apache.logging.log4j.LogManager; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandWarp.java b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandWarp.java index 69e106e1..9b0764c5 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandWarp.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/database/mariadb/exec/MariaDBIslandWarp.java @@ -1,9 +1,9 @@ package fr.euphyllia.skyllia.database.mariadb.exec; import fr.euphyllia.skyllia.api.InterneAPI; +import fr.euphyllia.skyllia.api.database.IslandWarpQuery; import fr.euphyllia.skyllia.api.skyblock.Island; import fr.euphyllia.skyllia.api.skyblock.model.WarpIsland; -import fr.euphyllia.skyllia.api.database.IslandWarpQuery; import fr.euphyllia.skyllia.sgbd.exceptions.DatabaseException; import fr.euphyllia.skyllia.sgbd.execute.MariaDBExecute; import org.apache.logging.log4j.Level; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/ListenersUtils.java b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/ListenersUtils.java index b406c164..eb532f10 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/ListenersUtils.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/ListenersUtils.java @@ -3,16 +3,11 @@ import fr.euphyllia.skyllia.api.configuration.WorldConfig; import fr.euphyllia.skyllia.api.event.players.PlayerPrepareChangeWorldSkyblockEvent; import fr.euphyllia.skyllia.api.skyblock.Island; -import fr.euphyllia.skyllia.api.skyblock.PermissionManager; import fr.euphyllia.skyllia.api.skyblock.Players; -import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.Position; -import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland; import fr.euphyllia.skyllia.api.skyblock.model.permissions.Permissions; import fr.euphyllia.skyllia.api.utils.helper.RegionHelper; -import fr.euphyllia.skyllia.cache.PermissionGameRuleInIslandCache; -import fr.euphyllia.skyllia.cache.PermissionRoleInIslandCache; import fr.euphyllia.skyllia.cache.PlayersInIslandCache; import fr.euphyllia.skyllia.cache.PositionIslandCache; import fr.euphyllia.skyllia.managers.PermissionsManagers; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/managers/PermissionsManagers.java b/plugin/src/main/java/fr/euphyllia/skyllia/managers/PermissionsManagers.java index 90be66dc..8b5182a3 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/managers/PermissionsManagers.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/managers/PermissionsManagers.java @@ -7,14 +7,16 @@ import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland; import fr.euphyllia.skyllia.api.skyblock.model.RoleType; import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland; -import fr.euphyllia.skyllia.api.skyblock.model.permissions.*; +import fr.euphyllia.skyllia.api.skyblock.model.permissions.Permissions; +import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland; +import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsInventory; +import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsIsland; import fr.euphyllia.skyllia.cache.PermissionGameRuleInIslandCache; import fr.euphyllia.skyllia.cache.PermissionRoleInIslandCache; import fr.euphyllia.skyllia.cache.PlayersInIslandCache; import fr.euphyllia.skyllia.configuration.LanguageToml; import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager; import org.bukkit.Bukkit; -import org.bukkit.Location; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; @@ -24,16 +26,6 @@ public class PermissionsManagers { - /** - * Represents the various types of debugging that can be managed. - */ - public enum DebugType { - GAME_RULE, - COMMANDS_PERMISSION, - ISLAND_PERMISSION, - INVENTORY_PERMISSION - } - /** * A thread-safe map that holds debug permissions for each player and debug type. */ @@ -126,7 +118,6 @@ public static boolean testPermissions(Players executorPlayer, Player player, Isl return false; } - public static boolean testGameRule(GameRuleIsland gameRule, Island island) { long permissionChecker = PermissionGameRuleInIslandCache.getGameruleInIsland(island.getId()); PermissionManager permissionManager = new PermissionManager(permissionChecker); @@ -155,7 +146,6 @@ private static void sendDebugGameRule(GameRuleIsland gameRule, Island island, bo }); } - private static void sendDebugPermissions(Player player, Permissions permissions, PermissionRoleIsland permissionRoleIsland, @@ -174,7 +164,6 @@ private static void sendDebugPermissions(Player player, }); } - /** * Détermine le type de débogage associé à une permission. */ @@ -190,4 +179,15 @@ private static DebugType getDebugType(Permissions permissions, GameRuleIsland ga } return null; } + + + /** + * Represents the various types of debugging that can be managed. + */ + public enum DebugType { + GAME_RULE, + COMMANDS_PERMISSION, + ISLAND_PERMISSION, + INVENTORY_PERMISSION + } } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/managers/skyblock/IslandHook.java b/plugin/src/main/java/fr/euphyllia/skyllia/managers/skyblock/IslandHook.java index df0d3c1b..f8393a15 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/managers/skyblock/IslandHook.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/managers/skyblock/IslandHook.java @@ -70,19 +70,25 @@ public Timestamp getCreateDate() { return this.createDate; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public UUID getId() { return this.islandId; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public double getSize() { return this.islandSize; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean setSize(double newSize) throws MaxIslandSizeExceedException { if (newSize >= (255 * ConfigToml.regionDistance) || newSize <= 1) { @@ -108,19 +114,25 @@ public boolean setSize(double newSize) throws MaxIslandSizeExceedException { return false; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public @Nullable CopyOnWriteArrayList getWarps() { return this.plugin.getInterneAPI().getSkyblockManager().getWarpsIsland(this).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public @Nullable WarpIsland getWarpByName(String name) { return this.plugin.getInterneAPI().getSkyblockManager().getWarpIslandByName(this, name).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean addWarps(String name, Location loc, boolean ignoreEvent) { SkyblockCreateWarpEvent event = new SkyblockCreateWarpEvent(this, name, loc); @@ -135,7 +147,9 @@ public boolean addWarps(String name, Location loc, boolean ignoreEvent) { .addWarpsIsland(this, event.getWarpName(), event.getWarpLocation()).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean delWarp(String name) { SkyblockDeleteWarpEvent event = new SkyblockDeleteWarpEvent(this, name); @@ -147,13 +161,17 @@ public boolean delWarp(String name) { .delWarpsIsland(this, event.getWarpName()).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean isDisable() { return this.plugin.getInterneAPI().getSkyblockManager().isDisabledIsland(this).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean setDisable(boolean disable) { SkyblockDeleteEvent event = new SkyblockDeleteEvent(this); @@ -164,13 +182,17 @@ public boolean setDisable(boolean disable) { return this.plugin.getInterneAPI().getSkyblockManager().disableIsland(this, disable).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean isPrivateIsland() { return this.plugin.getInterneAPI().getSkyblockManager().isPrivateIsland(this).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean setPrivateIsland(boolean privateIsland) { SkyblockChangeAccessEvent event = new SkyblockChangeAccessEvent(this); @@ -181,43 +203,57 @@ public boolean setPrivateIsland(boolean privateIsland) { return this.plugin.getInterneAPI().getSkyblockManager().setPrivateIsland(this, privateIsland).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CopyOnWriteArrayList getMembers() { return this.plugin.getInterneAPI().getSkyblockManager().getMembersInIsland(this).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CopyOnWriteArrayList getMembersCached() { return PlayersInIslandCache.getPlayersCached(this.islandId); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Players getMember(UUID mojangId) { return this.plugin.getInterneAPI().getSkyblockManager().getMemberInIsland(this, mojangId).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public @Nullable Players getMember(String playerName) { return this.plugin.getInterneAPI().getSkyblockManager().getMemberInIsland(this, playerName).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean removeMember(Players oldMember) { return this.plugin.getInterneAPI().getSkyblockManager().deleteMember(this, oldMember).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean updateMember(Players member) { return this.plugin.getInterneAPI().getSkyblockManager().updateMember(this, member).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean updatePermission(PermissionsType permissionsType, RoleType roleType, long permissions) { boolean isUpdated = this.plugin.getInterneAPI().getSkyblockManager() @@ -231,26 +267,34 @@ public boolean updatePermission(PermissionsType permissionsType, RoleType roleTy return false; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Position getPosition() { return this.position; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public int getMaxMembers() { int value = this.plugin.getInterneAPI().getSkyblockManager().getMaxMemberInIsland(this).join(); return (value == -1) ? this.maxMemberInIsland : value; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean setMaxMembers(int newMax) { return this.plugin.getInterneAPI().getSkyblockManager().setMaxMemberInIsland(this, newMax).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public boolean updateGamerule(long gameRuleValue) { boolean isUpdated = this.plugin.getInterneAPI().getSkyblockManager().updateGamerule(this, gameRuleValue).join(); @@ -263,13 +307,17 @@ public boolean updateGamerule(long gameRuleValue) { return false; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public long getGameRulePermission() { return this.plugin.getInterneAPI().getSkyblockManager().getGameRulePermission(this).join(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public long getPermission(PermissionsType permissionsType, RoleType roleType) { return this.plugin.getInterneAPI() diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/managers/skyblock/SkyblockManager.java b/plugin/src/main/java/fr/euphyllia/skyllia/managers/skyblock/SkyblockManager.java index 58963481..43a4bda0 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/managers/skyblock/SkyblockManager.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/managers/skyblock/SkyblockManager.java @@ -26,8 +26,8 @@ */ public class SkyblockManager { - private final Main plugin; private static final Logger LOGGER = LogManager.getLogger(SkyblockManager.class); + private final Main plugin; public SkyblockManager(Main main) { this.plugin = main; @@ -359,7 +359,7 @@ public CompletableFuture getMaxMemberInIsland(Island island) { /** * Sets the maximum number of members allowed in the island. * - * @param island The {@link Island}. + * @param island The {@link Island}. * @param newValue The new maximum. * @return A {@link CompletableFuture} with {@code true} if successfully updated, {@code false} otherwise. */ @@ -370,7 +370,7 @@ public CompletableFuture setMaxMemberInIsland(Island island, int newVal /** * Sets the size of the island. * - * @param island The {@link Island}. + * @param island The {@link Island}. * @param newValue The new size (radius). * @return A {@link CompletableFuture} with {@code true} if successfully updated, {@code false} otherwise. */ diff --git a/readme.md b/readme.md index cfde28c2..a61e08c9 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,8 @@ # Skyllia - Skyblock Plugin for Minecraft -Skyllia is a Skyblock plugin designed primarily for Folia but also compatible with Paper (1.20.1+). The plugin has an API that you can use to add feature extensions to customize your server. The plugin will have very little innovative functionality, and it's not my intention at all that there should be external features (like quests, for example). +Skyllia is a Skyblock plugin designed primarily for Folia but also compatible with Paper (1.20.1+). The plugin has an +API that you can use to add feature extensions to customize your server. The plugin will have very little innovative +functionality, and it's not my intention at all that there should be external features (like quests, for example). ## bStats @@ -34,7 +36,8 @@ Skyllia is a Skyblock plugin designed primarily for Folia but also compatible wi - A MariaDB database - Paper 1.20.1+ or Folia 1.20+ - Java 21 -- WorldEdit ([Folia](https://github.com/Euphillya/WorldEdit-Folia/actions) or [Original](https://modrinth.com/plugin/worldedit/versions?l=bukkit)) +- WorldEdit ([Folia](https://github.com/Euphillya/WorldEdit-Folia/actions) + or [Original](https://modrinth.com/plugin/worldedit/versions?l=bukkit)) ## Installation @@ -52,7 +55,8 @@ Skyllia is a Skyblock plugin designed primarily for Folia but also compatible wi ## Configuration -Configuration files are located in the `plugins/Skyllia` directory. Customize settings to fit your server's needs. Detailed configuration instructions can be found in the [Wiki](https://github.com/Euphillya/Skyllia/wiki/Configuration). +Configuration files are located in the `plugins/Skyllia` directory. Customize settings to fit your server's needs. +Detailed configuration instructions can be found in the [Wiki](https://github.com/Euphillya/Skyllia/wiki/Configuration). ## API @@ -92,7 +96,9 @@ UUID islandId = playerIsland.getId(); ## Commands & Permissions -Skyllia comes with a set of commands and permissions to manage the plugin effectively. For a full list of commands and their permissions, refer to the [Commands & Permissions](https://github.com/Euphillya/Skyllia/wiki/Commands-and-Permissions) section in the Wiki. +Skyllia comes with a set of commands and permissions to manage the plugin effectively. For a full list of commands and +their permissions, refer to +the [Commands & Permissions](https://github.com/Euphillya/Skyllia/wiki/Commands-and-Permissions) section in the Wiki. ## Compatible Software