From 9dff0a186c8cba9b2a81ec29b1368f3e3ed389bd Mon Sep 17 00:00:00 2001 From: Ventitoja Date: Sun, 16 Feb 2025 12:04:11 +0100 Subject: [PATCH 1/3] feat: Canvas.mdx Page dedicated to explaining how to contribute to canvas server --- docs/for-developers/contributing/canvas.mdx | 119 ++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 docs/for-developers/contributing/canvas.mdx diff --git a/docs/for-developers/contributing/canvas.mdx b/docs/for-developers/contributing/canvas.mdx new file mode 100644 index 0000000..07a3117 --- /dev/null +++ b/docs/for-developers/contributing/canvas.mdx @@ -0,0 +1,119 @@ +--- +title: Canvas +description: Guide to setting up a CanvasMC Server development environment. +authors: [Ventitoja] +--- + +import { Callout } from 'fumadocs-ui/components/callout'; + +## Introduction + +This guide presents the essential steps for configuring a CanvasMC development environment on Windows. + + + Paper-based servers are optimized for Linux. While Windows development is possible, we strongly recommend WSL2 for optimal performance. + + +## Environment Setup + +### Configuration Steps + + + + Enable WSL 2 using these commands in PowerShell (Administrator): + ```bash + dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart + dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart + wsl --set-default-version 2 + ``` + Restart your system afterward. + + + + Obtain Ubuntu via Microsoft Store or command line: + ```bash + wsl --install -d Ubuntu-24.04 + ``` + Configure credentials when prompted. + + + + Ensure your system is current: + ```bash + sudo apt update && sudo apt full-upgrade -y + ``` + + + + Deploy SDKMAN! for Java version management: + ```bash + curl -s "https://get.sdkman.io" | bash + source "$HOME/.sdkman/bin/sdkman-init.sh" + ``` + + + + Install Eclipse Temurin JDK 22: + ```bash + sdk install java 22.0.2+9-temurin + ``` + + Alternative JDK providers may impact performance and compilation speed. + + + + + Clone the Canvas Repository: + ```bash + https://github.com/CraftCanvasMC/Canvas.git + cd Canvas + ``` + + + + Import the cloned Canvas project using IntelliJ IDEA (or other IDE's but really IntelliJ is the best out there). + + + + Initialize the development environment: + ```bash + ./gradlew applyAllPatches + ``` + + + + +## Troubleshooting + +For technical assistance, visit the [CanvasMC Discord](https://canvasmc.io/discord). + +## Contributing + +After making changes to the source code: + + + + Rebuild patches (using the bash script in the root of the repo) to update the project: + ```bash + ./rebuildPatches + ``` + + + Commit your changes with a descriptive message: + ```bash + git add . + git commit -m "feat: describe your changes" + ``` + + + + Push your changes and create a Pull Request on GitHub: + ```bash + git push + ``` + + + + + Always run `rebuildPatches` before submitting a Pull Request to ensure your changes are properly captured in the patch files. + From 75ec2bbbc9ccbb02d3d543864c2f3d5272806edd Mon Sep 17 00:00:00 2001 From: Ventitoja Date: Sun, 16 Feb 2025 12:06:28 +0100 Subject: [PATCH 2/3] refactor: use remarkAdmonition --- docs/for-developers/contributing/canvas.mdx | 24 +++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/for-developers/contributing/canvas.mdx b/docs/for-developers/contributing/canvas.mdx index 07a3117..cb18a6d 100644 --- a/docs/for-developers/contributing/canvas.mdx +++ b/docs/for-developers/contributing/canvas.mdx @@ -10,9 +10,11 @@ import { Callout } from 'fumadocs-ui/components/callout'; This guide presents the essential steps for configuring a CanvasMC development environment on Windows. - - Paper-based servers are optimized for Linux. While Windows development is possible, we strongly recommend WSL2 for optimal performance. - +:::warn + +Paper-based servers are optimized for Linux. While Windows development is possible, we strongly recommend WSL2 for optimal performance. + +::: ## Environment Setup @@ -57,9 +59,11 @@ This guide presents the essential steps for configuring a CanvasMC development e ```bash sdk install java 22.0.2+9-temurin ``` - - Alternative JDK providers may impact performance and compilation speed. - + :::info + + Alternative JDK providers may impact performance and compilation speed. + + ::: @@ -114,6 +118,8 @@ After making changes to the source code: - - Always run `rebuildPatches` before submitting a Pull Request to ensure your changes are properly captured in the patch files. - +:::info + +Always run `rebuildPatches` before submitting a Pull Request to ensure your changes are properly captured in the patch files. + +::: From d1feb0a8ec9db4dd637c3f20e103b0212d55462d Mon Sep 17 00:00:00 2001 From: Szymon Pel Date: Sun, 16 Feb 2025 13:25:22 +0100 Subject: [PATCH 3/3] docs: enhance canvas contribution guide --- docs/for-developers/contributing/canvas.mdx | 147 +++++++++++++++----- 1 file changed, 111 insertions(+), 36 deletions(-) diff --git a/docs/for-developers/contributing/canvas.mdx b/docs/for-developers/contributing/canvas.mdx index cb18a6d..ee6c7e7 100644 --- a/docs/for-developers/contributing/canvas.mdx +++ b/docs/for-developers/contributing/canvas.mdx @@ -1,53 +1,67 @@ --- title: Canvas -description: Guide to setting up a CanvasMC Server development environment. -authors: [Ventitoja] +description: Learn how to contribute to CanvasMC Server +authors: [Ventitoja, feenko] --- -import { Callout } from 'fumadocs-ui/components/callout'; - ## Introduction -This guide presents the essential steps for configuring a CanvasMC development environment on Windows. +This guide will help you get started with contributing to CanvasMC server. :::warn -Paper-based servers are optimized for Linux. While Windows development is possible, we strongly recommend WSL2 for optimal performance. +Paper-based servers are optimized for Linux environments. While development on Windows is possible, we only provide support for Linux. ::: -## Environment Setup +## Getting Started + +### Prerequisites + +- For Windows users, WSL2. +- [Git](https://git-scm.com) with configured credentials. + +### WSL2 Configuration -### Configuration Steps +For Windows users, Windows Subsystem for Linux 2 (WSL2) provides an Linux development environment. If you have WSL2 configured or are using a native Linux/macOS system, proceed to the next section. - Enable WSL 2 using these commands in PowerShell (Administrator): + Open Command Prompt as Administrator and enable WSL 2 with the following commands: + ```bash dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart - wsl --set-default-version 2 ``` - Restart your system afterward. + + Restart your computer to apply these changes. - Obtain Ubuntu via Microsoft Store or command line: + Install Ubuntu or any other preferred Linux distribution via Microsoft Store or command line: + ```bash wsl --install -d Ubuntu-24.04 ``` - Configure credentials when prompted. + + When prompted, set up your Linux username and password. These credentials will be used for sudo commands. + + +### Local Setup + - Ensure your system is current: + Update your system packages to ensure everything is current: + ```bash - sudo apt update && sudo apt full-upgrade -y + sudo apt update && sudo apt upgrade -y && sudo apt full-upgrade -y ``` - Deploy SDKMAN! for Java version management: + Install SDKMAN! for Java version management: + ```bash curl -s "https://get.sdkman.io" | bash source "$HOME/.sdkman/bin/sdkman-init.sh" @@ -56,9 +70,11 @@ Paper-based servers are optimized for Linux. While Windows development is possib Install Eclipse Temurin JDK 22: + ```bash sdk install java 22.0.2+9-temurin ``` + :::info Alternative JDK providers may impact performance and compilation speed. @@ -68,58 +84,117 @@ Paper-based servers are optimized for Linux. While Windows development is possib Clone the Canvas Repository: + ```bash - https://github.com/CraftCanvasMC/Canvas.git + git clone https://github.com/CraftCanvasMC/Canvas.git cd Canvas ``` - Import the cloned Canvas project using IntelliJ IDEA (or other IDE's but really IntelliJ is the best out there). + Import the cloned Canvas project into IntelliJ IDEA. + + :::warning + + While other IDEs can be used, IntelliJ IDEA provides the best Java development experience with superior code analysis, debugging tools, and Gradle integration. + + ::: + + + + Make sure you have Git configured with your credentials: + + ```bash + git config --global user.name "Your Name" + git config --global user.email "your.email@example.com" + ``` - Initialize the development environment: + Set up your development environment by applying Paper, Purpur and Canvas patches: + ```bash ./gradlew applyAllPatches ``` + + This command prepares the codebase by applying all necessary patches to the Minecraft server, making it ready for development. -## Troubleshooting +### Troubleshooting -For technical assistance, visit the [CanvasMC Discord](https://canvasmc.io/discord). +If you encounter any issues, you can join our [Discord server](https://canvasmc.io/discord) for support. ## Contributing -After making changes to the source code: +### Creating Issues + +Before making changes, create an issue to discuss your proposed server changes. - Rebuild patches (using the bash script in the root of the repo) to update the project: - ```bash - ./rebuildPatches - ``` + Check existing issues to avoid duplicates + + + + Create a new issue + - Commit your changes with a descriptive message: + Clearly describe: + - What needs to be changed/added + - Why this change is needed + - Which parts of the code are affected + + + +### Submitting Changes + + + + Fork the repository + + + + Create a new branch from `dev`: + ```bash - git add . - git commit -m "feat: describe your changes" + git checkout dev + git pull origin dev + git checkout -b feature/your-feature-name ``` - + - Push your changes and create a Pull Request on GitHub: + Make your changes + + + + Commit with a clear message: + ```bash - git push + git commit -m "Add feature" ``` + + + Push your changes and create a Pull Request + -:::info +### Review Process -Always run `rebuildPatches` before submitting a Pull Request to ensure your changes are properly captured in the patch files. - -::: + + + Maintainers will review your PR within 2-3 business days + + + + Address any requested changes + + + + Once approved, your changes will be merged + +