mrdhirzj_
๐Ÿ“Ž 1 file 1,905 chars
๐Ÿ“„
pasted-code-1772430422113.txt
txt 49 lines
โ–ถ

Create a production-ready Minecraft plugin for Paper 1.21+.

Plugin Name: StoreConnector Java Version: 17+ Build Tool: Maven API: Paper 1.21+

======================================== CORE PURPOSE ======================================== The plugin connects securely to a website backend API. It fetches pending purchase commands and executes them in the console automatically.

======================================== REQUIREMENTS ========================================

1) API CONNECTION

HTTPS only
GET /api/commands/pending
POST /api/commands/complete
Bearer token authentication
Configurable API URL
Configurable secret key
Timeout protection (5s)
Retry system (3 retries)
2) SECURITY
Validate username (alphanumeric only)
Allow only whitelisted commands:
- lp user {username} parent add - eco give - give
Prevent command injection
Limit max 10 commands per request
IP whitelist support
Disable plugin if API returns invalid auth
3) SCHEDULER SYSTEM
Auto check every 30 seconds
Async HTTP request
Main-thread command execution
Error handling logs
4) ADMIN COMMANDS /store reload /store status /store testapi
5) LOGGING

Log successful command execution
Log failed executions
Log API errors
======================================== FILES REQUIRED ========================================
plugin.yml (api-version: 1.21)
config.yml
Main.java
ApiService.java
CommandExecutor.java
Maven pom.xml
======================================== CONFIG.YML STRUCTURE ========================================
api-url: "https://yourstore.com/api/commands/pending" complete-url: "https://yourstore.com/api/commands/complete" secret-key: "SUPER_SECRET_KEY" check-interval: 30 max-commands: 10 ip-whitelist-enabled: false allowed-commands: - "lp user" - "eco give" - "give"

======================================== PLUGIN FLOW ========================================
Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code