User Tools

Site Tools


documentation:entrypoint

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:entrypoint [2020/02/22 00:21] jamieswhiteshirtdocumentation:entrypoint [2020/02/22 00:25] – [Basic usage] jamieswhiteshirt
Line 26: Line 26:
 </code> </code>
  
-**Caution:** It is recommended to use separate classes for main, client and server entrypoints to avoid class loading issues. Consider the case where the same class is used for both a main and a client entrypoint. When launched on a dedicated server, even if the "client" entrypoint is never loaded, the class that contains the client initialization logic will. Even if the client logic will never be executed, the act of only loading the code may trigger class loading issues.+**Caution:** It is recommended to use separate classes for main, client and server entrypoints to avoid class loading issues. Consider the case where the same class is used for both a main and a client entrypoint. When launched on a dedicated server, even if the "client" entrypoint is never loaded, the class that contains the client initialization logic will be. Even if the client logic will never be executed, the act of merely loading the code may trigger class loading issues.
  
 ==== Built-in entrypoint prototypes ==== ==== Built-in entrypoint prototypes ====
Line 41: Line 41:
 ==== Code reference types ==== ==== Code reference types ====
  
-An entrypoint's code reference is turned into an instance of the entrypoint prototype's type. The most common way to make an entrypoint is to refer to a class which implements the expected type, but these code references can be made in multiple ways. Internally, a language adapter is responsible for interpreting the references. The default language adapter is designed for Java code, and thus supports the following types of references:+An entrypoint's code reference is turned into an instance of the entrypoint prototype's type. The most common way to make an entrypoint is to refer to a class which implements the expected type, but these code references can be made in multiple ways. Internally, a language adapter is responsible for interpreting the references and turning them into instances. The default language adapter is designed for Java code, and thus supports the following types of references:
  
   * **Class reference**: ex. ''net.fabricmc.example.ExampleMod'' refers to the non-abstract class by this name. The class must have a public constructor with no arguments. The class must implement or extend the expected type. The resulting object is a new instance of the class.   * **Class reference**: ex. ''net.fabricmc.example.ExampleMod'' refers to the non-abstract class by this name. The class must have a public constructor with no arguments. The class must implement or extend the expected type. The resulting object is a new instance of the class.
documentation/entrypoint.txt · Last modified: 2023/12/27 13:07 by 34.220.124.230