From 87492946df0b1c4916d2fbb817d0acd77b8e8728 Mon Sep 17 00:00:00 2001 From: Tim203 Date: Wed, 8 Apr 2026 23:01:40 +0200 Subject: [PATCH] Update CONTRIBUTING.md --- CONTRIBUTING.md | 50 +------------------------------------------------ 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a483fbe9597..4d0ee20109f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,49 +1 @@ -Thank you for considering a contribution! Generally, Geyser welcomes PRs from everyone. There are some guidelines about what features should go where: - - -*Pull requests that may not get accepted:* Niche features that apply to a specific group, for example, integration with a specific plugin. For now, please create a separate plugin if possible. - -*Pull requests for Floodgate:* Anything that opens up information within the game for developers to use. - -*Pull requests for Geyser:* Anything that fixes compatibility between Java or Bedrock or improves the quality of play for Bedrock players. The exception is wherever direct server access is required; in this case, it may be better for Floodgate. - - -We have some general style guides that should be applied throughout the code: - -```java -public class LongClassName { - private static final int AIR_ITEM = 0; // Static item names should be capitalized - - public Int2IntMap items = new Int2IntOpenHashMap(); // Use the interface as the class type but initialize with the implementation. - - public int nameWithMultipleWords = 0; - - /** - * Javadoc comment to explain what a function does. - */ - @RandomAnnotation(stuff = true, moreStuff = "might exist") - public void applyStuff() { - Variable variable = new Variable(); - Variable otherVariable = new Variable(); - - if (condition) { - // Do stuff. - } else if (anotherCondition) { - // Do something else. - } - - switch (value) { - case 0 -> stuff(); - case 1 -> differentStuff(); - } - } -} -``` - -Make sure to comment your code where possible. To mark nullable methods, use `@Nullable` (and subsequently, `@NonNull`) from the `org.checkerframework.checker.nullness.qual` package. - -The nature of our software requires a lot of arrays and maps to be stored - where possible, use Fastutil's specialized maps. For example, if you're storing block state translations, use an `Int2IntMap`. - -We have a rundown of all the tools you need to develop over on our [wiki](https://wiki.geysermc.org/other/developer-guide/). If you have any questions, please feel free to reach out to our [Discord](https://discord.gg/geysermc)! - -If you're making a pull request that also depends on changes to [the base API](https://github.com/GeyserMC/api), simply fork the API repo and create a branch with the same name as your Geyser PR. The pull request [action](https://github.com/GeyserMC/Geyser/blob/master/.github/workflows/pullrequest.yml) will automatically use your API changes while building your changes to Geyser. \ No newline at end of file +Apple juice