forked from GeyserMC/Geyser
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CONTRIBUTING.md (GeyserMC#940)
- Loading branch information
Showing
1 changed file
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,44 @@ | ||
When contributing, please remember to read wiki about the api. Learn Steivice10's library and the nukkit protocol library if you are editing any core classes. Keep your code clean and readable, and please be mindful of fil conflicts. If you need help, join our discord. Other than that, you're all set! | ||
Thank for 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 | ||
|
||
private static final 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. | ||
*/ | ||
public void applyStuff() { | ||
if (condition) { | ||
// Do stuff. | ||
} else if (anotherCondition) { | ||
// Do something else. | ||
} | ||
|
||
switch (value) { | ||
case 0: | ||
break; | ||
case 1: | ||
break: | ||
} | ||
} | ||
``` | ||
|
||
Make sure to comment your code where possible. | ||
|
||
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://github.com/GeyserMC/Geyser/wiki/Developer-Guide). If you have any questions, please feel free to reach out to our [Discord](https://discord.geysermc.org)! |