Class RAMStatsProvider

java.lang.Object
io.github.thecsdev.betterstats.api.util.io.RAMStatsProvider
All Implemented Interfaces:
IEditableStatsProvider, IStatsProvider

public final class RAMStatsProvider extends Object implements IEditableStatsProvider
An IEditableStatsProvider whose statistics are loaded into and held in the memory (aka RAM), hence the name RAMStatsProvider.
  • Field Details

    • displayName

      @Nullable protected @Nullable net.minecraft.text.Text displayName
    • gameProfile

      @Nullable protected @Nullable com.mojang.authlib.GameProfile gameProfile
    • statMap

      protected final it.unimi.dsi.fastutil.objects.Object2IntMap<net.minecraft.stat.Stat<?>> statMap
    • playerBadgeStatMap

      protected final it.unimi.dsi.fastutil.objects.Object2IntMap<net.minecraft.util.Identifier> playerBadgeStatMap
  • Constructor Details

  • Method Details

    • getDisplayName

      public final net.minecraft.text.Text getDisplayName()
      Description copied from interface: IStatsProvider
      Returns a "visual"/"user friendly" display Text that will be shown on the GUI screen as an indicator as to who the stats belong to.
      Specified by:
      getDisplayName in interface IStatsProvider
    • setDisplayName

      public final void setDisplayName(net.minecraft.text.Text displayName)
      Description copied from interface: IEditableStatsProvider
      Specified by:
      setDisplayName in interface IEditableStatsProvider
      Parameters:
      displayName - The new "display name" for this IStatsProvider.
    • getGameProfile

      public final com.mojang.authlib.GameProfile getGameProfile()
      Description copied from interface: IStatsProvider
      Returns the GameProfile of the player these stats belong to, or null if these stats are not associated with a player.
      Specified by:
      getGameProfile in interface IStatsProvider
    • setGameProfile

      public final void setGameProfile(@Nullable @Nullable com.mojang.authlib.GameProfile playerProfile)
      Description copied from interface: IEditableStatsProvider
      Specified by:
      setGameProfile in interface IEditableStatsProvider
      Parameters:
      playerProfile - The new GameProfile value for this IStatsProvider.
    • getStatValue

      public final int getStatValue(net.minecraft.stat.Stat<?> stat)
      Description copied from interface: IStatsProvider
      Returns the Integer value of a given Stat.
      Specified by:
      getStatValue in interface IStatsProvider
      Parameters:
      stat - The Stat whose value is to be obtained.
      See Also:
      • StatHandler
    • setStatValue

      public final void setStatValue(net.minecraft.stat.Stat<?> stat, int value) throws NullPointerException
      Description copied from interface: IEditableStatsProvider
      Sets the value of a given Stat.
      Specified by:
      setStatValue in interface IEditableStatsProvider
      Parameters:
      stat - The Stat whose value is to be changed.
      value - The new Stat value.
      Throws:
      NullPointerException
    • getPlayerBadgeValue

      public final int getPlayerBadgeValue(net.minecraft.util.Identifier badgeId)
      Description copied from interface: IStatsProvider
      Returns the Integer value of a given PlayerBadge stat.
      Specified by:
      getPlayerBadgeValue in interface IStatsProvider
      Parameters:
      badgeId - The unique Identifier of the PlayerBadge.
    • setPlayerBadgeValue

      public final void setPlayerBadgeValue(net.minecraft.util.Identifier badgeId, int value) throws NullPointerException
      Description copied from interface: IEditableStatsProvider
      Sets the Integer value of a given PlayerBadge stat.
      Specified by:
      setPlayerBadgeValue in interface IEditableStatsProvider
      Parameters:
      badgeId - The unique Identifier of the PlayerBadge.
      value - The new Integer value.
      Throws:
      NullPointerException
    • getStatMap

      public final it.unimi.dsi.fastutil.objects.Object2IntMap<net.minecraft.stat.Stat<?>> getStatMap()
    • getPlayerBadgeStatMap

      public final it.unimi.dsi.fastutil.objects.Object2IntMap<net.minecraft.util.Identifier> getPlayerBadgeStatMap()