User Tools

Site Tools


zh_cn:tutorial:registry_types

This is an old revision of the document!


标准注册表

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

一般注册表

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

  • Registry.REGISTRIES
    • 包含所有的注册表。
  • Registry.BLOCK
  • Registry.ITEM
    • 包含所有的物品(包括方块物品)。
  • 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。

实体

绝大多数这些注册表,除了ENTITY_TYPE自身,都与实体AI有关。

  • Registry.ENTITY_TYPE
    • 包含每个实体的实体类型(EntityType)。类似于方块实体类型,实体类型用于同步和取消序列化。
  • Registry.SCHEDULE
    • 包含实体(通常是村民)的时刻表。时刻表控制实体基于一天内时间的行为。
  • Registry.ACTIVITY
    • 控制实体(通常是村民)的活动。这些活动,比如playwork,控制实体的行为。
  • Registry.SENSOR_TYPE
    • 包含每个实体传感器的类型。传感器允许实体“感受”不同的事物,并将其储存在记忆中。
    • 类似于时刻表和活动,主要用于村民。
  • Registry.MEMORY_MODULE_TYPE
    • 包含所有类型的记忆模块。记忆模块描述了实体能够记住的不同内容。
  • Registry.VILLAGER_TYPE
    • 包含所有村民生物群系类型。
  • Registry.VILLAGER_PROFESSION
    • 包含所有村民职业。
  • Registry.POINT_OF_INTEREST_TYPE
    • 包含所有兴趣点乐行。兴趣点允许实体寻找世界内的不同方块,比如村民工作站点。也用于寻找下界传送门。

世界生成

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.1621511276.txt.gz · Last modified: 2021/05/20 11:47 by solidblock