类 TagConventionMappings

java.lang.Object
net.minecraftforge.common.TagConventionMappings

public final class TagConventionMappings extends Object
  • 字段详细资料

    • MAPPINGS

      public static final Map<TagKey<?>,String> MAPPINGS
      A map of known legacy tags to their common convention equivalents.
  • 构造器详细资料

    • TagConventionMappings

      private TagConventionMappings()
  • 方法详细资料

    • legacyToCommon

      private static <T, R> Map.Entry<TagKey<T>,String> legacyToCommon(ResourceKey<Registry<T>> registryKey, ResourceLocation legacyTagResourceLocation, TagKey<R> replacementTag)
      Creates a mapping from a legacy tag to a common convention equivalent.

      Example: legacyToCommon(Registries.BLOCK, forgeRl("cobblestone"), Tags.Blocks.COBBLESTONES) for forge:cobblestone -> c:cobblestones

      参数:
      registryKey - Example:
      引用无效
      net.minecraft.core.registries.Registries.BLOCK
      legacyTagResourceLocation - Example: forgeRl("cobblestone")
      replacementTag - Example: Tags.Blocks.COBBLESTONES
      返回:
      A map entry with the legacy tag's TagKey and the suggested replacement tag ID.
    • legacyToCommon

      private static <T> Map.Entry<TagKey<T>,String> legacyToCommon(ResourceKey<Registry<T>> registryKey, ResourceLocation legacyTagRessourceLocation, List<TagKey<?>> replacementTags)
      Same as legacyToCommon(ResourceKey, ResourceLocation, TagKey) but for multiple replacement tags. This is useful when a single legacy tag is intended to be replaced by combining multiple common convention tags.
    • forgeRl

      private static ResourceLocation forgeRl(String path)