N
๐
1 file
4,182 chars
๐
pasted-code-1777652771507.txt
txt
188 lines
โถ
pasted-code-1777652771507.txt
txt
188 lines
Create a high-performance Minecraft authentication plugin for Paper (Spigot API), inspired by LimboAuth but fully designed to work on the Paper server side (post-login authentication system).
The plugin must include CAPTCHA verification BEFORE login/register, IP-based account limiting, and strong security + performance optimizations.
========================
1. CAPTCHA SYSTEM (FIRST STEP)
========================
- Require CAPTCHA verification before login/register
- Generate random alphanumeric CAPTCHA (e.g., uQ12dc)
Flow:
- On player join:
- Freeze player completely
- Generate CAPTCHA
- Send message: "Use /captcha to verify"
Commands:
- /captcha
Features:
- Configurable CAPTCHA length (default: 6)
- Case sensitivity option (true/false)
- CAPTCHA expiration time (configurable)
- Regenerate CAPTCHA after wrong attempt
Security:
- Max CAPTCHA attempts (default: 3)
- Kick player after exceeding attempts
- Block ALL commands except /captcha until verified
UI:
- Show CAPTCHA using:
- Chat
- Title
- ActionBar
- Optional:
- Colored CAPTCHA text
- INVENTORY GUI-based CAPTCHA (inventory click)
Storage:
- Store CAPTCHA temporarily in memory (HashMap)
Config:
- captcha-enabled: true
- captcha-length: 6
- captcha-timeout: 60
- captcha-max-attempts: 3
========================
2. CORE AUTHENTICATION
========================
- Commands:
- /register
- /login
- Use BCrypt hashing
- Store data using UUID
- Prevent duplicate accounts
========================
3. PLAYER RESTRICTIONS
========================
Before CAPTCHA:
- Block movement
- Block chat
- Block all commands except /captcha
After CAPTCHA but before login:
- Block movement
- Block chat
- Allow only /login and /register
Optional:
- Blindness effect
- Hide players
Kick if not logged in within configurable time
========================
4. SESSION SYSTEM
========================
- Auto-login based on IP + session timeout
- Store last IP and last login time
- Configurable session duration
========================
5. SECURITY SYSTEM
========================
- Max login attempts (default 3)
- Kick after failed attempts
- Delay between login tries
- Password rules (min length, basic strength)
- Basic anti-bot protection
========================
6. IP-BASED ACCOUNT LIMIT
========================
- Limit accounts per IP
- Default: 1 account per IP (configurable)
Features:
- Check during /register
- Block if limit reached
- Allow bypass permission: auth.bypass.iplimit
- Allow login for existing users
Config:
- enable-ip-limit: true
- max-accounts-per-ip: 1
- whitelist-ips: []
Advanced:
- Store IP-to-account mapping
- Support IPv4 and IPv6 normalization
========================
7. UI / UX SYSTEM
========================
- Messages via:
- Chat
- Title
- ActionBar
- Fully configurable messages in config.yml
Optional:
- INVENTORY GUI login system
- Bedrock (Geyser) compatibility
========================
8. DATABASE SYSTEM
========================
- SQLite (default)
- MySQL (optional)
Store:
- UUID
- Username
- Hashed password
- IP
- Last login
========================
9. CONFIG SYSTEM
========================
config.yml must include:
- captcha settings
- session-timeout
- login-timeout
- max-login-attempts
- ip-limit settings
- all messages customizable
========================
10. PERFORMANCE
========================
- Async database operations
- Cache authenticated players
- Optimized event listeners
========================
11. CODE STRUCTURE
========================
- Main class (extends JavaPlugin)
- AuthManager
- CaptchaManager
- SessionManager
- PlayerListener
- CommandHandler
- DatabaseManager
========================
12. EXTRA FEATURES
========================
- 2FA placeholder system
- API for other plugins:
- isAuthenticated(Player)
- Anti-VPN placeholder
- Security logging
========================
OUTPUT REQUIREMENTS
========================
- Full plugin source code
- plugin.yml
- config.yml
- Well-commented code
- Step-by-step generation (NOT all at once)
- Start with project structure and main class
- Include build setup (Maven or Gradle)
KodariMay 1 at 4:26 pm 100 (v2)
The generation was stopped before any content could be produced.
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code