User Tools

Site Tools


zh_cn:tutorial:registry_types

This is an old revision of the document!


标准注册表

Minecraft拥有多种内容的注册表,比如方块、物品和实体的注册表。以下为原版注册表:

一般注册表

这些注册表对很多类型的模组都有用:

  • Registry.REGISTRIES
    • 包含所有的注册表。
  • Registry.BLOCK
  • Registry.ITEM
    • 包含所有的items(包括方块物品)。
  • Registry.BLOCK_ENTITY_TYPE
    • 包含每个方块实体BlockEntityType。Block entity types are used to deserialize block entities and store compatible blocks.
  • Registry.STATUS_EFFECT
  • Registry.PARTICLE_TYPE
  • Registry.FLUID
  • Registry.ENCHANTMENT
    • 包含所有的附魔。
  • Registry.POTION
    • 包含所有不同的药水类型,比如“long potion of night vision”“water”或“potion of luck”。
  • Registry.DIMENSION_TYPE
    • 包含所有的维度类型。
  • Registry.SCREEN_HANDLER
    • 包含所有的屏幕处理器 screen handlers)。屏幕处理器用于在服务器和客户端之间同步GUI(用户界面)状态。
  • Registry.RECIPE_TYPE
    • 包含所有的配方类型。
  • Registry.RECIPE_SERIALIZER
    • Contains all recipe serializers. Recipe serializers are used to load recipes, and there can be many serializers for a single type (such as both shaped and shapeless crafting recipes).
  • Registry.PAINTING_MOTIVE
    • Contains all painting motives, or the different types of paintings.
  • Registry.SOUND_EVENT
  • Registry.STAT
    • 包含所有不同的统计类型。统计使用通用类型,<T>,用于获取不同T值的不同数据。
      • 不依赖于外部内容的统计,如walk_one_cm,使用custom统计类型,它使用注册的Identifier作为T类型。
      • 不属于custom统计的统计可能依赖于特定的方块或者物品类型,如Stats.MINED
  • Registry.CUSTOM_STAT
    • 包含所有的“自定义统计”,即不依赖于外部内容的统计ID。

实体

Most of these registries, apart from ENTITY_TYPE itself, are related to entity AI.

  • Registry.ENTITY_TYPE
    • Contains the EntityType of each entity. Like block entity types, entity types are used for syncing and deserialization.
  • Registry.SCHEDULE
    • Contains schedules for entities (usually villagers). Schedules control their activities based on the time of day.
  • Registry.ACTIVITY
    • Controls activities for entities (usually villagers). Activities, such as play or work, control the behavior of entities.
  • Registry.SENSOR_TYPE
    • Contains the type of each entity sensor. Sensors allow entities to “sense” different things and store them in their memory.
    • Like schedules and activities, this is mostly used by villagers.
  • Registry.MEMORY_MODULE_TYPE
    • Contains all types of memory modules. Memory module types describe different things entities can remember.
  • Registry.VILLAGER_TYPE
    • Contains all villager biome types.
  • Registry.VILLAGER_PROFESSION
    • Contains all villager professions.
  • Registry.POINT_OF_INTEREST_TYPE
    • Contains all types of points of interest. Points of interest allow entities to search for different blocks in the world, such as villager job sites. They are also used to locate nether portals.

世界生成

World generation in Minecraft is complex, and there are a lot of different registries for world gen.

  • Registry.BIOME
  • Registry.FEATURE
  • Registry.STRUCTURE_FEATURE
  • Registry.CARVER
    • Contains all carvers. Carvers are used to create caves and ravines.
  • Registry.DECORATOR
    • Contains all decorators. Decorators are used to place features.
  • Registry.BIOME_SOURCE_TYPE
    • Contains all biome source types. They determine which biome is placed where during world generation.
  • Registry.TREE_DECORATOR_TYPE
    • Contains all tree decorator types. Tree decorators can add additional blocks, such as beehives or vines, to trees.
  • Registry.FOLIAGE_PLACER_TYPE
    • Contains all foliage placer types. Foliage placers are used to generate the leaves of trees.
  • Registry.BLOCK_STATE_PROVIDER_TYPE
    • Contains all block state provider types. They are used to select a possibly random block state based on a position.
  • Registry.BLOCK_PLACER_TYPE
    • Contains all block placer types. Block placers are used to place blocks in features like RandomPatchFeature.
  • Registry.CHUNK_GENERATOR_TYPE
    • Contains all chunk generator types. Chunk generators define the basic shape of the terrain, such as surface for overworld-like, caves for nether-like and floating_islands for end-like terrain.
  • Registry.CHUNK_STATUS
    • Contains all chunk status types. They describe the current progress of world generation in a chunk.
  • Registry.STRUCTURE_PIECE
    • Contains all structure piece types. Structure pieces are smaller parts of a structure, such as a single room.
  • Registry.RULE_TEST
    • Contains all rule test types. They are used to match blocks in structure generation.
  • Registry.STRUCTURE_PROCESSOR
    • Contains all structure processor types. Structure processors modify structures after they have been generated.
  • Registry.STRUCTURE_POOL_ELEMENT
    • Contains all structure pool elements. Structure pool elements are even smaller parts of structures, and they are contained within pool structure pieces. They are used for generating structures that are based on datapacks (such as structures using jigsaws).
  • Registry.SURFACE_BUILDER
    • Contains all surface builders. Surface builders are used to place the surface blocks of a biome, such as grass in many overworld biomes.
zh_cn/tutorial/registry_types.1605243861.txt.gz · Last modified: 2020/11/13 05:04 by solidblock