Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-25 15:50:14 +01:00
Update CONTRIBUTING.md (#1787)
* Update CONTRIBUTING.md * Update CONTRIBUTING.md Ok that works to but i meant for that to mean 'put all your annotation stuff here' obviously it wont compile, but this works too Co-authored-by: theminecoder <theminecoder@users.noreply.github.com> Co-authored-by: YHDiamond <47502993+yehudahrrs@users.noreply.github.com> Co-authored-by: theminecoder <theminecoder@users.noreply.github.com>
Dieser Commit ist enthalten in:
Ursprung
5a8604fe54
Commit
f56663456d
@ -11,29 +11,36 @@ Thank for for considering a contribution! Generally, Geyser welcomes PRs from ev
|
|||||||
We have some general style guides that should be applied throughout the code:
|
We have some general style guides that should be applied throughout the code:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
public class LongClassName {
|
||||||
|
private static final int AIR_ITEM = 0; // Static item names should be capitalized
|
||||||
|
|
||||||
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 Int2IntMap items = new Int2IntOpenHashMap(); // Use the interface as the class type but initialize with the implementation.
|
public int nameWithMultipleWords = 0;
|
||||||
|
|
||||||
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) {
|
||||||
* Javadoc comment to explain what a function does.
|
// Do stuff.
|
||||||
*/
|
} else if (anotherCondition) {
|
||||||
public void applyStuff() {
|
// Do something else.
|
||||||
if (condition) {
|
}
|
||||||
// Do stuff.
|
|
||||||
} else if (anotherCondition) {
|
switch (value) {
|
||||||
// Do something else.
|
case 0:
|
||||||
}
|
stuff();
|
||||||
|
break;
|
||||||
switch (value) {
|
case 1:
|
||||||
case 0:
|
differentStuff();
|
||||||
break;
|
break;
|
||||||
case 1:
|
}
|
||||||
break:
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren