User Tools

Site Tools


documentation:fabric_loader

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
documentation:fabric_loader [2019/06/07 14:33] – [Entrypoints] Primarily clear up the first paragraph jamieswhiteshirtdocumentation:fabric_loader [2019/06/07 21:38] – [Entrypoints] jamieswhiteshirt
Line 24: Line 24:
 Entrypoints are a way for mods to expose code objects such as classes, fields and methods for usage by Fabric Loader or other mods. Fabric Loader uses entrypoints for mod initialization, and other mods can specify their own entrypoint types for mod integrations. Entrypoints are loaded by language adapters, which will attempt to produce a Java object of a provided type using the name of the code object. Entrypoints are a way for mods to expose code objects such as classes, fields and methods for usage by Fabric Loader or other mods. Fabric Loader uses entrypoints for mod initialization, and other mods can specify their own entrypoint types for mod integrations. Entrypoints are loaded by language adapters, which will attempt to produce a Java object of a provided type using the name of the code object.
  
-An entrypoints is only loaded when entrypoints of the entrypoint's type are requested, which makes an entrypoint an excellent tool for optional mod integrations. A mod may support a specific entrypoint type by declaring that other mods should provide entrypoints under a specified name using a class or interface that the mod provides in its API. The entrypoint will only be loaded when the mod requests it, avoiding any issues with loading classes that may not be present when the mod is not installed.+An entrypoint is only loaded when entrypoints of the entrypoint's type are requested, which makes an entrypoint an excellent tool for optional mod integrations. A mod may support a specific entrypoint type by declaring that other mods should provide entrypoints under a specified name using a class or interface that the mod provides in its API. The entrypoint will only be loaded when the mod requests it, avoiding any issues with loading classes that may not be present when the mod is not installed.
  
 Fabric Loader has three built-in entrypoint types for mod initialization in relation to physical sides (see [[tutorial:side]]). These entrypoints are executed about as early as possible during the game's initialization, which means not all things are initialized or ready for modification. These entrypoints are typically used to bootstrap mods by registering registry objects, event listeners and other callbacks for doing things later. Fabric Loader has three built-in entrypoint types for mod initialization in relation to physical sides (see [[tutorial:side]]). These entrypoints are executed about as early as possible during the game's initialization, which means not all things are initialized or ready for modification. These entrypoints are typically used to bootstrap mods by registering registry objects, event listeners and other callbacks for doing things later.
Line 38: Line 38:
   * **Field**: ''net.fabricmc.example.ExampleMod::field'' refers to the field in that class by the name 'field'. The field must be static and public. The the field type must implement or extend the expected type. The return value is the value of the field.   * **Field**: ''net.fabricmc.example.ExampleMod::field'' refers to the field in that class by the name 'field'. The field must be static and public. The the field type must implement or extend the expected type. The return value is the value of the field.
  
-References to class members must be unambiguous, meaning the class must contain only one and only one member with the targeted name. In case of ambiguity, the entrypoint will fail to resolve.+References to class members must be unambiguous, meaning the class must contain one and only one member with the targeted name. In case of ambiguity, the entrypoint will fail to resolve.
  
 Language adapters for other languages can be implemented by mods. [[https://github.com/FabricMC/fabric-language-kotlin|fabric-language-kotlin]] provides a language adapter for Kotlin. Language adapters for other languages can be implemented by mods. [[https://github.com/FabricMC/fabric-language-kotlin|fabric-language-kotlin]] provides a language adapter for Kotlin.
documentation/fabric_loader.txt · Last modified: 2023/12/27 12:57 by 194.190.81.32