diff --git a/app.py b/app.py index 13f1eb1..90354f8 100644 --- a/app.py +++ b/app.py @@ -1,10 +1,26 @@ import os import json +import uuid from pathlib import Path -from flask import Flask, render_template, jsonify, send_from_directory +from datetime import datetime, timedelta +from threading import Lock +from flask import Flask, render_template, jsonify, send_from_directory, request app = Flask(__name__) +# In-memory storage for commands (thread-safe) +command_storage = {} +storage_lock = Lock() + +def cleanup_expired_commands(): + """Remove expired commands from storage""" + with storage_lock: + now = datetime.now() + expired_keys = [key for key, value in command_storage.items() + if datetime.fromisoformat(value['expires_at']) < now] + for key in expired_keys: + del command_storage[key] + # Load projects from version.json def load_projects(): """Load all projects from version.json""" @@ -228,6 +244,75 @@ def project_detail(project_id): return render_template('project_detail.html', project=project) +# Item Editor Command Storage +@app.route('/projects/itemeditor/storage') +def itemeditor_command_storage(): + """Item Editor Command Storage page""" + return render_template('itemeditor_command_storage.html') + +@app.route('/projects/itemeditor/storage', methods=['POST']) +def store_command(): + """Store a command and return UUID link""" + cleanup_expired_commands() + + try: + data = request.get_json() + command = data.get('command', '').strip() + + if not command: + return jsonify({'success': False, 'error': 'Command is required'}), 400 + + if len(command) > 10000: + return jsonify({'success': False, 'error': 'Command exceeds maximum length of 10,000 characters'}), 400 + + # Generate UUID + command_uuid = str(uuid.uuid4()) + + # Calculate expiry (30 minutes) + created_at = datetime.now() + expires_at = created_at + timedelta(minutes=30) + + # Store command + with storage_lock: + command_storage[command_uuid] = { + 'command': command, + 'created_at': created_at.isoformat(), + 'expires_at': expires_at.isoformat() + } + + # Generate URL + base_url = request.host_url.rstrip('/') + retrieval_url = f"{base_url}/projects/itemeditor/storage/{command_uuid}" + + return jsonify({ + 'success': True, + 'uuid': command_uuid, + 'url': retrieval_url, + 'expires_at': expires_at.isoformat() + }), 201 + + except Exception as e: + return jsonify({'success': False, 'error': str(e)}), 500 + +@app.route('/projects/itemeditor/storage/') +def retrieve_command(command_uuid): + """Retrieve stored command by UUID (JSON response for plugin)""" + cleanup_expired_commands() + + with storage_lock: + command_data = command_storage.get(command_uuid) + + if not command_data: + return jsonify({'error': 'Command not found or expired'}), 404 + + # Check if expired + if datetime.fromisoformat(command_data['expires_at']) < datetime.now(): + with storage_lock: + del command_storage[command_uuid] + return jsonify({'error': 'Command expired'}), 410 + + return jsonify(command_data), 200 + # Serve /versions as JSON @app.route('/versions') def versions(): diff --git a/templates/itemeditor_command_storage.html b/templates/itemeditor_command_storage.html new file mode 100644 index 0000000..68861a1 --- /dev/null +++ b/templates/itemeditor_command_storage.html @@ -0,0 +1,509 @@ +{% extends "base.html" %} + +{% block title %}Item Editor - Command Storage - Devanturas{% endblock %} +{% block description %}Store commands longer than 256 characters temporarily for Minecraft Item Editor plugin{% endblock %} + +{% block content %} + + +
+
+
+ +
+
+ +

Store Command

+
+

+ Paste your Minecraft command below. Commands longer than 256 characters will be stored + for 30 minutes and a unique retrieval link will be generated. +

+ +
+
+ + +
+ 0 characters + +
+
+ + +
+ + + +
+ + +
+
+
+ +
+

How It Works

+
    +
  1. Paste your long Minecraft command
  2. +
  3. Click "Store Command" to generate a link
  4. +
  5. Copy the generated JSON link
  6. +
  7. Use the link in your Item Editor plugin
  8. +
+
+ +
+
+ +
+

Storage Limits

