When editing files, keep new code and changes consistent with the style in the files. For new files, it should conform to the style for that component.
Last, if there's a completely new component, anything that is reasonably broadly accepted is fine.
Always keep in mind that the code should be user friendly and self explanatory.
Always keep in mind that the code will run concurrently for 10.000 online users.
Java:
1. We use
Allman style braces, where each brace begins on a new line. Single line statement block must be enclosed in braces.
2. We use tabs for spacing.
3. We use _lowerCamelCase starting with underscore (_) for class private fields, use final where possible.
4. We use lowerCamelCase with no underscores (_) for naming methods, parameters and variables. Use final only for non parameter variables where possible.
5. Static read only field names are written in capital letters and can use underscores.
6. Avoid more than one empty line at any time. For example, do not have two blank lines between members of a type.
7. Avoid extra free spaces. For example avoid if (someVar == 0)..., where the dots mark the extra free spaces.
8. Avoid the creation of objects by using primitives. (When you can, use int vs Integer, take in mind autoboxing etc...).
9. Avoid the use of constants, methods, interfaces for code that is not used more than once.
10. Do not declare variables in the same line (int a, b = 0).
11. Use switch when there are three or more cases to compare, otherwise use if.
12. Try to avoid using Stream since it may lead to significant overhead or memory leaks.
13. Avoid the use of NonNull annotations. A simple == null or != null will suffice.
14. The use of var modifier is prohibited in general, to achieve not hiding variable types (i.e. var stream = OpenStandardInput()) and easy to understand code.
15. Never use fully qualified class names inline in method bodies or signatures. Always use import statements instead (never `java.util.Collections.emptyList()`).
16. Add author for the classes you create. Add your name to an existing class only after doing significant changes.
17. Remove previous author names of an existing class only after doing more than 70% content changes, or adapted either fixed from an inoperable state.
18. For the most part, keep code Java 1.8 compatible.
XML:
1. We use tabs for spacing (Pretty print with line breaks).
2. Use lowercase for all element and attribute names (e.g., `<npc>`, `<item>`, `<skill>`, not `<NPC>`).
3. Keep attribute order consistent: place `id` first, then other descriptive attributes (id, name, level, type, etc.).
4. Try to use comments at the end of the line (same line) when needed to describe an NPC, item, or skill ID.
5. Do not add extra comments or author names.
6. Do not leave more than two empty lines.
7. Use self-closing syntax for empty elements (e.g., `<stat name="attack" value="15" />`).
HTML:
1. We use lowercase tags <html> in favor of <HTML>.
2. For text blocks we change line when <br> or <br1> tag is reached.
3. Do not leave empty lines.