Class BSRegistries

java.lang.Object
io.github.thecsdev.betterstats.api.registry.BSRegistries

public final class BSRegistries extends Object
BetterStats registries that are present on both the client and the server side.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Map<net.minecraft.stat.StatType<net.minecraft.entity.EntityType<?>>,net.minecraft.text.Text>
    A Map of Texts representing "phrases" for each entity stat type.
    For example:
    - Stats.KILLED becomes "Killed"
    - Stats.KILLED_BY becomes "Died to"
    - and so on...
    static final Map<net.minecraft.stat.StatType<net.minecraft.entity.EntityType<?>>,Function<SUMobStat,net.minecraft.text.Text>>
    Deprecated, for removal: This API element is subject to removal in a future version.
    static final Map<String,Function<net.minecraft.util.Identifier,String>>
    A Map of mod IDs and Functions that act as suppliers for item Wiki URLs for the given mods.

    The keys represent mod IDs.
    The values represent Functions that return the Wiki URL for a given item from that mod.
    static final Map<String,Function<net.minecraft.util.Identifier,String>>
    A Map of mod IDs and Functions that act as suppliers for mob/entity Wiki URLs for the given mods.

    The keys represent mod IDs.
    The values represent Functions that return the Wiki URL for a given mob/entity from that mod.
  • Method Summary

    Modifier and Type
    Method
    Description
    static final net.minecraft.text.Text
    getEntityStatTypePhrase(net.minecraft.stat.StatType<net.minecraft.entity.EntityType<?>> statType)
    Obtains the Text representing the "phrase" for a given entity StatType.
    static final @Nullable String
    getItemWikiURL(net.minecraft.util.Identifier itemId)
    Obtains the "item Wiki" web URL for a given Item, using ITEM_WIKIS.
    static final @Nullable String
    getMobWikiURL(net.minecraft.util.Identifier entityId)
    Obtains the "mob Wiki" web URL for a given Entity, thanks to MOB_WIKIS.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ITEM_WIKIS

      public static final Map<String,Function<net.minecraft.util.Identifier,String>> ITEM_WIKIS
      A Map of mod IDs and Functions that act as suppliers for item Wiki URLs for the given mods.

      The keys represent mod IDs.
      The values represent Functions that return the Wiki URL for a given item from that mod.
    • MOB_WIKIS

      public static final Map<String,Function<net.minecraft.util.Identifier,String>> MOB_WIKIS
      A Map of mod IDs and Functions that act as suppliers for mob/entity Wiki URLs for the given mods.

      The keys represent mod IDs.
      The values represent Functions that return the Wiki URL for a given mob/entity from that mod.
    • ENTITY_STAT_TEXT_FORMATTER

      @Deprecated(since="3.9.1", forRemoval=true) public static final Map<net.minecraft.stat.StatType<net.minecraft.entity.EntityType<?>>,Function<SUMobStat,net.minecraft.text.Text>> ENTITY_STAT_TEXT_FORMATTER
      Deprecated, for removal: This API element is subject to removal in a future version.
      A Map of Functions whose purpose is to return formatted Texts for corresponding SUMobStats.
      The way it works is, the Function is given an SUMobStat that holds information about the stats provider and the stat itself, and the Function's job is to obtain the stat value for the corresponding StatType, and then format it into a user-friendly Text.
    • ENTITY_STAT_PHRASE

      public static final Map<net.minecraft.stat.StatType<net.minecraft.entity.EntityType<?>>,net.minecraft.text.Text> ENTITY_STAT_PHRASE
      A Map of Texts representing "phrases" for each entity stat type.
      For example:
      - Stats.KILLED becomes "Killed"
      - Stats.KILLED_BY becomes "Died to"
      - and so on...
  • Method Details

    • getItemWikiURL

      @Nullable public static final @Nullable String getItemWikiURL(net.minecraft.util.Identifier itemId) throws NullPointerException
      Obtains the "item Wiki" web URL for a given Item, using ITEM_WIKIS.
      Parameters:
      itemId - The unique Identifier of the given Item.
      Returns:
      null if the URL is not found.
      Throws:
      NullPointerException - If the argument is null.
    • getMobWikiURL

      @Nullable public static final @Nullable String getMobWikiURL(net.minecraft.util.Identifier entityId) throws NullPointerException
      Obtains the "mob Wiki" web URL for a given Entity, thanks to MOB_WIKIS.
      Parameters:
      entityId - The unique Identifier of the given Entity.
      Returns:
      null if the URL is not found.
      Throws:
      NullPointerException - If the argument is null.
    • getEntityStatTypePhrase

      public static final net.minecraft.text.Text getEntityStatTypePhrase(net.minecraft.stat.StatType<net.minecraft.entity.EntityType<?>> statType)
      Obtains the Text representing the "phrase" for a given entity StatType.
      Parameters:
      statType - The StatType.