Thank you for your interest in contributing to CraftEngineConverter! We welcome contributions from the community to help make this project better.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Coding Standards
- Making Changes
- Testing
- Submitting Changes
- Adding New Features
- Reporting Bugs
By participating in this project, you agree to:
- Be respectful and constructive in all interactions
- Welcome newcomers and help them get started
- Focus on what is best for the community
- Show empathy towards other community members
Before you begin, ensure you have the following installed:
- Java Development Kit (JDK) 21 or higher
- Apache Maven 3.6+
- Git
- IntelliJ IDEA (recommended) or another Java IDE
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/1robie/CraftEngineConverter.git cd CraftEngineConverter - Add the upstream repository:
git remote add upstream https://github.com/1robie/CraftEngineConverter.git
-
Build the entire project:
mvn clean install
-
Build without running tests (faster):
mvn clean install -DskipTests
-
Build a specific module:
cd Plugin mvn clean package
Run all tests:
mvn testRun tests for a specific module:
cd Common
mvn testRun a specific test class:
mvn test -Dtest=SnakeUtilsTest- Open the project in IntelliJ IDEA
- The IDE should automatically detect the Maven project and import it
- Ensure the Project SDK is set to Java 21:
File > Project Structure > Project > SDK
- Enable annotation processing if not already enabled:
File > Settings > Build, Execution, Deployment > Compiler > Annotation Processors
The project follows a multi-module Maven structure:
CraftEngineConverter/
├── API/ # Public API for plugin integration
├── Common/ # Core conversion logic and utilities
│ ├── cache/ # Caching mechanisms
│ ├── configuration/ # Configuration handling
│ ├── format/ # Format converters
│ ├── packet/ # Packet handling
│ └── tag/ # Tag processing system
├── Hooks/ # Plugin hook implementations
│ ├── BOM/ # Bill of Materials
│ ├── PacketEvent/ # Packet event integration
│ └── PlaceholderAPI/ # PlaceholderAPI integration
└── Plugin/ # Main plugin implementation
├── command/ # Command implementations
├── converter/ # Converter implementations
├── loader/ # Plugin loaders
└── utils/ # Utility classes
- SnakeUtils: YAML manipulation utility (Common module)
- TagProcessor: Custom tag parsing system (Common module)
- Converter: Base converter interface and implementations (Plugin module)
- CraftEngineImageUtils: Image and glyph conversion (Common module)
- ConfigurationManager: Configuration handling (Common module)
- Java Version: Use Java 21 features where appropriate
- Braces: Use K&R style (opening brace on same line)
- Naming Conventions:
- Classes:
PascalCase - Methods/Variables:
camelCase - Constants:
UPPER_SNAKE_CASE - Packages:
lowercase
- Classes:
- Add Javadoc comments for all public classes and methods
- Use
@Contractannotations for null-safety contracts - Use
@NotNulland@Nullableannotations appropriately - Include examples in documentation where helpful
Example:
/**
* Converts a Nexo item configuration to CraftEngine format.
*
* @param itemId The unique identifier of the item
* @param nexoConfig The source Nexo configuration section
* @return The converted CraftEngine configuration
* @throws IllegalArgumentException if itemId is null or empty
*/
@Contract("null, _ -> fail")
@NotNull
public ConfigurationSection convertItem(@NotNull String itemId, @NotNull ConfigurationSection nexoConfig) {
// Implementation
}- Write clean, readable code
- Follow SOLID principles
- Avoid code duplication (DRY principle)
- Use meaningful variable and method names
- Handle exceptions appropriately
- Add logging for important operations
- Always use
@NotNulland@Nullableannotations - Use
Optional<T>for methods that may return null - Validate input parameters early
- Use contracts (
@Contract) to document behavior
Create a descriptive branch name:
feature/add-oraxen-support- for new featuresfix/null-pointer-in-converter- for bug fixesdocs/update-readme- for documentationrefactor/simplify-tag-processor- for refactoring
Follow the conventional commits format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(converter): add Oraxen item conversion support
- Implement OraxenConverter class
- Add item model conversion
- Add texture pack mapping
Closes #42
fix(tag): resolve null pointer in GlyphTagProcessor
Fixed issue where escaped glyphs caused NPE when
PlaceholderAPI was not installed.
Fixes #38
- Write unit tests for all new functionality
- Use JUnit 5 for testing
- Place test files in
src/test/javamirroring the main package structure - Name test classes with
Testsuffix (e.g.,SnakeUtilsTest) - Use descriptive test method names (e.g.,
testGetSectionReturnsCorrectValue)
Example test:
@Test
void testConvertItemWithValidInput() {
// Arrange
SnakeUtils config = SnakeUtils.createEmpty();
config.set("material", "DIAMOND_SWORD");
// Act
ConfigurationSection result = converter.convertItem("test_sword", config.getRoot());
// Assert
assertNotNull(result);
assertEquals("DIAMOND_SWORD", result.getString("item"));
}- Aim for at least 70% code coverage for new code
- Test edge cases and error conditions
- Test null handling
- Test with various input types
-
Update your branch:
git fetch upstream git rebase upstream/main
-
Ensure all tests pass:
mvn clean test -
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub with:
- Clear title describing the change
- Detailed description of what was changed and why
- Reference to any related issues (e.g., "Closes #123")
- Screenshots for UI changes (if applicable)
-
Wait for review:
- Address any feedback from reviewers
- Make requested changes in new commits
- Keep the PR updated with upstream changes
- Code follows project coding standards
- All tests pass (
mvn test) - New tests added for new functionality
- Documentation updated (README, Javadoc, etc.)
- No compiler warnings introduced
- Commit messages follow conventional format
- Branch is up-to-date with main
- No merge conflicts
- Create a new converter class in
Plugin/src/main/java/fr/robie/craftengineconverter/converter/ - Extend the
Converterinterface or appropriate base class - Implement required conversion methods
- Add tests in
Plugin/src/test/java/ - Update documentation
- Create processor class in
Common/src/main/java/fr/robie/craftengineconverter/common/tag/processor/ - Implement
TagProcessorinterface - Register in
TagResolverUtils - Add tests
- Document the new tag syntax in README
- Create module in
Hooks/directory - Add dependency in
pom.xml - Implement hook interface
- Add to BOM required to load the hook into
Pluginmodule - Test integration
- Check if the bug has already been reported in Issues
- Verify you're using the latest version
- Test with minimal configuration to isolate the issue
When creating a bug report, include:
- Description: Clear description of the issue
- Steps to Reproduce:
- Step one
- Step two
- ...
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment:
- CraftEngineConverter version
- Minecraft version
- Server software (Paper/Folia)
- Java version
- Relevant plugin versions
- Logs: Relevant error logs or stack traces
- Configuration: Relevant config snippets (sanitized)
If you have questions about contributing:
- Open a discussion on GitHub
- Check existing issues and pull requests
- Review the project documentation
By contributing to CraftEngineConverter, you agree that your contributions will be licensed under the GPL-3.0 License.
Thank you for contributing to CraftEngineConverter! 🎉