Class BSRegistries
java.lang.Object
io.github.thecsdev.betterstats.api.registry.BSRegistries
BetterStats
registries that are present on both the client and the server side.-
Field Summary
Modifier and TypeFieldDescriptionstatic final Map
<net.minecraft.stat.StatType<net.minecraft.entity.EntityType<?>>, net.minecraft.text.Text> AMap
ofText
s 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. -
Method Summary
Modifier and TypeMethodDescriptionstatic final net.minecraft.text.Text
getEntityStatTypePhrase
(net.minecraft.stat.StatType<net.minecraft.entity.EntityType<?>> statType) Obtains theText
representing the "phrase" for a given entityStatType
.static final @Nullable String
getItemWikiURL
(net.minecraft.util.Identifier itemId) Obtains the "item Wiki" web URL for a givenItem
, usingITEM_WIKIS
.static final @Nullable String
getMobWikiURL
(net.minecraft.util.Identifier entityId) Obtains the "mob Wiki" web URL for a givenEntity
, thanks toMOB_WIKIS
.
-
Field Details
-
ITEM_WIKIS
-
MOB_WIKIS
-
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, ENTITY_STAT_TEXT_FORMATTERnet.minecraft.text.Text>> Deprecated, for removal: This API element is subject to removal in a future version.AMap
ofFunction
s whose purpose is to return formattedText
s for correspondingSUMobStat
s.
The way it works is, theFunction
is given anSUMobStat
that holds information about the stats provider and the stat itself, and theFunction
's job is to obtain the stat value for the correspondingStatType
, and then format it into a user-friendlyText
. -
ENTITY_STAT_PHRASE
public static final Map<net.minecraft.stat.StatType<net.minecraft.entity.EntityType<?>>,net.minecraft.text.Text> ENTITY_STAT_PHRASEAMap
ofText
s 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 givenItem
, usingITEM_WIKIS
.- Parameters:
itemId
- The uniqueIdentifier
of the givenItem
.- 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 givenEntity
, thanks toMOB_WIKIS
.- Parameters:
entityId
- The uniqueIdentifier
of the givenEntity
.- 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 theText
representing the "phrase" for a given entityStatType
.- Parameters:
statType
- TheStatType
.
-