Skip to content

Contributing

Shahid_Reza edited this page Jun 28, 2026 · 1 revision

🀝 Contributing

Contributions are welcome! This page covers how to contribute to Toolmetry Server Doctor.


🎯 Ways to Contribute

Way How
πŸ› Report bugs Open a GitHub Issue
πŸ’‘ Suggest features Open a GitHub Issue with the enhancement label
πŸ“ Improve docs Edit any wiki page on GitHub
πŸ”§ Submit code Open a Pull Request (see below)
🌍 Translate Translate messages.yml to your language
⭐ Star the repo Help others discover the project

πŸ› οΈ Development Setup

Prerequisites

  • JDK 17+ (Java 17 LTS recommended)
  • Maven 3.9+
  • Git
  • An IDE (IntelliJ IDEA recommended, Eclipse/VSCode also work)

Build from Source

# Clone the repo
git clone https://github.com/toolmetryai/Toolmetry-Server-Doctor.git
cd server-doctor

# Build
mvn clean package

# Output: target/toolmetryai-server-doctor-1.0.0.jar

Project Structure

src/main/java/com/toolmetryai/serverdoctor/
β”œβ”€β”€ ServerDoctorPlugin.java        # Main entry point
β”œβ”€β”€ config/                         # Config & message managers
β”œβ”€β”€ managers/                       # Module & task managers
β”œβ”€β”€ services/                       # Scheduler, notifications, Discord, reports
β”œβ”€β”€ modules/                        # All feature modules
β”‚   β”œβ”€β”€ audit/
β”‚   β”œβ”€β”€ plugin/
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ lag/
β”‚   β”œβ”€β”€ crash/
β”‚   β”œβ”€β”€ security/
β”‚   β”œβ”€β”€ update/
β”‚   β”œβ”€β”€ benchmark/
β”‚   └── report/
β”œβ”€β”€ commands/                       # Command handlers
β”‚   └── tools/                      # 27+ admin tools
β”œβ”€β”€ gui/                            # GUI manager
β”œβ”€β”€ listeners/                      # Event listeners
β”œβ”€β”€ models/                         # Data classes
└── utils/                          # Utilities

πŸ”„ Pull Request Process

  1. Fork the repo on GitHub
  2. Create a feature branch:
    git checkout -b feature/my-new-feature
  3. Make your changes following the code style below
  4. Test thoroughly β€” make sure mvn clean package succeeds
  5. Commit with a clear message:
    git commit -m "Add feature: my new feature"
  6. Push to your fork:
    git push origin feature/my-new-feature
  7. Open a Pull Request on GitHub with:
    • Clear description of what changed
    • Why you made the change
    • Any breaking changes
    • Screenshots (if UI-related)

πŸ“ Code Style

Java

  • Java 17+ features OK (records, switch expressions, var, etc.)
  • 4-space indentation
  • 100-char line limit
  • Use final for variables that don't change
  • Add Javadoc for public methods
  • Use @NotNull / @Nullable from org.jetbrains.annotations

Example

/**
 * Runs a server audit and returns the result.
 *
 * @param sender the command sender (may be null for scheduled scans)
 * @return the audit result, never null
 */
public @NotNull AuditResult runAudit(@Nullable CommandSender sender) {
    // Implementation
}

πŸ§ͺ Testing

Manual Testing Checklist

Before submitting a PR, test:

  • Plugin loads without errors on Paper 1.20.1
  • tm help shows the help menu
  • tm audit runs and produces a score
  • tm doctor runs and lists plugins
  • tm lag runs and lists lag sources
  • tm security runs and shows security score
  • tm crash runs and analyzes crashes
  • tm benchmark runs and shows scores
  • tm config runs and validates configs
  • tm scan runs all diagnostics
  • tm report generates an HTML report
  • tm gui opens the dashboard (in-game)
  • Discord webhook works (tm webhook test)
  • No errors in console during normal operation
  • No errors in logs/server-doctor.log

🌍 Translations

To translate Toolmetry to your language:

  1. Copy src/main/resources/messages.yml to messages_<lang>.yml
  2. Translate all strings β€” keep MiniMessage tags (<red>, <green>, etc.) intact
  3. Test by setting general.language: <lang> in config.yml
  4. Submit a PR with your translated file

Translation Tips

  • Don't translate placeholders like {player}, {score}, etc.
  • Keep MiniMessage tags intact: <red>Error</red> not <rojo>Error</rojo>
  • Test with /tm reload after changes
  • Keep the same line structure as the original

πŸ› Reporting Bugs

When reporting a bug, include:

  1. Toolmetry version (tm about)
  2. Server version (Paper MC version)
  3. Java version
  4. Steps to reproduce
  5. Expected behavior
  6. Actual behavior
  7. Console errors (paste to gist.github.com if long)
  8. Your config.yml (remove sensitive info like webhook URLs)

Use the bug report template when opening a GitHub Issue.


πŸ’‘ Suggesting Features

When suggesting a feature:

  1. Describe the problem you're trying to solve
  2. Describe your proposed solution
  3. List alternatives you've considered
  4. Explain why this would be useful to most users

Use the feature request template when opening a GitHub Issue.


πŸ“œ Code of Conduct

Be respectful and constructive. Personal attacks, harassment, and trolling are not tolerated. We're all here to make a great plugin for the Minecraft community.


❓ Questions?


Last updated: v1.0.0 β€’ Edit this page