User Tools

Site Tools


zh_cn:documentation:entrypoint

Differences

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

Link to this comparison view

Next revision
Previous revision
zh_cn:documentation:entrypoint [2021/09/01 13:19] – created not completed solidblockzh_cn:documentation:entrypoint [2024/01/02 10:32] (current) solidblock
Line 30: Line 30:
 ==== 内置入口点协议类型 ==== ==== 内置入口点协议类型 ====
  
-Fabric Loader provides four built-in entrypoint prototypes for mod initialization, some of which are designed to deal with initialization with respect to physical sides (see [[tutorial:side]]). The mainclient and server entrypoints are loaded and called early during the game's initialization, at a point where **most but not all** game systems are 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 加载器提供四种内置的入口点协议以用于模组初始化,其中一些用于处理与物理端有关的初始化(见 [[tutorial:side]])。mainclientserver入口点在游戏初始化早期就会被加载并调用,此时**大多数但并非全部**的游戏系统都已准备好被修改。这些入口点用于通过注册注册表对象、事件监听器和其他用于后面的事情的回调来启动。
  
-  * **main**: The first normal initialization entrypoint to run. Uses the type ''ModInitializer'' and will call ''onInitialize''. +  * **main**:第一个要运行的正常初始化入口点。使用 ''ModInitializer'' 类并调用 ''onInitialize'' 
-  * **client**: Will run after main only in a physical client. Uses the type ''ClientModInitializer'' and will call ''onInitializeClient''. +  * **client**:仅在物理客户端的 main 后运行。使用 ''ClientModInitializer'' 类并调用 ''onInitializeClient'' 
-  * **server**: Will run after main only in a physical server. Uses the type ''DedicatedServerModInitializer'' and will call ''onInitializeServer''. +  * **server**:仅在物理服务器的 main 后运行。使用 ''DedicatedServerModInitializer'' 类并调用 ''onInitializeServer'' 
-  * **preLaunch (not recommended for general use)**: The earliest possible entrypoint, which is called just before the game launches. Use with caution to not interfere with the game's initialization. Uses the type ''PreLaunchEntryPoint'' and will call ''onPreLaunch''+  * **preLaunch(一般不建议使用)**:可能的最早期的入口点,在游戏启动之前调用。使用时注意不要干预游戏初始化。使用类 ''PreLaunchEntryPoint'' 并调用 ''onPreLaunch''
- +
-All main entrypoints are called before all client/server entrypoints. The exact time these entrypoints are called is unspecified and may vary between different versions of the game.+
  
 +所有的 main 入口点都是在 client/server 入口点之前调用的。调用这些入口点的准确时间是未指定的,可能因游戏版本而异。
 ==== 代码引用类型 ==== ==== 代码引用类型 ====
  
zh_cn/documentation/entrypoint.1630502376.txt.gz · Last modified: 2021/09/01 13:19 by solidblock