zh_cn:tutorial:modding_tips
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
zh_cn:tutorial:modding_tips [2021/05/20 11:32] – created solidblock | zh_cn:tutorial:modding_tips [2024/04/15 02:25] (current) – solidblock | ||
---|---|---|---|
Line 5: | Line 5: | ||
===== 基本(API) ===== | ===== 基本(API) ===== | ||
- | * 由于Fabric API开发的基于注射的方法,我们不需要以用户可见的方式彻底修改类。发现一些你做不到的东西时,你有时只需要找原版类的Fabric扩展。比如: | + | * 由于 Fabric API 开发的基于注入的方法,我们不需要以用户可见的方式彻底修改类。发现一些你做不到的东西时,你有时只需要找原版类的 Fabric 扩展。比如: |
- | * Block.Settings -> FabricBlockSettings | + | * Block.Settings -> FabricBlockSettings(除了 1.20.5) |
* EntityType.Builder -> FabricEntityTypeBuilder | * EntityType.Builder -> FabricEntityTypeBuilder | ||
* 对于内建的资源包或者数据包,请确保分别存在“assets/ | * 对于内建的资源包或者数据包,请确保分别存在“assets/ | ||
Line 12: | Line 12: | ||
===== Mixins ===== | ===== Mixins ===== | ||
- | * 要将类强制转换为它未实现的接口,或强制转换为最终类,或将mixin强制转换为目标类,你可以使用“(TargetClass) (Object) sourceClassObject”的技巧。 | + | * 要将类强制转换为它未实现的接口,或强制转换为最终类,或将 mixin 强制转换为目标类,你可以使用“(TargetClass) (Object) sourceClassObject”的技巧。 |
- | * @Redirect 和 @ModifyConstant mixins 目前无法嵌套(多个模组同时应用在同一个地方)。这在开发中可能以后会改变——然而,目前,同@Overwrite一样,请尽量避免使用(or discuss bringing the hook over to Fabric' | + | * @Redirect 和 @ModifyConstant mixins 目前无法嵌套(多个模组同时应用在同一个地方)。这在开发中可能以后会改变——然而,目前,同 @Overwrite 一样,请尽量避免使用(或尝试将钩子桥接至 |
- | * If you're adding non-private custom fields or methods, prefix them with " | + | * 如果你要添加非私有的自定义字段或方法,请加上“模组id$”的前缀,或者加上其他独一无二的字符串并注解为 |
===== 网络 ===== | ===== 网络 ===== | ||
- | * Packets always begin execution on the **network thread**, however accesses to most Minecraft | + | * 封包永远是在**网络线程**开始执行的,但它对 |
- | ===== Pitfalls | + | ===== 陷阱 |
- | * Avoid using the '' | + | * 避免使用 |
zh_cn/tutorial/modding_tips.1621510363.txt.gz · Last modified: 2021/05/20 11:32 by solidblock