User Tools

Site Tools


ru:tutorial:dependency_overrides

Differences

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

Link to this comparison view

Next revision
Previous revision
ru:tutorial:dependency_overrides [2021/01/31 12:25] – created magicsweetru:tutorial:dependency_overrides [2022/03/13 14:28] (current) – external edit 127.0.0.1
Line 8: Line 8:
 ===== Требования ===== ===== Требования =====
   * Загрузчик Fabric ''0.11.1'' или новее   * Загрузчик Fabric ''0.11.1'' или новее
-  * Знание принципа работы с ''fabric.mod.json'' (в т.ч. и с пятью типами зависимостей''depends'', ''recommends'', ''suggests'', ''conflicts'', ''breaks'').+  * Знание принципа работы с ''fabric.mod.json'' и с пятью типами зависимостей (''depends'', ''recommends'', ''suggests'', ''conflicts'', ''breaks'').
  
-===== Для начала =====+===== Начинаем =====
 Для начала создайте файл ''fabric_loader_dependencies.json'' в папке ''config'' (которая находится в папке ''.minecraft''). Для начала создайте файл ''fabric_loader_dependencies.json'' в папке ''config'' (которая находится в папке ''.minecraft'').
  
-После напишите в файл следующее:+Далее напишите в файл следующее:
 <code JavaScript [enable_line_numbers="true"]> <code JavaScript [enable_line_numbers="true"]>
 { {
Line 29: Line 29:
 Второе - ''overrides'' (пока что пусто). Этот Json-объект будет хранить в себе все зависимости от нашего мода. Второе - ''overrides'' (пока что пусто). Этот Json-объект будет хранить в себе все зависимости от нашего мода.
  
-===== Как настроить ===== +===== Как использовать===== 
-Inside the ''overrides'' object, we may add entries with a key of a loaded mod's ID and a value of a Json objectFor exampleif a loaded mod's ID is ''mymod'', We can do the following:+Внутри объекта ''overrides'' мы можем добавлять записи с ключом идентификатора загруженного мода и значением объекта Json. Напримересли идентификатор загруженного мода равен ''mymod'', мы можем сделать следующее:
  
 <code JavaScript [enable_line_numbers="true"]> <code JavaScript [enable_line_numbers="true"]>
Line 41: Line 41:
 </code> </code>
  
-As mentioned above, ''mymod'' has the value of a Json objectInside that object, we can add dependency overrides.+Как упоминалось выше, ''mymod'' имеет значение объекта Json. Внутри этого объекта мы можем добавить подмену зависимостей.
  
-Keys inside the mod object can be one of the dependency types (''depends'', ''recommends'', ''suggests'', ''conflicts'', ''breaks'').+Ключи внутри объекта мода могут быть одним из типов зависимостей (''depends'', ''recommends'', ''suggests'', ''conflicts'', ''breaks'').
  
-The key may be optionally prefixed with ''+'' or ''-'' (e.g. ''"+depends"'', ''"-breaks"'').+Ключ может быть дополнительно снабжен префиксом ''+'' или ''-'' (например - ''"+depends"'', ''"-breaks"'').
  
-The value of any one of those keys must be a Json objectThis Json object follows the exact same structure as a ''fabric.mod.json'' dependency object.+Значение любого из этих ключей должно быть объектом Json. Этот объект Json имеет точно такую же структуру, что и объект зависимости ''fabric.mod.json''.
  
-If the key is prefixed with ''+'', the entries inside that Json object will be added (or overridden if already existto the mod.+Если ключ имеет префикс ''+'', записи внутри этого объекта Json будут добавлены (или подменены, если уже существуютв мод.
  
-If the key is prefixed with ''-'', the value of each entry is ignored completely and Fabric Loader will remove those entries from the resulting dependency map.+Если ключ имеет префикс ''-'', значение каждой записи полностью игнорируется, и Fabric Loader удалит эти записи из финальной карты зависимостей.
  
-If the key isn't prefixedthe dependency object will be replaced completely. **Be careful to prefix your keys!**+Если ключ не имеет префиксаобъект зависимости будет полностью заменен. **Будьте осторожны с префиксом ваших ключей!**
  
-===== Practical Example ===== +===== Практический пример ===== 
-Let's assume that a mod with ID ''specificmod'' depends on Minecraft version ''1.16.4'' **exactly**but we want it to work on other 1.16 versionsLet's see how we can do that:+Давайте предположим, что мод с идентификатором ''specificmod'' зависит **именно** от версии Minecraft ''1.16.4'', но мы хотим, чтобы он работал на других версиях 1.16. Давайте посмотрим, как мы можем это сделать:
  
 <code JavaScript [enable_line_numbers="true"]> <code JavaScript [enable_line_numbers="true"]>
Line 71: Line 71:
 </code> </code>
  
-''"minecraft"'' dependency will now be overridden if specified (and we know it is). There is another way to do this:+Зависимость ''"minecraft"'' теперь будет заменена, если она указана (и мы знаем, что это так). Есть другой способ сделать это:
 <code JavaScript [enable_line_numbers="true"]> <code JavaScript [enable_line_numbers="true"]>
 { {
Line 85: Line 85:
 </code> </code>
  
-As specified abovethe value of key ''"minecraft"'' will be ignored when removing dependenciesIf a dependency with a mod ID requirement of ''minecraft'' is foundit will be removed from our target mod ''specificmod''.+Как указано вышезначение ключа ''"minecraft"'' будет игнорироваться при удалении зависимостейЕсли будет найдена зависимость с требованием идентификатора мода ''minecraft'', она будет удалена из нашего целевого мода ''specificmod''.
  
-We can also override the entire ''depends'' blockbut with great power comes great responsibilityBe careful.+Мы также можем переопределить весь блок ''depends'', но с большой властью приходит большая ответственностьБудь осторожен.
  
-Let's assume that ''specificmod'''s dependency specification (inside ''fabric.mod.json''looks something like this:+Давайте предположим, что спецификация зависимостей ''specificmod'' (внутри ''fabric.mod.json''выглядит примерно так:
 <code JavaScript> <code JavaScript>
 { {
Line 108: Line 108:
 </code> </code>
  
-Aside from changing the ''minecraft'' dependencywe also want to remove all ''suggests'' dependenciesWe can do that like so:+Помимо изменения зависимости ''minecraft'', мы также хотим удалить все зависимости ''suggests''Мы можем сделать это вот так:
  
 <code JavaScript [enable_line_numbers="true"]> <code JavaScript [enable_line_numbers="true"]>
Line 124: Line 124:
 </code> </code>
  
-Because the ''suggests'' key was not prefixedit was completely replaced with an empty objectessentially clearing it.+Поскольку ключ ''suggests'' не имел префиксаон был полностью заменен пустым объектомпо существу очистив его.
ru/tutorial/dependency_overrides.1612095921.txt.gz · Last modified: 2021/01/31 12:25 by magicsweet