From bb16ef78a4d99853d6f056cf4f46767883485337 Mon Sep 17 00:00:00 2001 From: cuqmbr Date: Fri, 18 Jul 2025 00:25:45 +0300 Subject: [PATCH] add and configure zMenu --- .dockerignore | 1 + .gitignore | 1 + src/plugins/zMenu-1.1.0.1.jar | 3 + src/plugins/zMenu/commands/commands.yml | 17 +++ src/plugins/zMenu/config.yml | 152 ++++++++++++++++++++++ src/plugins/zMenu/default_values.yml | 2 + src/plugins/zMenu/global-placeholders.yml | 0 src/plugins/zMenu/inventories/links.yml | 55 ++++++++ src/plugins/zMenu/inventories/main.yml | 49 +++++++ src/plugins/zMenu/inventories/servers.yml | 23 ++++ src/plugins/zMenu/messages.yml | 145 +++++++++++++++++++++ src/plugins/zMenu/website/inventories.yml | 82 ++++++++++++ 12 files changed, 530 insertions(+) create mode 100644 src/plugins/zMenu-1.1.0.1.jar create mode 100644 src/plugins/zMenu/commands/commands.yml create mode 100644 src/plugins/zMenu/config.yml create mode 100644 src/plugins/zMenu/default_values.yml create mode 100644 src/plugins/zMenu/global-placeholders.yml create mode 100644 src/plugins/zMenu/inventories/links.yml create mode 100644 src/plugins/zMenu/inventories/main.yml create mode 100644 src/plugins/zMenu/inventories/servers.yml create mode 100644 src/plugins/zMenu/messages.yml create mode 100644 src/plugins/zMenu/website/inventories.yml diff --git a/.dockerignore b/.dockerignore index 9396856..67028fb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -46,3 +46,4 @@ src/map-color-cache.dat src/plugins/DiscordSRV/accounts.aof src/plugins/ItemJoin/database.db +src/plugins/zMenu/database.db diff --git a/.gitignore b/.gitignore index 6ebed00..459207c 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ src/map-color-cache.dat src/plugins/DiscordSRV/accounts.aof src/plugins/ItemJoin/database.db +src/plugins/zMenu/database.db diff --git a/src/plugins/zMenu-1.1.0.1.jar b/src/plugins/zMenu-1.1.0.1.jar new file mode 100644 index 0000000..65d9422 --- /dev/null +++ b/src/plugins/zMenu-1.1.0.1.jar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50aa5b2da45e5df8e6271e84b53e20c2abefd6c83468045d77f59cfe284a88d2 +size 1472274 diff --git a/src/plugins/zMenu/commands/commands.yml b/src/plugins/zMenu/commands/commands.yml new file mode 100644 index 0000000..9d10365 --- /dev/null +++ b/src/plugins/zMenu/commands/commands.yml @@ -0,0 +1,17 @@ +commands: + main_command: + command: menu + inventory: main + permission: "zmenu.main" + servers_command: + command: servers + inventory: servers + permission: "zmenu.servers" + links_command: + command: links + inventory: links + permission: "zmenu.links" + basic_command: + command: basic_command + inventory: basic_inventory + permission: "zmenu.basic" diff --git a/src/plugins/zMenu/config.yml b/src/plugins/zMenu/config.yml new file mode 100644 index 0000000..d78600a --- /dev/null +++ b/src/plugins/zMenu/config.yml @@ -0,0 +1,152 @@ +# Enables detailed information display in the console. +# If you encounter an issue, enable this option and send the errors to support. +enable-debug: false + +# Enables execution time debugging to measure plugin performance. +# Useful for identifying bottlenecks and optimizing performance. +enable-debug-time: false + +# Enable an information message, allows you to view messages that tell you about an inventory or that an order has been successfully loaded. +enable-information-message: true + +# Storage: +# SQLITE - For the launch of the plugin only. +# HIKARICP - RECOMMENDED - HikariCP is a fast and lightweight JDBC connection pool. It optimizes database connections, ensuring quick acquisition and low latency. This improves performance and reliability, making it ideal for high-demand applications. +# NONE - If you do not need a database, you can disable it. +# +# We advise you to use HIKARICP, the SQLITE storage is only there to install the plugin and do some tests, not all features are available with SQLITE yet. +# The plugin will work, but some features like sanctions update when launching the plugin will not work. +# This will be fixed in future plugin updates +storage-type: SQLITE + +# Configuration of your database, it is recommended to use the database to store your data. +database-configuration: + # The prefix that will be applied to all tables, + # if you have several plugins with the same database, you must have one. + # It is advisable not to change this value + table-prefix: "zmenu_" + # IP Address of the machine the database is hosted on + host: 192.168.10.10 + # Port of the database, by default, MYSQL's port is 3306 + port: 3306 + # Database username + user: homestead + # Database password + password: 'secret' + # Database + database: zmenu + # Enable of not the SQL debug mode + debug: false + +# Time in seconds for saving data in batches. +# Instead of making an SQL query for each update, a single query will be executed every 10 seconds +batch-task: 10 + +# Allows saving it in the database the inventories opened by the players. +enable-player-open-inventory-logs: false + +# Enable file storage logging. +# When true, messages will be printed to the console when files are saved or loaded. +enable-log-storage-file: false + +# Enable open inventory messages. +# If enabled, the command "/zm open " will show a message to the player. +enable-open-message: false + +# Enable MiniMessage format. +# Allows the use of MiniMessage formatting (colors, gradients, etc.). Requires Minecraft 1.17+. +# More info: https://docs.advntr.dev/minimessage/index.html +enable-mini-message-format: true + +# Enable player command in chat only. +# Prevents players from executing commands from the console. Useful for "fake" commands not registered in Spigot. +enable-player-command-in-chat: false + +# Enable FastEvent system. +# Replaces some Bukkit events with a faster alternative. Enables better performance at the cost of API changes. +# Refer to documentation before enabling this. +enable-fast-event: false + +# Auto-save player data interval (in seconds). +# Determines how often the player's data is automatically saved. +seconds-save-player-data: 600 + +# Auto-save inventories data interval (in seconds). +# Determines how often the inventories are automatically saved. +seconds-save-player-inventories: 600 + +# Default menu name. +# The name of the default menu to be opened if no specific one is defined. +main-menu: "example" + +# Use swap offhand key to open main menu. +# Allows opening the default menu when the player presses the offhand (F) key. +use-swap-item-off-hand-key-to-open-main-menu: false + +# Require shift + offhand key to open menu. +# The main menu will only open when the player presses shift + offhand key together. +use-swap-item-off-hand-key-to-open-main-menu-needs-shift: false + +# Specific inventories to load at plugin start. +# Add the paths to specific menus you want loaded manually. +specify-path-menus: [ ] + +# Generate default configuration files. +# When enabled, the plugin will create default configuration files if they don't exist. +generate-default-file: false + +# Disable double-click detection. +# Prevents interactions from being triggered by double-clicking. +disable-double-click-event: true + +# Enable anti-dupe system. +# Automatically detects and prevents item duplication exploits. +enable-anti-dupe: true + +# Notify Discord when a dupe attempt is detected. +# Sends a message to a specified Discord webhook. +enable-anti-dupe-discord-notification: false + +# Webhook URL for anti-dupe Discord notifications. +# Replace with your actual Discord webhook URL. +anti-dupe-discord-webhook-url: "https://discord.com/api/webhooks/" + +# Message sent to Discord when a dupe is detected. +# Placeholders: %player%, %amount%, %itemname%. +anti-dupe-message: "**%player%** used %amount% %itemname% from zMenu. It has been removed!" + +# List of click types supported. +# You can customize which click types are allowed or handled in your menus. +all-clicks-type: + - MIDDLE + - RIGHT + - LEFT + - SHIFT_RIGHT + - SHIFT_LEFT + +# Enable caching of ItemStacks. +# Caching helps improve performance by reducing object creation. +enable-cache-item-stack: true + +# Enable click cooldown. +# Prevents players from spamming clicks too quickly. Useful to reduce abuse or bugs. +enable-cooldown-click: true + +# Cooldown duration in milliseconds between clicks. +cooldown-click-milliseconds: 100 + +# PlaceholderAPI cache duration in ticks (20 ticks = 1 second). +# Defines how often placeholders should be refreshed. +cache-placeholder-api: 20 + +# Enable PlaceholderAPI caching. +# Reduces the number of calls to PlaceholderAPI by caching values for a short period. +enable-cache-placeholder-api: true + +# Enable download command. +# Allows the use of the plugin's download feature (if applicable). +enable-download-command: false + +# Time in seconds for clean the OfflinePlayer cache +# OfflinePlayer is a variable that represents an offline player +cache-offline-player: 300 diff --git a/src/plugins/zMenu/default_values.yml b/src/plugins/zMenu/default_values.yml new file mode 100644 index 0000000..f7d6076 --- /dev/null +++ b/src/plugins/zMenu/default_values.yml @@ -0,0 +1,2 @@ +# This file creates default values for placeholders for PlayerData +values: diff --git a/src/plugins/zMenu/global-placeholders.yml b/src/plugins/zMenu/global-placeholders.yml new file mode 100644 index 0000000..e69de29 diff --git a/src/plugins/zMenu/inventories/links.yml b/src/plugins/zMenu/inventories/links.yml new file mode 100644 index 0000000..3fec80a --- /dev/null +++ b/src/plugins/zMenu/inventories/links.yml @@ -0,0 +1,55 @@ +size: 27 +name: "Main Menu > Links" + +items: + website: + slot: 10 + item: + material: green_wool + name: "Website" + lore: + # - "" + - "Click to receive link to copy in chat." + actions: + - type: message + messages: + - "Website: https://bebrashield.net" + - type: close + + discord: + slot: 12 + item: + material: purple_wool + name: "Discord" + lore: + # - "" + - "Click to receive link to copy in chat." + actions: + - type: message + messages: + - "Discord: https://discord.gg/xsyy7d8RfG" + - type: close + + telegram: + slot: 14 + item: + material: light_blue_wool + name: "Telegram" + lore: + # - "" + - "Click to receive link to copy in chat." + actions: + - type: message + messages: + - "Telegram: https://t.me/+h28WP38F2_RjZjg6" + - type: close + + close: + slot: 16 + item: + material: barrier + name: "Back" + actions: + - type: inventory + inventory: main + diff --git a/src/plugins/zMenu/inventories/main.yml b/src/plugins/zMenu/inventories/main.yml new file mode 100644 index 0000000..26c2657 --- /dev/null +++ b/src/plugins/zMenu/inventories/main.yml @@ -0,0 +1,49 @@ +size: 27 +name: "Main Menu" + +items: + servers: + slot: 10 + item: + material: paper + name: "Server Selection" + # lore: + # - "" + # - "&eMy first button with &fzMenu" + actions: + - type: inventory + inventory: servers + + links: + slot: 12 + item: + material: chain + name: "Links" + # lore: + # - "" + # - "&eMy first button with &fzMenu" + actions: + - type: inventory + inventory: links + + donate: + slot: 14 + item: + material: raw_gold + name: "Donate" + lore: + - "Donate to support the server." + - "Click to receive link to copy in chat." + actions: + - type: message + messages: + - "Donate: https://bebrashield.net/donate" + - type: close + + close: + slot: 16 + item: + material: barrier + name: "Close" + actions: + - type: close diff --git a/src/plugins/zMenu/inventories/servers.yml b/src/plugins/zMenu/inventories/servers.yml new file mode 100644 index 0000000..f425910 --- /dev/null +++ b/src/plugins/zMenu/inventories/servers.yml @@ -0,0 +1,23 @@ +size: 27 +name: "Main Menu > Server Selection" + +items: + servers: + slot: 10 + item: + material: creeper_head + name: "Survival" + # lore: + # - "" + # - "&eMy first button with &fzMenu" + actions: + - type: connect + inventory: survival + + close: + slot: 16 + item: + material: barrier + name: "Back" + actions: + - type: back diff --git a/src/plugins/zMenu/messages.yml b/src/plugins/zMenu/messages.yml new file mode 100644 index 0000000..035a632 --- /dev/null +++ b/src/plugins/zMenu/messages.yml @@ -0,0 +1,145 @@ +prefix: '&8(&6zMenu&8) ' +and: and +vinventory-error: '&cUnable to open inventory, internal error occurred. &8(&7Inventory + ID: %id%&8)' +time-year: '%02d %year% %02d %month% %02d %day% %02d %hour% %02d %minute% %02d %second%' +time-month: '%02d %month% %02d %day% %02d %hour% %02d %minute% %02d %second%' +time-day: '%02d %day% %02d %hour% %02d %minute% %02d %second%' +time-hour: '%02d %hour% %02d minute(s) %02d %second%' +time-hour-simple: '%02d:%02d:%02d' +time-minute: '%02d %minute% %02d %second%' +time-second: '%02d %second%' +format-second: second +format-seconds: seconds +format-minute: minute +format-minutes: minutes +format-hour: hour +format-hours: hours +format-day: d +format-days: days +format-month: m +format-months: months +format-year: y +format-years: years +command-syntax-error: '&cYou must execute the command like this&7: &a%syntax%' +command-no-permission: '&cYou do not have permission to run this command.' +command-no-console: '&cOnly one player can execute this command.' +command-no-arg: '&cImpossible to find the command with its arguments.' +command-syntax-help: '&f%syntax% &7» &7%description%' +documentation-information: '&7Documentation&8: &fhttps://docs.zmenu.dev/' +documentation-information-link: '&7Documentation&8: &f%link%' +inventory-not-found: '&cUnable to find the &f%toName% &cinventory in the &f%name%&c + inventory.' +inventory-open-other: '&aYou have just opened the inventory &f%name%&a to the &3%player%&a.' +inventory-open-success: '&aYou have just opened the inventory &f%name%&a.' +inventory-open-error-inventory: '&cImpossible to find the inventory &f%name%&c.' +inventory-open-error-command: '&cImpossible to find the command &f%name%&c.' +inventory-open-error-player: '&cUnable to find the player, please specify.' +inventory-open-error-console: '&cOnly one player can open an inventory.' +inventory-open-item-error: '&cInventory &f%name%&c doesn''t have open item.' +inventory-open-item-success: '&aYou have just given the open item to the player &f%name%&a.' +description-open: Allows you to open an inventory +description-save: Allows you to save the item in your hand +description-reload: Allows you to reload configuration files +description-version: Show plugin version +description-list: Inventory list +description-test-dupe: Test dupe +description-open-item: Give open item +description-download: Download an inventory from a link (a discord link for example) +description-login: Login to the website +description-marketplace: Open marketplace inventory +description-disconnect: WIP +description-convert: Convert other configurations to zmenu +description-editor: Open zmenu online editor +description-documentation: Open documentation +description-players: Displays the list of commands for the players' data +description-players-set: Set new player data. You must set the expiration time in + seconds. Put 0 to have no expiration +description-players-add: Add a number to a value, works only for numbers. +description-players-subtract: Subtract a number to a value, works only for numbers. +description-players-remove: Remove player data +description-players-remove-all: Remove all player data from a key +description-players-get: Get player data +description-players-keys: Returns the list of keys of a player +description-players-clear-all: Clear all player's data +description-players-convert: Convert old players data +description-players-clear-player: Clear player's data +description-open-main-menu: Open the main menu +description-create: Create a new config file +description-inventories: Open inventories builder +reload: '&aYou have just reloaded the configuration files. &8(&7%inventories% inventories&8)' +reload-inventory: '&aYou have just reloaded the inventories files. &8(&7%inventories% + inventories&8)' +reload-inventory-file: '&aVous have just reloaded the inventory &f%name%&a.' +reload-command: '&aYou have just reloaded the commands files.' +reload-command-file: '&aVous have just reloaded the command &f%name%&a.' +reload-command-error: '&cIt is not possible to reload the command &f%name%&c.' +reload-files: '&aYou have just reloaded config.json and messages.yml files.' +players-data-clear-all: '&aYou have just deleted the datas of all the players.' +players-data-clear-player: '&aYou have just deleted the player''s data &f%player%&a.' +players-data-set: '&aYou have just added a data for the &b%player% &a with the &f%key%&a.' +players-data-add: '&aYou have just added a data for the &b%player% &a with the &f%key%&a.' +players-data-subtract: '&aYou have just subtract a data for the &b%player% &a with + the &f%key%&a.' +players-data-keys-success: '&aPlayer''s Key &f%player%&8: &7%keys%' +players-data-keys-empty: '&cThe &f%player% &chas no key.' +players-data-get-success: +- '&fKey&8: &7%key%' +- '&fExpired at (timestamp)&8: &7%expiredAt%' +- '&fValue&8: &7%value%' +players-data-get-error: '&cCannot find the key &f%key%&c.' +players-data-remove-success: '&aYou have just deleted the key &f%key% &ffor &b%player%&a.' +players-data-remove-all-success: '&aYou have just deleted all key''s &b%key%&a.' +players-data-remove-error: '&cCannot find the key &f%key%&c.' +players-data-convert-success: '&aYou have just converted the datas&a.' +players-data-convert-confirm: '&cAre you sure you want to convert the datas ? Re-run + the command to confirm.' +website-login-error-token: '&cYour token seems invalid, please try again.' +website-login-error-already: '&cYou are already connected to the site.' +website-login-error-info: '&cAn error occurred during your connection, please try + again.' +website-login-process: '&7Connection in progress, please wait.' +website-login-success: +- '&aYou have successfully connected to the site.' +- '&aYou can now access your purchased resources and the inventory editor.' +website-not-connect: '&cYou need to log into the site before you can do that.' +website-already-inventory: '&cYou are already performing this action, please wait.' +website-marketplace-wait: '&7Download resources, please wait before opening inventory.' +website-inventory-wait: '&7Download inventory &f%name%&7, please wait before opening + inventory.' +website-inventory-exist: '&cThe inventory already exists. Unable to download.' +website-inventory-success: '&aInventory &f%name%&a download successfully. &8(&7use + /zm reload to load this inventory&8)' +website-inventory-error: '&cAn error occurred while downloading the file.' +website-marketplace-error: '&cUnable to retrieve data from the site, please try again.' +website-disconnect-success: '&cYou have just deleted the link to the site.' +website-disconnect-error: '&cYou are not connected to the site.' +website-download-error-type: '&cThe link is not a yml file.' +website-download-error-name: '&cCannot find file name.' +website-download-error-console: '&cAn error has occurred, look at the console.' +website-download-start: '&7Start downloading inventory, please wait.' +placeholder-never: never +list-empty: '&cNo inventory of available.' +list-info: '&fInventories of &a%plugin% &8(&7%amount%&8): &7%inventories%' +inventory-create-error-size: '&cThe inventory size should be included in 9 and 54.' +inventory-create-error-already: '&cThe file &f%name%&c already exist.' +inventory-create-error-exception: '&cAn error has occurred&8: &f%error%' +inventory-create-success: '&aYou have just created the inventory &f%name%&a.' +save-error-empty: '&cYou must have an item in hand to save this item.' +save-error-name: '&cThe name already exists for this item, please select another one.' +save-error-type: '&cCannot find save type.' +save-success: '&aYou just saved the item &f%name%&a.' +click-cooldown: + type: ACTION + message: '&cPlease wait a little between two clicks.' +command-argument-integer: '&cThe argument &f%argument%&c must be an integer.' +command-argument-string: '&cThe argument &f%argument%&c must be a string.' +command-argument-boolean: '&cThe argument &f%argument%&c must be a boolean.' +command-argument-double: '&cThe argument &f%argument%&c must be a double.' +command-argument-online-player: '&cThe argument &f%argument%&c must be a player.' +command-argument-player: '&cThe argument &f%argument%&c must be a player.' +command-argument-entity: '&cThe argument &f%argument%&c must be an entity.' +command-argument-location: '&cThe argument &f%argument%&c must be a location.' +command-argument-material: '&cThe argument &f%argument%&c must be a material.' +command-argument-block: '&cThe argument &f%argument%&c must be a block.' +command-argument-world: '&cThe argument &f%argument%&c must be a world.' diff --git a/src/plugins/zMenu/website/inventories.yml b/src/plugins/zMenu/website/inventories.yml new file mode 100644 index 0000000..d1c39a8 --- /dev/null +++ b/src/plugins/zMenu/website/inventories.yml @@ -0,0 +1,82 @@ +name: "&8%zmenu_folder_name%" +size: 54 +items: + decorations: + item: + material: GRAY_STAINED_GLASS_PANE + name: '' + slots: + - 36-44 + + inventories: + type: ZMENU_BUILDER_INVENTORIES + slots: + - 0-26 + - 28-34 + item: + url: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzlmYTUxYjAxOTk1NzYzOGI0YTQwYjFmYjFjNDdjNDczZjhkMjVhZjZhYzM0OTVhMjQzM2JiMTY2OWZkYjlhMSJ9fX0=" + name: "&f%name%" + lore: + - "" + - " &f⌂ #e6fff3Size#8c8c8c: #92bed8%size%" + - " &f⌂ #e6fff3File Name#8c8c8c: #92bed8%fileName%" + - " &f⌂ #e6fff3Created at#8c8c8c: #92bed8%createdAt%" + - " &f⌂ #e6fff3Updated at#8c8c8c: #92bed8%updatedAt%" + - "" + - " #8c8c8c• #92bed8Left Click #e6fff3to download this inventory" + - " #8c8c8c• #92bed8Right Click #e6fff3to force download this inventory" + + + folders: + type: ZMENU_BUILDER_FOLDERS + slots: + - 47-51 + item: + url: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzczZThiZDNjNDNjNDUxNGM3NjQ4MWNhMWRhZjU1MTQ5ZGZjOTNiZDFiY2ZhOGFiOTQzN2I5ZjdlYjMzOTJkOSJ9fX0=" + name: "&f%name%" + lore: + - " &f⌂ #e6fff3Inventories#8c8c8c: #92bed8%quantity%" + - "" + - " #8c8c8c• #92bed8Click #e6fff3to open the folder" + + folderPrevious: + type: ZMENU_BUILDER_FOLDER_PREVIOUS + slot: 45 + item: + material: PLAYER_HEAD + url: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjllYTFkODYyNDdmNGFmMzUxZWQxODY2YmNhNmEzMDQwYTA2YzY4MTc3Yzc4ZTQyMzE2YTEwOThlNjBmYjdkMyJ9fX0=" + name: "#18f54c⬅ &fᴘʀᴇᴠɪᴏᴜs ᴘᴀɢᴇ" + lore: + - "" + - "&f➥ &7Click to access the #18f54cprevious page" + + folderNext: + type: ZMENU_BUILDER_FOLDER_NEXT + slot: 53 + item: + material: PLAYER_HEAD + url: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODI3MWE0NzEwNDQ5NWUzNTdjM2U4ZTgwZjUxMWE5ZjEwMmIwNzAwY2E5Yjg4ZTg4Yjc5NWQzM2ZmMjAxMDVlYiJ9fX0=" + name: "#18f54c➡ &fɴᴇxᴛ ᴘᴀɢᴇ" + lore: + - "" + - "&f➥ &7Click to access the #18f54cnext page" + + folderBack: + type: ZMENU_BUILDER_FOLDER_BACK + slot: 52 + item: + material: BARRIER + name: "#18f54c➡ &fʙᴀᴄᴋ" + lore: + - "" + - "&f➥ &7Click to access the #18f54cprevious folder" + + refreshInventories: + type: ZMENU_BUILDER_REFRESH + slot: 46 + item: + material: ANVIL + name: "#18f54c➡ &fᴜᴘᴅᴀᴛᴇ ɪɴᴠᴇɴᴛᴏʀɪᴇs" + lore: + - "" + - "&f➥ &7Click to update #18f54cinventories"