Skip to content

Commit 1317c04

Browse files
committed
start config docs + overhaul of contributing docs
1 parent f3fbe5b commit 1317c04

17 files changed

Lines changed: 166 additions & 85 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Custom Dokka
2+
3+
Pylon uses a custom version of Dokka to generate Javadocs. This is because the default Dokka output is very buggy and doesn't look very good. Seggan has submitted pull requests to the Dokka project to fix the issues, but they haven't been merged yet, so in the meantime we use a custom version. If you wish to see the "fixed" doc output, here are the steps:
4+
5+
1. Clone the `pylonmc/dokka` repository: `git clone https://github.com/pylonmc/dokka`
6+
2. Checkout the `pylon` branch: `git checkout pylon`
7+
3. In the root directory, execute `./gradlew publishToMavenLocal -Pversion=2.1.0-pylon-SNAPSHOT`. Note that as Dokka is a very large project, the first build will take a long time. On Seggan's decent-ish laptop, the first run took about 10 minutes. Subsequent builds will be much faster as long s you don't delete the build cache.
8+
4. Now, in the Pylon master project, execute `./gradlew :rebar:rebar:dokkaGenerate -PusePylonDokka=true`. The generated output will be under `pylon/rebar/rebar/build/dokka`.
9+

docs/en/documentation/contributing/getting-started.md

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,67 @@
1-
# Getting started
1+
!!! info "This guide covers contributing to both Pylon and Rebar, as the process is very similar."
22

