User Tools

Site Tools


ru:tutorial:terms

This is an old revision of the document!


Терминология

Перед началом моддинга с помощью Fabric, необходимо понимать некоторые ключевые термины и фразы, используемые на следующих страницах туториала. Так же полезно знать основные соглашения по поводу таких вещей, как package structure и именование modid. Знание этих правил на ранней стадии поможет Вам лучше понимать туториалы и позволит при необходимости задавать лучшие вопросы.

Mod ID

В документации, иногда мы будем ссылается на Mod ID или modid в коде. Mod ID расшифровывается как Идентификатор мода. Это строка должна однозначно определять Ваш мод. Mod ID часто связаны с пространством имён с таким же именем, и, следовательно, теми же ограничениями. Mod ID могут содержать только символы нижнего регистра a-z, числа 0-9, и символы _-, при этом их должно быть не менее двух. К примеру, Minecraft использует пространство имён minecraft.

Mod ID часто является сокращённой версией имени мода, которое делает его коротким, но узнаваемым и предотвращает конфликты имён. Обычно, проект с названием “My Project–” должен быть myproject, my_project, или, в некоторых случаях, my-project так же работает, но иногда это может быть неудобно. Этот мод будет регистрировать предметы и блоеи используя это Mod ID как регистрационное пространство имён.

Some of the starter tutorials will use a placeholder mod ID and register items and blocks under a placeholder namespace, and you can think of it as a starter template– while leaving this unchanged is not dangerous for testing, remember to change it if you intend to release your project.

Tags

Tags are groups of blocks, items, or fluids with similar properties, i.e. minecraft:saplings contains all of the game's saplings. Information about what to call tags for your mod can be found here.

Read more on what tags are on the Minecraft Wiki

Entry Points and Initializers

Fabric Loader use fabric.mod.json to detect and load your mod.

A mod usually contains at least one initializer class which should implement one of ModInitializer, ClientInitializer and ServerInitializer. The interfaces are all in the net.fabricmc.api package. In order to change or add initializers, you need to edit fabric.mod.json and find entrypoints block, then edit them accordingly. main block is for Mod Initializers, client block is for Client Mod Initializers and server block is for Server Mod Initializers.

{
  [...]
  "entrypoints": {
    "main": [
      "net.fabricmc.ExampleMod"
    ],
    "client": [
      "net.fabricmc.ExampleClientMod"
    ]
  }
  [...]
}

By implementing Mod Initializer interfaces, you must implement an onInitializing() (or onInitializeClient() for Client, onInitializeServer() for Server) function. You can then write your codes there.

Also, there is a block called initializers.

Maven Group & Package Names

According to Oracle's Java documentation, they are written in all lower case to avoid conflict with the names of classes or interfaces. The reverse of your domain name is used to start the names. Read more at https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html.

ru/tutorial/terms.1628622119.txt.gz · Last modified: 2021/08/10 19:01 by vlad_cool