### DragonAPI: Accessing Plugin Configuration and Utilities (Kotlin) Source: https://context7.com/bildcraft1/dragoncore/llms.txt The DragonAPI class provides programmatic access to DragonCore's features, including configuration settings, server information, and GUI item creation. It's the central point for interacting with the plugin's functionalities. ```kotlin import com.whixard.dragoncore.api.DragonAPI // Get plugin configuration val api = DragonAPI() val config = api.getConfig() val langFile = api.getLangFile() // Check if chat filter is enabled val chatFilterEnabled = config.getBoolean("functions.chat_filter") // Get server information val serverVersion = api.getServerVersion() // Full server version string val serverVersionName = api.getServerVersionName() // e.g., "1.19.3" val pluginVersion = api.getPluginVersion() // e.g., "1.1.0" val serverName = api.getServerName() // Get player ping val playerPing = api.getPlayerPing("PlayerName") // Get list of installed plugins val plugins: List = api.getPlugins() // Create GUI items for inventory menus val guiItem = api.createGuiItem( Material.DIAMOND, "&bExample Item", "&7Line 1 of lore", "&7Line 2 of lore" ) // Create GUI item with custom model data val customGuiItem = api.createGuiItemCustom( Material.PAPER, "&aCustom Item", "&7Has random custom model data" ) ``` -------------------------------- ### ReportAPI: Player Report Management and Discord Integration (Kotlin) Source: https://context7.com/bildcraft1/dragoncore/llms.txt The ReportAPI facilitates player report management, including creation, retrieval, and deletion. It also supports sending report notifications to a Discord webhook for real-time staff alerts. ```kotlin import com.whixard.dragoncore.api.ReportAPI import org.bukkit.entity.Player val reportApi = ReportAPI() // Create a new report fun createPlayerReport(target: Player, reporter: Player, reason: String) { reportApi.createReport(target, reason, reporter, false) // Optionally send to Discord webhook reportApi.sendDiscordReport(target, reason, reporter) } // Get all reports val allReports: List = reportApi.getReports() for (report in allReports) { println("ID: ${report.id}") println("Player: ${report.name} (${report.uuid})") println("Reason: ${report.reason}") println("Reporter: ${report.reporter}") println("Status: ${report.status}") } // Get a specific report by ID val report = reportApi.getReport(1) // Check if report is being handled val isBeingChecked = reportApi.checkReport(1) // Mark report as being checked by staff reportApi.setReport(1, true) // Delete a report reportApi.deleteReport(1) ``` -------------------------------- ### DragonCore Configuration Files (YAML) Source: https://context7.com/bildcraft1/dragoncore/llms.txt DragonCore utilizes YAML files for its configuration. 'config.yml' manages core plugin settings such as database connection, enabled features, resource pack settings, and Discord webhook. 'messages.yml' allows customization of all in-game messages, including staff commands, general information, and player feedback. ```yaml database: type: MariaDB username: "root" password: "password" host: "localhost" port: 3306 database: "database" functions: tag_system: true chat_filter: true database: true anti-exploit: true resourcePack: enabled: false url: "" hash: "" prompt: "Enable the texture pack for better experience" forced: false screenshare: ban_command: "ban %player% Cheating" discord: webhook: "" ``` ```yaml messages: staff_command_list: - "&b/staffmode&7 - Toggle staff mode" - "&b/stafflist&7 - List all staff members" about: "&7This server is running &bDragonCore &7version &b{version}&7." no_permission: "&cYou do not have permission to use this command." flyon: "&aYou have enabled flight." flyoff: "&cYou have disabled flight." usage: "&cUsage: {usage}" heal: "&aYou have been healed." screenshare: "&aYou have been screenshared by {staffer}." player_not_online: "&cThat player is not online." tags: added: "&aYou have enabled {tag}." removed: "&cYou have disabled {tag}." ``` -------------------------------- ### Format Utility - Color and Hex Code Support (Kotlin) Source: https://context7.com/bildcraft1/dragoncore/llms.txt The Format utility class in DragonCore handles message formatting, including translating color codes (like '&a') to the section symbol and supporting RGB/hex color values. It provides methods for custom coloring, default plugin styling, and full translation with hex code integration. ```kotlin import com.whixard.dragoncore.format.Format // Translate color codes (& to section symbol) val coloredMsg = Format.color("&aGreen &bAqua &cRed") // RGB color with custom values val rgbMsg = Format.rgb(153, 0, 70, "Custom colored text") // Default plugin color scheme val defaultMsg = Format.defaultrgb("Styled message") // Hex color code support (#RRGGBB) val hexMsg = Format.hex("Normal #FF5733 Orange colored text") // Full translation with hex support val translated = Format.getTranslated("&aGreen #FF5733 Orange") ``` -------------------------------- ### DragonDatabase - Database Manager Source: https://context7.com/bildcraft1/dragoncore/llms.txt Manages MariaDB/MySQL connections and table initialization for persistent player data storage. ```APIDOC ## DragonDatabase - Database Manager ### Description Handles database lifecycle management including connection, table creation, and closing connections. ### Methods - `initializeDatabase()`: Creates the required `dragoncore` and `dragoncore_reports` tables. - `getConnection()`: Returns the active database connection. - `closeConnection()`: Safely closes the database connection. ### Schema - **dragoncore**: id (INT), uuid (VARCHAR), name (VARCHAR), tags (VARCHAR) - **dragoncore_reports**: id (INT), uuid, name, status, reason, reporter ``` -------------------------------- ### Configure DragonCore Tags Source: https://context7.com/bildcraft1/dragoncore/llms.txt Defines the structure for cosmetic tags in the configuration file. Each tag entry specifies display names, chat tags, tab list tags, and associated items. ```yaml tags: vip: name: "&6VIP" tag: "&6[VIP]" tab_tag: "&6[V]" item: GOLD_INGOT mvp: name: "&bMVP" tag: "&b[MVP]" tab_tag: "&b[M]" item: DIAMOND ``` -------------------------------- ### DragonDatabase: Managing MariaDB/MySQL Connections (Kotlin) Source: https://context7.com/bildcraft1/dragoncore/llms.txt DragonDatabase handles the connection management for MariaDB/MySQL databases, essential for storing player data persistently. It also initializes the necessary tables for features like the tag system and report tracking. ```kotlin import com.whixard.dragoncore.api.DragonDatabase // Initialize database connection (typically done on plugin enable) val db = DragonDatabase() val connection = db.getConnection() // Initialize database tables (creates dragoncore and dragoncore_reports tables) db.initializeDatabase() // Close connection when done db.closeConnection() // Database schema created: // dragoncore: id (INT), uuid (VARCHAR(36)), name (VARCHAR(16)), tags (VARCHAR(255)) // dragoncore_reports: id (INT), uuid, name, status, reason, reporter ``` -------------------------------- ### Configure Anti-Plugin Dumper Source: https://context7.com/bildcraft1/dragoncore/llms.txt Blocks specific commands that reveal server plugin information to unauthorized users. This is a security measure to prevent information gathering. ```yaml exploit: blacklist: ["plugins", "pl", "bukkit:ver"] ``` -------------------------------- ### DragonAPI - Core Plugin Interface Source: https://context7.com/bildcraft1/dragoncore/llms.txt The DragonAPI class serves as the central access point for retrieving plugin configuration, server metadata, and creating GUI items. ```APIDOC ## DragonAPI - Core Plugin Interface ### Description Provides methods to access plugin configuration, server information, player ping, and utility methods for creating GUI items. ### Methods - `getConfig()`: Returns the plugin configuration. - `getServerVersion()`: Returns the server version string. - `getPlayerPing(String playerName)`: Returns the ping of a specific player. - `createGuiItem(Material, String, String...)`: Creates an item for inventory menus. ### Usage Example ```kotlin val api = DragonAPI() val ping = api.getPlayerPing("PlayerName") val item = api.createGuiItem(Material.DIAMOND, "&bTitle", "&7Lore") ``` ``` -------------------------------- ### ReportAPI - Player Report Management Source: https://context7.com/bildcraft1/dragoncore/llms.txt Provides CRUD operations for player reports and integration with Discord webhooks for staff notifications. ```APIDOC ## ReportAPI - Player Report Management ### Description Allows developers to create, retrieve, update, and delete player reports, as well as trigger Discord webhook notifications. ### Methods - `createReport(Player target, String reason, Player reporter, boolean status)`: Creates a new report entry. - `sendDiscordReport(Player target, String reason, Player reporter)`: Sends a notification to the configured Discord webhook. - `getReports()`: Returns a list of all active reports. - `setReport(int id, boolean status)`: Updates the status of a report. - `deleteReport(int id)`: Removes a report from the database. ### Response Example { "id": 1, "name": "PlayerName", "reason": "Hacking", "status": true } ``` -------------------------------- ### Configure Chat Filter and Exploit Protection Source: https://context7.com/bildcraft1/dragoncore/llms.txt Enables the chat filtering system and defines a blacklist of forbidden words. This configuration helps prevent spam and malicious content. ```yaml functions: chat_filter: true chatfilter: blacklist: - "badword1" - "badword2" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.