|
| 1 | +# Contributing to Shopping |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Shopping plugin! This document provides guidelines and information for contributors. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | +- [Code of Conduct](#code-of-conduct) |
| 7 | +- [How to Contribute](#how-to-contribute) |
| 8 | +- [Development Setup](#development-setup) |
| 9 | +- [Coding Standards](#coding-standards) |
| 10 | +- [Testing](#testing) |
| 11 | +- [Submitting Changes](#submitting-changes) |
| 12 | +- [Reporting Issues](#reporting-issues) |
| 13 | + |
| 14 | +## Code of Conduct |
| 15 | + |
| 16 | +This project follows a simple code of conduct: |
| 17 | +- Be respectful and inclusive |
| 18 | +- Focus on constructive feedback |
| 19 | +- Help create a positive community |
| 20 | + |
| 21 | +## How to Contribute |
| 22 | + |
| 23 | +### Types of Contributions |
| 24 | +- **Bug fixes** - Fix existing issues |
| 25 | +- **Features** - Add new functionality |
| 26 | +- **Documentation** - Improve documentation |
| 27 | +- **Testing** - Add or improve tests |
| 28 | + |
| 29 | +### Getting Started |
| 30 | +1. Fork the repository |
| 31 | +2. Create a feature branch from `main` |
| 32 | +3. Make your changes |
| 33 | +4. Test thoroughly |
| 34 | +5. Submit a pull request |
| 35 | + |
| 36 | +## Development Setup |
| 37 | + |
| 38 | +### Prerequisites |
| 39 | +- **Java 21** or higher |
| 40 | +- **Gradle 8.5** or higher |
| 41 | +- **Minecraft Server** (Paper/Spigot 1.21+) for testing |
| 42 | +- **Economy Plugin** (Vault + EssentialsX/CMI) |
| 43 | + |
| 44 | +### Setup Steps |
| 45 | +```bash |
| 46 | +# Clone your fork |
| 47 | +git clone https://github.com/YOUR_USERNAME/Shopping.git |
| 48 | +cd Shopping |
| 49 | + |
| 50 | +# Build the project |
| 51 | +./gradlew build |
| 52 | + |
| 53 | +# Test in development environment |
| 54 | +./gradlew runServer # If you have a test server setup |
| 55 | +``` |
| 56 | + |
| 57 | +### Project Structure |
| 58 | +``` |
| 59 | +src/main/java/me/touchie771/shopping/ |
| 60 | +├── Shopping.java # Main plugin class |
| 61 | +├── FeesManager.java # Fee and tax system |
| 62 | +├── SecurityManager.java # Item restrictions |
| 63 | +├── shop/ # Shop system |
| 64 | +│ ├── ShopCommand.java |
| 65 | +│ ├── ShopHandler.java |
| 66 | +│ ├── ShopMenuListener.java |
| 67 | +│ └── ShopItem.java |
| 68 | +└── auction/ # Auction system |
| 69 | + ├── AuctionCommand.java |
| 70 | + ├── AuctionHandler.java |
| 71 | + ├── AuctionMenuListener.java |
| 72 | + ├── AuctionTask.java |
| 73 | + └── AuctionItem.java |
| 74 | +
|
| 75 | +src/main/resources/ |
| 76 | +├── plugin.yml # Plugin configuration |
| 77 | +├── fees.yml # Fee settings |
| 78 | +├── security.yml # Item restrictions |
| 79 | +└── *.yml # Data files |
| 80 | +``` |
| 81 | + |
| 82 | +## Coding Standards |
| 83 | + |
| 84 | +### Java Code Style |
| 85 | +- Use **UTF-8** encoding |
| 86 | +- Follow standard Java naming conventions |
| 87 | +- Use meaningful variable and method names |
| 88 | +- Add documentation for public methods |
| 89 | +- Keep methods focused on single responsibilities |
| 90 | +- Use final for immutable variables where appropriate |
| 91 | + |
| 92 | +### Code Quality |
| 93 | +- **No emojis** in code or comments |
| 94 | +- Write **maintainable code** with clear logic |
| 95 | +- Handle exceptions appropriately |
| 96 | +- Use logging for debugging (not print statements) |
| 97 | +- Keep the codebase clean and well-organized |
| 98 | + |
| 99 | +### Commit Messages |
| 100 | +Use clear, descriptive commit messages: |
| 101 | +``` |
| 102 | +feat: add configurable fees system |
| 103 | +fix: resolve auction completion bug |
| 104 | +docs: update README with fee examples |
| 105 | +refactor: improve shop menu performance |
| 106 | +``` |
| 107 | + |
| 108 | +### Pull Request Guidelines |
| 109 | +- **One feature/fix per PR** - Keep changes focused |
| 110 | +- **Descriptive title** - Clearly explain what the PR does |
| 111 | +- **Detailed description** - Explain the problem and solution |
| 112 | +- **Test your changes** - Ensure everything works |
| 113 | +- **Update documentation** - If needed |
| 114 | +- **Squash commits** - Clean up commit history |
| 115 | + |
| 116 | +## Testing |
| 117 | + |
| 118 | +### Manual Testing |
| 119 | +1. **Compile** the plugin: `./gradlew build` |
| 120 | +2. **Install** on test server with Vault and economy plugin |
| 121 | +3. **Test features**: |
| 122 | + - Shop listings and purchases |
| 123 | + - Auction creation and bidding |
| 124 | + - Fee calculations and tax collection |
| 125 | + - Permission checks |
| 126 | + - Edge cases (insufficient funds, etc.) |
| 127 | + |
| 128 | +### Test Checklist |
| 129 | +- [ ] Shop selling works with fees |
| 130 | +- [ ] Shop buying works with taxes |
| 131 | +- [ ] Auction starting works with fees |
| 132 | +- [ ] Auction completion works with taxes |
| 133 | +- [ ] Permissions are respected |
| 134 | +- [ ] Error messages are clear |
| 135 | +- [ ] Data saves/loads correctly |
| 136 | +- [ ] No console errors |
| 137 | + |
| 138 | +## Submitting Changes |
| 139 | + |
| 140 | +### Pull Request Process |
| 141 | +1. **Ensure tests pass** and code compiles |
| 142 | +2. **Update documentation** if needed |
| 143 | +3. **Write clear commit messages** |
| 144 | +4. **Create pull request** with detailed description |
| 145 | +5. **Respond to feedback** and make requested changes |
| 146 | +6. **Wait for review** and approval |
| 147 | + |
| 148 | +### PR Template |
| 149 | +``` |
| 150 | +## Description |
| 151 | +Brief description of changes |
| 152 | +
|
| 153 | +## Type of Change |
| 154 | +- [ ] Bug fix |
| 155 | +- [ ] New feature |
| 156 | +- [ ] Documentation update |
| 157 | +- [ ] Refactoring |
| 158 | +
|
| 159 | +## Testing |
| 160 | +- [ ] Tested on local server |
| 161 | +- [ ] All existing functionality works |
| 162 | +- [ ] New features work as expected |
| 163 | +
|
| 164 | +## Additional Notes |
| 165 | +Any additional context or screenshots |
| 166 | +``` |
| 167 | + |
| 168 | +## Reporting Issues |
| 169 | + |
| 170 | +### Bug Reports |
| 171 | +Please include: |
| 172 | +- **Minecraft version** and server type (Paper/Spigot) |
| 173 | +- **Plugin version** |
| 174 | +- **Steps to reproduce** the issue |
| 175 | +- **Expected behavior** |
| 176 | +- **Actual behavior** |
| 177 | +- **Error logs** if applicable |
| 178 | +- **Configuration files** if relevant |
| 179 | + |
| 180 | +### Feature Requests |
| 181 | +Please include: |
| 182 | +- **Clear description** of the feature |
| 183 | +- **Use case** - why is this needed? |
| 184 | +- **Implementation ideas** if you have them |
| 185 | +- **Mockups** or examples if applicable |
| 186 | + |
| 187 | +## Questions? |
| 188 | + |
| 189 | +If you have questions about contributing: |
| 190 | +- Check existing [issues](https://github.com/Touchie771/Shopping/issues) and [discussions](https://github.com/Touchie771/Shopping/discussions) |
| 191 | +- Open a [discussion](https://github.com/Touchie771/Shopping/discussions) for questions |
| 192 | +- Contact the maintainer |
| 193 | + |
| 194 | +Thank you for contributing to Shopping! 🎉 |
0 commit comments