3-
Rebar is written in [Kotlin](https://kotlinlang.org/), a language similar to Java, but with more modern features and concise syntax. If you know Java, you'll be able to pick up Kotlin very quickly.
3+
## What should I contribute?
44

5-
Pylon is written in Java.
5+
We generally welcome contributions for both Rebar and Pylon.
66

7-
## How to get started
7+
We use GitHub issues to keep track of tasks. Good first issues are labelled with the 'good first issue' tag. You can view good first issues for Rebar [here](https://github.com/pylonmc/rebar/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22) and for Pylon [here](https://github.com/pylonmc/pylon/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22). Picking one of these issues is a great place to start.
88

9-
1. Clone the `parallel-dev-repo` repository: `git clone https://github.com/pylonmc/parallel-dev-repo` (or use a GUI like Github Desktop)
10-
2. If you're using IntelliJ, it'll set everything up automatically. If not, run `./gradlew`. This will clone the `rebar` and `pylon` repositories.
11-
3. If you want to submit your changes to the master project, **delete the `rebar` or `pylon` directory (depending on which one you want to contribute to), fork the rebar or pylon repository, and clone your fork into the same directory.** Otherwise, you won't be able to open a pull request with your changes (unless you're a Rebar/Pylon developer and have access to the Rebar/Pylon repositories).
9+
If you'd like to do something which does not have an issue already (you can check this by searching for keywords in issues), we recommend you open an issue and assign yourself to it before completing the task. This helps avoid duplicate work and lets others know what you are doing.
10+
11+
If you are planning on making a major change, we strongly recommend discussing with the team beforehand on the Pylon Discord server.
1212

13-
See the [The Parallel Dev Repo Project](master-project.md) page for more information about the master repository.
13+
If you have any questions about contributing, feel free to ask us on the Pylon Discord.
1414

15-
## Submitting your contributions
15+
## Prerequisites
1616

17-
We generally welcome contributions for both Rebar and Pylon, but it's best check with the Pylon team before making any major changes, because we might already have something planned out that won't fit well with your changes. Hop on our Discord server and have a chat with us if you're interested in doing anything major, or have any questions about contributing :)
17+
### Contributing to Rebar
18+
- A GitHub account
19+
- A Git/GitHub client such as [GitHub Desktop](https://github.com/apps/desktop)
20+
- Knowledge of [Kotlin](https://kotlinlang.org/)
21+
- A Kotlin IDE (such as IntelliJ)
1822

19-
Once you're done with your changes, open a pull request and give some information about what you did and why you did it.
23+
### Contributing to Pylon
24+
- A GitHub account
25+
- A Git/GitHub client such as [GitHub Desktop](https://github.com/apps/desktop)
26+
- Knowledge of Java
27+
- A Java IDE (such as IntelliJ)
2028

21-
## Tests
29+
!!! question "What is Kotlin?"
30+
Kotlin is a language similar to Java, but with more modern features and concise syntax. If you know Java, you'll be able to pick up Kotlin very quickly.
2231

23-
Rebar has a set of integration tests. Tests should only be added for critical functionality such as block storage and recipes.
32+
## How to get started
33+
34+
We use the **parallel dev repository** to develop Rebar and Pylon in parallel. We recommend you use this repository when contributing to Pylon, Rebar, or both.
2435

25-
## Custom Dokka
36+
1. Clone the `parallel-dev-repo` repository: `git clone https://github.com/pylonmc/parallel-dev-repo` (or use a GUI like Github Desktop)
37+
2. If you're using IntelliJ, it should clone the `rebar` and `pylon` repositories into the project automatically. If not, run `./gradlew`.
2638

27-
Pylon uses a custom version of Dokka to generate Javadocs. This is because the default Dokka output is very buggy and doesn't look very good. Seggan has submitted pull requests to the Dokka project to fix the issues, but they haven't been merged yet, so in the meantime we use a custom version. If you wish to see the "fixed" doc output, here are the steps:
39+
See the [parallel dev repo docs page](parallel-dev-repo.md) for more information about the parallel dev repository.
2840

29-
1. Clone the `pylonmc/dokka` repository: `git clone https://github.com/pylonmc/dokka`
30-
2. Checkout the `pylon` branch: `git checkout pylon`
31-
3. In the root directory, execute `./gradlew publishToMavenLocal -Pversion=2.1.0-pylon-SNAPSHOT`. Note that as Dokka is a very large project, the first build will take a long time. On Seggan's decent-ish laptop, the first run took about 10 minutes. Subsequent builds will be much faster as long s you don't delete the build cache.
32-
4. Now, in the Pylon master project, execute `./gradlew :rebar:rebar:dokkaGenerate -PusePylonDokka=true`. The generated output will be under `pylon/rebar/rebar/build/dokka`.
41+
### Contributing to Rebar
42+
43+
3. [Fork Rebar](https://github.com/pylonmc/rebar/fork) on GitHub
44+
4. Delete the `rebar` directory
45+
5. Clone your fork in place of the `rebar` directory you just deleted
46+
6. Make your changes
47+
7. [Test your changes](testing-your-changes.md)
48+
8. Commit and push your changes to your fork
49+
9. Open a pull request
50+
51+
### Contributing to Pylon
52+
53+
3. [Fork Pylon](https://github.com/pylonmc/pylon/fork) on GitHub
54+
4. Delete the `pylon` directory
55+
5. Clone your fork in place of the `pylon` directory you just deleted
56+
6. Make your changes
57+
7. [Test your changes](testing-your-changes.md)
58+
8. Commit and push your changes to your fork
59+
9. Open a pull request
3360

3461
## I'm stuck, what next?
3562

36-
1. If it's Pylon specific, check if it's in the docs. If it's not Pylon specific, google it.
63+
1. If it's Pylon/Rebar specific, check if it's in the docs. If it's not Pylon/Rebar specific, google it.
3764
2. Search issues on the relevant repository to see if it's been mentioned
3865
3. Search relevant terms on our Discord server to see if it's been discussed before
3966
4. Ask a question on our Discord server
4067

41-
42-
[comment]: <> (TODO make this easier to comprehend, maybe add screenshots etc, less experienced users will have no idea what the fuck is going on from these instructions)
43-

docs/en/documentation/contributing/master-project.md

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# The Parallel Dev Repo Project
2+
3+
PylonMC has a repository called `parallel-dev-repo`. This allows you to run Pylon using your very own home-baked version of Rebar, allowing you to test new features much more easily. We recommend you make changes to both Pylon and Rebar using the repository.
4+
5+
## Project structure
6+
The project is structured as such:
7+
```
8+
pylon/
9+
src/
10+
rebar/
11+
dokka-plugin/
12+
nms/
13+
rebar/
14+
test/
15+
```
16+
17+
The `pylon` directory, unsurprisingly, contains the source code for Pylon.
18+
19+
The `rebar` directory is more complicated. Inside it are four subprojects: `dokka-plugin`, `nms`, `rebar`, and `test`.
20+
21+
- `dokka-plugin` contains a custom Dokka plugin we use to help with formatting Rebar's Javadocs
22+
- `nms` contains all the Rebar code that touches server internals. It is in a separate subproject to effectively isolate potentially unstable code from the rest of the project
23+
- `rebar` contains the code for Rebar itself
24+
- `test` contains the automated tests for Rebar
25+
26+
## Tasks
27+
The parallel dev repo contains a few tasks that are useful for development:
28+
29+
| Task | Alias | Description |
30+
|------------------------------|---------------------|------------------------------------------------------------------------------------------------------------|
31+
| `runServer` | `runSnapshotServer` | Runs a Minecraft server with the current version of Rebar and Pylon |
32+
| `:pylon:runServer` | `runStableServer` | Runs a Minecraft server with the latest stable version of Rebar and the current version of Pylon |
33+
| `:rebar:test:runServer` | `runLiveTests` | Executes the automated tests for Rebar |
34+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Testing your changes
2+
3+
Please test your changes before opening a pull request.
4+
5+
To test your changes, you should run a local server with your modified versions of Rebar and/or Pylon. If you are using the parallel dev repo, this is easy. In IntelliJ, open the gradle panel on the right, open 'parallel-dev-repo', open 'run paper', and double click 'runServer'. This will run a server with your local versions of Rebar and Pylon on it. Otherwise, you can run `./gradlew runServer` from the command line. You can join the server by starting Minecraft and connecting to `localhost`.
6+
7+
## Debugging
8+
9+
You can use a debugger on your code easily with IntelliJ. Ensure that the 'parallel-dev-repo \[runServer\]' run configuration is selected, and then click the debug button. This will launch a server and attach the debugger to it.
10+
11+
By default, the debugger will also attach to gradle tasks, including compilation, which causes a significant slowdown. To fix this, edit the run configuration, click 'modify options', and uncheck 'debug gradle scripts'.
12+
13+
!!! danger
14+
If you are launching the tasks using the aliases from IntelliJ and attach the debugger, you will notice that it does not work. I have no idea why this happens. In order to successfully attach the debugger, you need to run the actual tasks, not the aliases. For example, instead of running `runSnapshotServer`, run `runServer`.
15+
16+
## Automated tests
17+
18+
Rebar has a set of automated tests. Due to the limited and annoying nature of automatically testing a Minecraft plugin, they should only be added for critical functionality such as block storage and recipes.
19+
20+
!!! warning
21+
Do not expect Rebar's automated tests to catch any issues in your code unless you are modifying specific parts of the core systems that they test, such as parts of the fluid ticking logic.
22+

docs/en/documentation/overview.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
The Rebar docs are split into 4 parts:
2-
31
### Javadocs / KDocs
42

53
An automatically generated web view of the codebase which allows you to search names, view JavaDoc strings, and more. KDocs is the Kotlin version of Javadocs.
@@ -10,13 +8,13 @@ An automatically generated web view of the codebase which allows you to search n
108

119
### Reference
1210

13-
Documentation which gives a more holistic overview of Rebar and certain Rebar systems, written for addon developers.
11+
Documentation which gives a complete overview of Rebar, written for addon developers.
1412

1513
---
1614

1715
### Internals
1816

19-
Holistic documentation on how Rebar systems work intewrnally. You do not need to view this documentation unless you are working on Rebar itself.
17+
Holistic documentation on how Rebar systems work internally. You do not need to view this documentation unless you are working on Rebar itself.
2018

2119
---
2220

docs/en/documentation/reference/blocks/creating-new-blocks.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Custom blocks
2-
31
!!! warning "This section of the docs assumes you understand the basics of Rebar items."
42

53
Adding a custom block requires 3 things:

docs/en/documentation/reference/blocks/interfaces.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Block interfaces
2-
31
Rebar has a number of builtin interfaces which add custom behaviour to blocks. For example, there are interfaces which allow you to:
42

53
- add fluid buffers ([RebarFluidBufferBlock](https://pylonmc.github.io/rebar/docs/javadoc/io/github/pylonmc/rebar/block/base/RebarFluidBufferBlock.html))

docs/en/documentation/reference/blocks/persistent-data.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Persistent data
2-
31
Since each physical block has a corresponding instance, you can store block data in your block's class.
42

53
For example, consider a block which increments a counter by one every time it is right clicked:

docs/en/documentation/reference/blocks/settings.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Settings
2-
31
Just like items, you can assign settings to a block.
42

53
Suppose we have a block which counts up by one every time it is right clicked:

0 commit comments

Comments
 (0)