Cadiboo / Example-Mod

An example mod created to try and get new modders to use good code practices
GNU Lesser General Public License v3.0
196 stars 41 forks source link

Annotate cadiboo.examplemod.api package with the @API annotation #1

Closed V0idWa1k3r closed 5 years ago

V0idWa1k3r commented 5 years ago

Forge has a specific annotation for packages that are supposed to hold your API, it's the net.minecraftforge.fml.common.API one. A package annotated with this annotation tells forge that everything within that package is a part of a public API provided by a specific mod. It is used internally in forge when for example deciding whether to remove methods annotated with @Optional and it is also used in sorting the mod list. It also provides some information to the addonmakers such as the version of the API. To annotate a package create a package-info.java file in your api package and annotate the package line in it with the annotation. This is not strictly necessarry but is generally a good practice.