Class StatAnnouncementSystem

java.lang.Object
io.github.thecsdev.betterstats.util.stats.StatAnnouncementSystem

@Experimental @Internal public final class StatAnnouncementSystem extends Object
A Class that handles announcing players doing things for the first time in the current world.
For example, mining a diamond ore for the first time.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final HashSet<net.minecraft.item.Item>
     
    static final HashSet<net.minecraft.util.Identifier>
     
    static final HashSet<net.minecraft.entity.EntityType<?>>
     
    static final HashSet<net.minecraft.entity.EntityType<?>>
     
    static final HashSet<net.minecraft.block.Block>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final void
    __handleStatChange(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.stat.Stat<?> stat, int oldValue, int newValue)
    An ApiStatus.Internal method responsible for handling Stat value changes for ServerPlayerEntitys.
    static final void
    broadcastFirstCraft(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.item.Item craftedItem)
    Broadcasts a "first crafted" event to all players in the server.
    static final void
    broadcastFirstCustomStat(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.stat.Stat<net.minecraft.util.Identifier> stat, String statValue)
    Broadcasts a player increasing the value of a "custom stat" for their first time.
    static final void
    broadcastFirstDeath(net.minecraft.server.network.ServerPlayerEntity player)
    Broadcasts a "first death" event to all players in the server.
    static final void
    broadcastFirstKilled(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.entity.EntityType<?> victimType)
    Broadcasts a "first killed" event to all players in the server.
    static final void
    broadcastFirstKilledBy(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.entity.EntityType<?> killerType)
    Broadcasts a "first killed by" event to all players in the server.
    static final void
    broadcastFirstMine(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.block.Block minedBlock)
    Broadcasts a "first mined" event to all players in the server.

    Methods inherited from class java.lang.Object

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

    • FIRST_MINED_BLOCKS

      public static final HashSet<net.minecraft.block.Block> FIRST_MINED_BLOCKS
    • FIRST_CRAFTED_ITEMS

      public static final HashSet<net.minecraft.item.Item> FIRST_CRAFTED_ITEMS
    • FIRST_KILLED_ENTITIES

      public static final HashSet<net.minecraft.entity.EntityType<?>> FIRST_KILLED_ENTITIES
    • FIRST_KILLED_BY_ENTITIES

      public static final HashSet<net.minecraft.entity.EntityType<?>> FIRST_KILLED_BY_ENTITIES
    • FIRST_CUSTOM_STATS

      public static final HashSet<net.minecraft.util.Identifier> FIRST_CUSTOM_STATS
  • Method Details

    • __handleStatChange

      @Internal public static final void __handleStatChange(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.stat.Stat<?> stat, int oldValue, int newValue) throws NullPointerException
      An ApiStatus.Internal method responsible for handling Stat value changes for ServerPlayerEntitys.
      Parameters:
      player - The ServerPlayerEntity whose Stat value is changing.
      stat - The Stat in question.
      oldValue - The old value of the Stat.
      newValue - The new value being assigned to the Stat.
      Throws:
      NullPointerException - If an argument is null.
    • broadcastFirstMine

      public static final void broadcastFirstMine(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.block.Block minedBlock) throws NullPointerException
      Broadcasts a "first mined" event to all players in the server.
      Parameters:
      player - A ServerPlayerEntity that mined a Block for their first time.
      minedBlock - The Block they mined for their first time.
      Throws:
      NullPointerException - If an argument is null.
    • broadcastFirstCraft

      public static final void broadcastFirstCraft(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.item.Item craftedItem) throws NullPointerException
      Broadcasts a "first crafted" event to all players in the server.
      Parameters:
      player - A ServerPlayerEntity that crafted an Item for their first time.
      craftedItem - The Item they crafted for their first time.
      Throws:
      NullPointerException - If an argument is null.
    • broadcastFirstKilled

      public static final void broadcastFirstKilled(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.entity.EntityType<?> victimType)
      Broadcasts a "first killed" event to all players in the server.
      Parameters:
      player - A ServerPlayerEntity that killed an EntityType for their first time.
      victimType - The EntityType that was killed.
      Throws:
      NullPointerException - If an argument is null.
    • broadcastFirstKilledBy

      public static final void broadcastFirstKilledBy(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.entity.EntityType<?> killerType)
      Broadcasts a "first killed by" event to all players in the server.
      Parameters:
      player - A ServerPlayerEntity that got killed by an EntityType for their first time.
      killerType - The EntityType that killed the player.
      Throws:
      NullPointerException - If an argument is null.
    • broadcastFirstDeath

      public static final void broadcastFirstDeath(net.minecraft.server.network.ServerPlayerEntity player)
      Broadcasts a "first death" event to all players in the server.
      Parameters:
      player - A ServerPlayerEntity that died for their first time.
      Throws:
      NullPointerException - If an argument is null.
    • broadcastFirstCustomStat

      public static final void broadcastFirstCustomStat(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.stat.Stat<net.minecraft.util.Identifier> stat, String statValue) throws NullPointerException
      Broadcasts a player increasing the value of a "custom stat" for their first time.
      Parameters:
      player - The ServerPlayerEntity whose general/custom stat increased.
      stat - The general/custom Stat in question.
      statValue - The new Stat value.
      Throws:
      NullPointerException - If an argument is null.