+
    +
  • Duration: 30 minutes
  • +
  • Max Length: 10,000 characters
  • +
  • Format: JSON response
  • +
  • Access: Anyone with link
  • +
+
+ +
+
+ +
+

Plugin Usage

+

Load command in your plugin:

+
GET https://devanturas.net/projects/itemeditor/storage/{uuid}
+
+Response:
+{
+  "command": "your command here",
+  "created_at": "2026-01-07T12:00:00",
+  "expires_at": "2026-01-07T12:30:00"
+}
+
+
+
+
+
+ + + + +{% endblock %} diff --git a/versions/version.json b/versions/version.json index f7889e2..35dcc3d 100644 --- a/versions/version.json +++ b/versions/version.json @@ -24,8 +24,8 @@ "beta": "https://modrinth.com/plugin/velocity-friends/version/1.4.0-SNAPSHOT-Rev-4" }, "links": { - "modrinth": "https://modrinth.com/plugin/velocity-friends/version/1.3.4", - "hangar": "https://hangar.papermc.io/SimolZimol/Velocity-Friends/versions/1.3.4", + "modrinth": "https://modrinth.com/plugin/velocity-friends", + "hangar": "https://hangar.papermc.io/SimolZimol/Velocity-Friends", "Ko-fi": "https://ko-fi.com/simolzimol", "discord": "https://discord.com/invite/vVrpvBEfeQ" }, @@ -50,18 +50,51 @@ "Interactive settings menu" ], "technologies": ["Java", "Velocity API", "Adventure API", "Gson", "MySQL", "HikariCP"], - "commands": [ - {"command": "/friend add ", "description": "Send a friend request to a player.", "permission": "friends.use"}, - {"command": "/friend accept ", "description": "Accept a pending friend request.", "permission": "friends.use"}, - {"command": "/friend deny ", "description": "Deny a friend request.", "permission": "friends.use"}, - {"command": "/friend remove ", "description": "Remove a friend from your list.", "permission": "friends.use"}, - {"command": "/friend list", "description": "Show all your friends with online status and server location.", "permission": "friends.use"}, - {"command": "/friend requests", "description": "Show all pending friend requests.", "permission": "friends.use"}, - {"command": "/friend msg ", "description": "Send a private message to a friend.", "permission": "friends.use"}, - {"command": "/friend reply ", "description": "Reply to the last received message.", "permission": "friends.use"}, - {"command": "/friend broadcast ", "description": "Send a message to all online friends.", "permission": "friends.use"}, - {"command": "/friend settings", "description": "Open the interactive settings menu.", "permission": "friends.use"}, - {"command": "/friend reload", "description": "Reload the plugin configuration (admin only).", "permission": "friends.reload"} + "commands": [{ + "command": "/friend add ", + "description": "Send a friend request to a player.", + "permission": "friends.use" + }, { + "command": "/friend accept ", + "description": "Accept a pending friend request.", + "permission": "friends.use" + }, { + "command": "/friend deny ", + "description": "Deny a friend request.", + "permission": "friends.use" + }, { + "command": "/friend remove ", + "description": "Remove a friend from your list.", + "permission": "friends.use" + }, { + "command": "/friend list", + "description": "Show all your friends with online status and server location.", + "permission": "friends.use" + }, { + "command": "/friend requests", + "description": "Show all pending friend requests.", + "permission": "friends.use" + }, { + "command": "/friend msg ", + "description": "Send a private message to a friend.", + "permission": "friends.use" + }, { + "command": "/friend reply ", + "description": "Reply to the last received message.", + "permission": "friends.use" + }, { + "command": "/friend broadcast ", + "description": "Send a message to all online friends.", + "permission": "friends.use" + }, { + "command": "/friend settings", + "description": "Open the interactive settings menu.", + "permission": "friends.use" + }, { + "command": "/friend reload", + "description": "Reload the plugin configuration (admin only).", + "permission": "friends.reload" + } ], "installation": [ "Download the plugin jar from Modrinth or Spigot.", @@ -130,10 +163,19 @@ "Hot-reload configuration support" ], "technologies": ["Java", "Velocity API", "Adventure API", "Gson", "SnakeYAML"], - "commands": [ - {"command": "/joinme", "description": "Share your current server location with players on configured servers.", "permission": "joinme.use"}, - {"command": "/joinmereload", "description": "Reload the plugin configuration.", "permission": "joinme.reload"}, - {"command": "/joinmeversion", "description": "Check the plugin version and available updates.", "permission": "joinme.use"} + "commands": [{ + "command": "/joinme", + "description": "Share your current server location with players on configured servers.", + "permission": "joinme.use" + }, { + "command": "/joinmereload", + "description": "Reload the plugin configuration.", + "permission": "joinme.reload" + }, { + "command": "/joinmeversion", + "description": "Check the plugin version and available updates.", + "permission": "joinme.use" + } ], "installation": [ "Download the plugin jar from GitHub releases.", @@ -179,10 +221,10 @@ "stable": "https://modrinth.com/plugin/simpleteleports/version/1.2.1", "beta": "https://modrinth.com/plugin/simpleteleports/version/1.2.2" }, - "links": { - "modrinth": "https://modrinth.com/plugin/simpleteleports/version/1.2.1", - "hangar": "https://hangar.papermc.io/SimolZimol/SimpleTeleport/versions/1.2.1", - "spigot": "https://www.spigotmc.org/resources/simpleteleport.130115/update?update=622743", + "links": { + "modrinth": "https://modrinth.com/plugin/simpleteleports", + "hangar": "https://hangar.papermc.io/SimolZimol/SimpleTeleport", + "spigot": "https://www.spigotmc.org/resources/simpleteleport.130115", "Ko-fi": "https://ko-fi.com/simolzimol", "discord": "https://discord.com/invite/vVrpvBEfeQ" }, @@ -204,21 +246,63 @@ "Automatic version checking and update notifications" ], "technologies": ["Java", "Spigot API", "Gson", "YAML"], - "commands": [ - {"command": "/sethome [name]", "description": "Set your personal home location (optionally with a name)", "permission": "SimpleTeleport.sethome"}, - {"command": "/home [name]", "description": "Teleport to your home (optionally specify a home name)", "permission": "SimpleTeleport.home"}, - {"command": "/homes", "description": "List all your homes (clickable/hoverable list)", "permission": "SimpleTeleport.home"}, - {"command": "/homeother [home]", "description": "Teleport to another player's named home", "permission": "SimpleTeleport.home.others"}, - {"command": "/delhome [name]", "description": "Delete one of your homes", "permission": "SimpleTeleport.delhome"}, - {"command": "/delhomeother [home]", "description": "Delete another player's named home", "permission": "SimpleTeleport.delhome.others"}, - {"command": "/warp ", "description": "Teleport to a warp point", "permission": "SimpleTeleport.warp"}, - {"command": "/setwarp ", "description": "Create a new warp point", "permission": "SimpleTeleport.setwarp"}, - {"command": "/delwarp ", "description": "Delete a warp point", "permission": "SimpleTeleport.delwarp"}, - {"command": "/warps", "description": "List all available warps", "permission": "SimpleTeleport.warps"}, - {"command": "/spawn", "description": "Teleport to the server spawn", "permission": "SimpleTeleport.spawn"}, - {"command": "/spawn set", "description": "Set the server spawn location", "permission": "SimpleTeleport.setspawn"}, - {"command": "/back", "description": "Teleport to your last location", "permission": "SimpleTeleport.back"}, - {"command": "/stpversion", "description": "Display plugin version information and check for updates", "permission": "SimpleTeleport.version"} + "commands": [{ + "command": "/sethome [name]", + "description": "Set your personal home location (optionally with a name)", + "permission": "SimpleTeleport.sethome" + }, { + "command": "/home [name]", + "description": "Teleport to your home (optionally specify a home name)", + "permission": "SimpleTeleport.home" + }, { + "command": "/homes", + "description": "List all your homes (clickable/hoverable list)", + "permission": "SimpleTeleport.home" + }, { + "command": "/homeother [home]", + "description": "Teleport to another player's named home", + "permission": "SimpleTeleport.home.others" + }, { + "command": "/delhome [name]", + "description": "Delete one of your homes", + "permission": "SimpleTeleport.delhome" + }, { + "command": "/delhomeother [home]", + "description": "Delete another player's named home", + "permission": "SimpleTeleport.delhome.others" + }, { + "command": "/warp ", + "description": "Teleport to a warp point", + "permission": "SimpleTeleport.warp" + }, { + "command": "/setwarp ", + "description": "Create a new warp point", + "permission": "SimpleTeleport.setwarp" + }, { + "command": "/delwarp ", + "description": "Delete a warp point", + "permission": "SimpleTeleport.delwarp" + }, { + "command": "/warps", + "description": "List all available warps", + "permission": "SimpleTeleport.warps" + }, { + "command": "/spawn", + "description": "Teleport to the server spawn", + "permission": "SimpleTeleport.spawn" + }, { + "command": "/spawn set", + "description": "Set the server spawn location", + "permission": "SimpleTeleport.setspawn" + }, { + "command": "/back", + "description": "Teleport to your last location", + "permission": "SimpleTeleport.back" + }, { + "command": "/stpversion", + "description": "Display plugin version information and check for updates", + "permission": "SimpleTeleport.version" + } ], "installation": [ "Download the plugin jar from Modrinth.", @@ -234,7 +318,80 @@ "Full permission and configuration system" ], "stats": { - "downloads": "500 +", + "downloads": "over 500", + "likes": 0, + "followers": 0 + } + }, + "itemeditor": { + "stable": "1.2.0", + "beta": "1.2.1", + "dev": null, + "project_status": "stable", + "status": { + "stable": "stable", + "beta": "beta", + "dev": "unstable" + }, + "version_id": { + "stable": "1.2.0", + "beta": "1.2.1" + }, + "project_type": "spigot", + "name": "Item Editor", + "tagline": "Powerful in-game item editor for Spigot servers", + "description": "Edit Minecraft items in-game with a modern GUI, including lore, color, enchantments, PvP/No PvP, and custom actions.", + "long_description": "Item Editor is a comprehensive and user-friendly plugin for Spigot servers, allowing players and admins to edit items directly in-game. Features include a modern GUI for editing item name, lore, color, and enchantments, as well as per-item PvP/No PvP toggles and custom left-click actions. Messages and feedback are fully customizable, and all features are accessible via an intuitive menu.", + "icon": "fas fa-edit", + "download": { + "stable": "https://modrinth.com/plugin/itemeditor/version/1.2.0", + "beta": null + }, + "links": { + "modrinth": "https://modrinth.com/plugin/itemeditor", + "hangar": "https://hangar.papermc.io/SimolZimol/Itemeditor", + "spigot": "https://www.spigotmc.org/resources/itemeditor.130589/", + "Ko-fi": "https://ko-fi.com/simolzimol", + "discord": "https://discord.com/invite/vVrpvBEfeQ" + }, + "mc_compat": { + "stable": "1.19, 1.20, 1.21" + }, + "server_types": ["Spigot", "Paper"], + "features": [ + "Modern GUI for item editing", + "Edit name, lore, color, and enchantments", + "Per-item PvP and No PvP toggles", + "Custom left-click actions (3 modes)", + "Customizable and disable-able messages", + "Persistent item data storage", + "Color code and placeholder support" + ], + "technologies": ["Java", "Spigot API", "Adventure API", "Gson"], + "commands": [{ + "command": "/itemeditor", + "description": "Open the item editor GUI for the held item.", + "permission": "itemeditor.use" + }, { + "command": "/itemeditor reload", + "description": "Reload the plugin configuration.", + "permission": "itemeditor.reload" + } + ], + "installation": [ + "Download the plugin jar from the release page.", + "Place the jar in your Spigot/Paper plugins folder.", + "Restart the server.", + "Configure settings in config.yml and messages.yml as needed." + ], + "technical_highlights": [ + "Modern, intuitive GUI for all item features", + "Per-item persistent data using PersistentDataContainer", + "Color code-insensitive message disabling", + "Full permission and configuration system" + ], + "stats": { + "downloads": "over 250", "likes": 0, "followers": 0 }