Skip to content

MrSazid123/ProPractice

Repository files navigation

ProPractice - Premium PvP Duels & Practice System

A production-ready, highly scalable Minecraft plugin for Paper 1.20+ designed for large PvP networks. Built with clean architecture, performance optimization, and extensive customization.

Features

🔥 Core Duel System

  • 1v1 Ranked & Unranked Duels: Full Elo ranking system with configurable rating calculations
  • Party Systems: Create parties, invite players, team duels (2v2, Party vs Party)
  • Party Modes: Split, FFA, and team-based configurations
  • Queue System: Automatic matchmaking with queue positions
  • Bot Fights: AI-controlled opponents for practice

🎮 Kit System

  • Pre-built Kit Types: Build, Combo, Boxing, Spleef, Bedwars, MLG Rush, Skywars, UHC, Fireball, TNT Jump, Custom
  • Multiple Saved Layouts: Save different configurations per kit
  • Custom Knockback: Per-kit knockback multipliers
  • Per-Kit Rules:
    • Disable hunger & regeneration
    • Only bow damage mode
    • Disappearing placed blocks
  • GUI-based Kit Editor: Fully interactive in-game editor

🏟 Arena System

  • Create & Manage Arenas: Full command-based arena creation and editing
  • Arena Regeneration: Automatic world reset between duels
  • FAWE Integration: Optional FastAsyncWorldEdit schematic support
  • Multi-round Support: Best of X formats
  • Arena Copying: Duplicate arenas with one command
  • FFA Arenas: Free-for-all arena support

🏆 Events System

  • Automatic Events:
    • 1v1 Tournaments with brackets
    • Sumo (ring-out based)
    • Last Man Standing (FFA)
    • King of the Hill (KOTH)
    • Juggernaut (1 vs all)
  • Staff GUI: Easy event management
  • Configurable Timers: Custom event durations
  • Rewards System: Automatic reward distribution

📊 Statistics System

  • Complete Player Tracking:
    • Wins, losses, and Elo rating
    • Hit accuracy and damage statistics
    • Longest combo tracking
    • Potions thrown/missed
  • /stats Command: View stats for any player
  • Leaderboards: Top players by Elo, wins, or accuracy
  • MySQL Storage: Permanent stat retention
  • PlaceholderAPI: Full integration for signs and scoreboards

🎥 Replay System

  • Duel Recording: Automatic replay capture
  • Inventory Storage: Save player inventories at match end
  • Hit Tracking: Frame-by-frame damage data
  • Spectator Replay: Watch recorded duels with full player perspective
  • Efficient Storage: Compressed binary format

👥 Party System

  • Create & Manage Parties: Full party lifecycle management
  • Party Invites: Request/accept system
  • Open/Public Parties: Broadcast options for recruitment
  • Party Chat: Private team communication
  • Party Events: Team-based competitions

🎨 UI & Customization

  • Fully Customizable Scoreboard: Per-state scoreboard display
  • Placeholder-based Messages: Every message is customizable
  • Spawn Items: Custom items for lobby/menu access
  • Colored Nametags: In-fight player identification
  • Spectator Mode: Safe observation without interference
  • Built-in Enderpearl Cooldown: Prevents spam
  • XP Bar, Action Bar, BossBar: Multiple display options

🌍 Multilingual System

  • /language Command: Per-player language selection
  • YAML-based Translations: Easy language file editing
  • Pre-loaded Languages:
    • English (en)
    • French (fr)
    • Spanish (es)
    • Dutch (nl)
    • Italian (it)
    • Finnish (fi)
    • Chinese (partial, zh)
  • Auto-detection: Server default language configuration

🧠 Performance & Optimization

  • No Memory Leaks: Proper resource cleanup
  • Task Cancellation: All async tasks properly managed
  • Async Database: Non-blocking player stat updates
  • Stat Caching: In-memory player cache with periodic sync
  • Connection Pooling: HikariCP for database efficiency
  • Optimized for 200+ Concurrent Players: Tested load capacity
  • Clean Shutdown: Graceful server disable handling

Architecture

Project Structure

ProPractice/
├── src/main/java/com/minzoid/dev/proPractice/
│   ├── core/                 # Core managers (Duel, Arena, Kit, etc.)
│   ├── database/             # Database layer + async operations
│   ├── services/             # Business logic (Stats, Scoreboard, Queue)
│   ├── commands/             # Command handlers
│   ├── listeners/            # Event listeners
│   ├── gui/                  # GUI framework & editors
│   │   ├── framework/
│   │   └── editors/
│   ├── models/               # Data models
│   ├── utils/                # Utilities & helpers
│   ├── api/                  # Public addon API
│   ├── config/               # Configuration management
│   └── ProPractice.java      # Main plugin class
├── src/main/resources/
│   ├── plugin.yml            # Plugin manifest
│   ├── config/               # Configuration files
│   ├── data/                 # Sample data (kits, arenas)
│   ├── languages/            # Language files
│   └── ...
└── pom.xml                   # Maven configuration

Key Components

Managers (core/)

  • DuelManager: Manages all active duels, player-duel mapping
  • ArenaManager: Controls arenas, world states, boundaries
  • KitManager: Stores and manages available kits
  • PartyManager: Handles party creation and membership
  • EventManager: Controls active events
  • ReplayManager: Manages recorded replays

