ru:tutorial:introduction
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ru:tutorial:introduction [2020/08/23 12:22] – created magicsweet | ru:tutorial:introduction [2022/02/11 07:11] (current) – немного заменил слова furnygo | ||
---|---|---|---|
Line 21: | Line 21: | ||
===== Native Minecraft APIs ===== | ===== Native Minecraft APIs ===== | ||
- | If Minecraft | + | Если |
- | A good example of this is the " | + | Хорошим примером этого является класс |
- | Minecraft | + | Minecraft |
- | You can add JSON files to your mod, which are then injected by the Fabric API. | + | Вы можете добавить |
- | For example, block models and loot tables are implemented through | + | Например, модели блоков реализуются с помощью |
===== The Fabric API ===== | ===== The Fabric API ===== | ||
- | Fabric | + | Сам |
- | - The Fabric Loader, | + | - Fabric Loader, |
- | - The Fabric API, an optional library that provides some common useful APIs. | + | - Fabric API, опциональная библиотека, |
- | The API is intentionally kept relatively small, to make porting | + | API намеренно держится относительно небольшим, чтобы ускорить перенос |
- | You can find out what's included in the Fabric API by looking over [[https:// | + | Вы можете узнать, |
- | The Fabric API contains a lot of common event hooks, and general utilities for things like networking and rendering. | + | Fabric API содержит множество общих событий и общих утилит для таких вещей, как создание сетей и рендеринг. |
- | ===== Third Party APIs ===== | + | ===== Сторонние API ===== |
- | Because the Fabric API is intentionally kept small and focused, third party APIs exist to fill in the gaps. | + | Поскольку |
- | Mixins | + | Mixins |
- | You should use these instead of writing your own mixins | + | Вы должны использовать их вместо того, чтобы писать свои собственные |
- | You can find an incomplete lists of [[documentation: | + | Вы можете найти неполные списки |
===== Mixins ===== | ===== Mixins ===== | ||
- | Finally, you can use mixins. | + | Наконец, вы можете использовать |
- | Mixins | + | Mixins |
- | Some mixins | + | Некоторые |
- | Mixins | + | Mixins |
- | * Adding Interfaces | + | * Добавление Интерфейсов |
* Callback Injectors | * Callback Injectors | ||
* Redirect Injectors | * Redirect Injectors | ||
- | * Overwrites, you should never use these | + | * Перезапись |
- | This is not a complete list, but rather a quick overview. | + | Это не полный список, а скорее краткий обзор. |
- | Some mixin types are omitted here. | + | ==== Добавление Интерфейсов |
- | ==== Adding Interfaces | + | |
- | This is probably one of the safest ways to use mixins. | + | Это, вероятно, |
- | New interface implementations can be added to any Minecraft | + | Новые реализации интерфейса могут быть добавлены в любой класс |
- | You can then access the interface by casting the class to it. | + | Затем вы можете получить доступ к интерфейсу, |
- | This doesn' | + | Это ничего не меняет в классе, это только добавляет новые вещи, и поэтому очень маловероятно, что они будут конфликтовать. |
- | + | ||
- | One caveat is that the function signature (name + parameter types) you inject must be unique. So if you use common parameter types, be sure to give it a very unique name. | + | |
+ | Одно предостережение заключается в том, что сигнатура функции (имя + типы параметров), | ||
==== Callback Injectors ==== | ==== Callback Injectors ==== | ||
- | Callback injectors | + | Callback injectors |
- | They also let you intercept and change the return value of a method, and return early. | + | Они также позволяют перехватывать и изменять возвращаемое значение метода, а также возвращать его раньше. |
- | Callback injects can stack, and are therefore unlikely to cause conflicts between mods. | + | Инъекции обратного вызова могут стекаться и поэтому вряд ли вызовут конфликты между модами. |
==== Redirect Injectors ==== | ==== Redirect Injectors ==== | ||
- | Redirects | + | Redirects |
- | Use these very sparingly, a target call or access can only be redirected once between all mods. | + | Используйте их очень экономно, целевой вызов или доступ можно перенаправить только один раз между всеми модами. |
- | If two mods redirect the same value, that will cause a conflict. | + | Если два мода перенаправляют одно и то же значение, это вызовет конфликт. |
- | Consider callback injects first. | + | |
- | ==== Overwrite | + | ==== Перезапись |
- | Avoid overwrites completely. | + | Всегда избегайте перезаписи. |
- | They replace a method entirely, removing all existing code and conflicting with any other types of mixins | + | Они полностью заменяют метод, удаляя весь существующий код и конфликтуя с любыми другими типами |
- | They are extremely likely to conflict not just with other mods, but also with changes to Minecraft | + | Они с большой вероятностью вступят в конфликт не только с другими модами, но и с изменениями в самом |
- | You most likely do not need an overwrite to do what you want to do, please use something else. | + | Скорее всего, вам не нужна перезапись, |
ru/tutorial/introduction.1598185321.txt.gz · Last modified: 2020/08/23 12:22 by magicsweet