2020-12-27 19:30:41 +01:00
|
|
|
# How to contribute to EcoEnchants
|
|
|
|
|
|
|
|
## Codestyle
|
2021-04-04 17:11:02 +02:00
|
|
|
|
2020-12-27 19:30:41 +01:00
|
|
|
1. The EcoEnchants checkstyle is in /config/checkstyle.xml
|
2021-04-04 17:11:02 +02:00
|
|
|
|
2020-12-27 19:30:41 +01:00
|
|
|
- The pull request must not have any checkstyle issues.
|
|
|
|
- Every method and field must have a javadoc attached.
|
|
|
|
|
2020-12-28 17:52:11 +01:00
|
|
|
2. Use lombok wherever possible.
|
2021-04-04 17:11:02 +02:00
|
|
|
|
2020-12-27 19:30:41 +01:00
|
|
|
- As of 6.0.0, EcoEnchants is now built with lombok.
|
|
|
|
- @Getter, @Setter, @ToString, @EqualsAndHashCode, @UtilityClass are the most important.
|
|
|
|
|
2020-12-28 17:52:11 +01:00
|
|
|
3. Use JetBrains annotations
|
2021-04-04 17:11:02 +02:00
|
|
|
|
2020-12-27 19:30:41 +01:00
|
|
|
- Every parameter should be annotated with @NotNull or @Nullable
|
|
|
|
- Use @NotNull over lombok @NonNull
|
|
|
|
|
2020-12-28 17:52:11 +01:00
|
|
|
4. Imports
|
2021-04-04 17:11:02 +02:00
|
|
|
|
2020-12-27 19:30:41 +01:00
|
|
|
- No group (*) imports.
|
|
|
|
- No static imports.
|
|
|
|
|
|
|
|
## Dependency Injection
|
2021-04-04 17:11:02 +02:00
|
|
|
|
2020-12-27 19:30:41 +01:00
|
|
|
- EcoEnchants uses Dependency Injection since 6.0.0.
|
|
|
|
- Any calls to AbstractEcoPlugin#getInstance are code smells and should never be used unless **absolutely necessary**.
|
|
|
|
- NamespacedKeys, FixedMetadataValues, Runnables, and Schedules should be managed using EcoEnchantsPlugin through DI.
|
2021-04-04 17:11:02 +02:00
|
|
|
- Any DI class should extend PluginDependent where possible. If the class extends another, then you **must** store the
|
|
|
|
plugin instance in a private final variable called **plugin** with a private or protected getter.
|
2020-12-27 19:30:41 +01:00
|
|
|
|
|
|
|
## Other
|
2021-04-04 17:11:02 +02:00
|
|
|
|
2020-12-27 19:30:41 +01:00
|
|
|
- All drops **must** be sent through a DropQueue - calls to World#dropItem will get your PR rejected.
|
|
|
|
- EcoEnchants is built with java 8. Usage of J9+ will get your PR rejected.
|
|
|
|
- Any non-plugin-specific changes **must** be made to eco-util, or core-proxy, rather than core-plugin.
|