Services (services/)

  • StatsService: In-memory player stat caching with async DB sync
  • ScoreboardService: Scoreboard updates and display
  • QueueService: Queue management and auto-matchmaking

Database (database/)

  • DatabaseManager: HikariCP connection pooling
  • StatsRepository: Async stat loading/saving

Installation & Configuration

Requirements

  • Paper 1.20+ (or compatible Bukkit/Spigot fork)
  • Java 21+
  • MySQL 5.7+ or MariaDB
  • PlaceholderAPI (recommended, optional)
  • FastAsyncWorldEdit (optional, for arena regen)

Setup Steps

  1. Place JAR in plugins folder

    cp ProPractice-1.0.1.jar /path/to/server/plugins/
  2. Start server (generates config files)

    java -Xmx2G -Xms2G -jar paper.jar nogui
  3. Configure database (config/config.yml)

    database:
      host: localhost
      port: 3306
      name: propractice
      username: root
      password: ""
      pool-size: 20  # For 200+ players
  4. Create MySQL database

    CREATE DATABASE propractice CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  5. Reload plugin

    /reload confirm
    

Configuration Files

Main Config (config/config.yml)

  • Database settings
  • Plugin features toggle
  • ELO calculation parameters
  • Performance settings
  • Rewards configuration

Kit Config (data/kits/*.yml)

  • Kit type and equipment
  • Knockback multipliers
  • Per-kit rules

Arena Config (data/arenas/*.yml)

  • Arena spawn locations
  • World boundaries
  • Schematic paths
  • Block restrictions

Language Files (languages/*.yml)

  • Per-language message translation
  • Placeholder support

Commands

Player Commands

Command Permission Usage
/duel propractice.duel /duel <player> [kit] [arena]
/kit propractice.use /kit <list|info|select>
/arena propractice.arena.edit /arena <create|edit|delete|list>
/party propractice.party /party <create|invite|leave>
/event propractice.event.host /event <start|stop|list>
/stats propractice.use /stats [player]
/language propractice.use /language <language>
/spectate propractice.use /spectate <player>

Admin Commands

Command Permission Usage
/pp propractice.admin /pp <reload|debug|database>

Permissions

  • propractice.use - Base plugin access
  • propractice.duel - Can duel players
  • propractice.party - Can create parties
  • propractice.kit.edit - Can edit kits
  • propractice.arena.edit - Can edit arenas
  • propractice.event.host - Can start events
  • propractice.admin - Full admin access
  • propractice.debug - Access debug commands

PlaceholderAPI Placeholders

%propractice_wins%          - Player wins
%propractice_losses%        - Player losses
%propractice_elo%           - Player ELO rating
%propractice_winrate%       - Player win rate (%)
%propractice_hits%          - Player total hits
%propractice_combo%         - Player longest combo
%propractice_accuracy%      - Player accuracy (%)
%propractice_total_games%   - Player total games

API for Addons

Using ProPracticeAPI

ProPracticeAPI api = ProPracticeAPIImpl.getInstance();

// Create a duel
boolean success = api.createDuel(player1, player2, "combo", "boxed");

// Get player stats
int elo = api.getPlayerElo(player);
int wins = api.getPlayerWins(player);

// Register custom knockback
api.registerCustomKnockback("custom-kit", 1.5);

Example Addon Structure

public class MyAddon extends JavaPlugin {
    private ProPracticeAPI api;
    
    @Override
    public void onEnable() {
        ProPractice proPractice = Bukkit.getPluginManager()
            .getPlugin("ProPractice");
        if (proPractice instanceof ProPractice) {
            api = ProPracticeAPIImpl.getInstance();
            // Add your addon logic here
        }
    }
}

Performance Benchmarks

System Requirements for 200+ Concurrent Players:

  • CPU: 4+ cores recommended
  • RAM: 4-6GB for server (3GB Minecraft + 1-3GB ProPractice)
  • Database: Dedicated MySQL/MariaDB instance
  • Storage: 5GB+ for potential replays

Optimization Tips:

  1. Set database pool size to 20-30 for 200+ players
  2. Enable stat caching (default: on)
  3. Use SSD for database server
  4. Configure sync interval based on activity
  5. Consider dedicated database server

Troubleshooting

Database Connection Issues

Check if MySQL is running:
mysql -u root -p -e "SELECT VERSION();"

Verify database exists:
mysql -u root -p -e "SHOW DATABASES;"

Performance Issues

  • Check /pp debug for performance metrics
  • Monitor cache size with /pp debug
  • Verify database connection pool settings
  • Check for memory leaks: /pp debug memory

Command Not Working

  • Verify player has required permission
  • Check if plugin is fully loaded (check console on startup)
  • Verify player/argument names are correct

Development

Building from Source

mvn clean package

Testing

# Run tests
mvn test

# Build with tests
mvn clean verify

Code Structure Guidelines

  • Follow clean architecture principles
  • All managers are singletons
  • Use async operations for I/O (database, files)
  • Proper exception handling with detailed logging
  • No hardcoded values (use configuration)

Support & Contributing

  • Issues: Report bugs and feature requests
  • Documentation: See Wiki for advanced configuration
  • API Extensions: See api/ package for addon support

License

ProPractice is a premium plugin. See LICENSE file for terms.

Credits

Developed by Minzoid Dev Team


Version: 1.0.1
Requires: Paper 1.20+, Java 21+, MySQL 5.7+
Optional: PlaceholderAPI, FastAsyncWorldEdit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages