Class StatAnnouncementSystem
java.lang.Object
io.github.thecsdev.betterstats.util.stats.StatAnnouncementSystem
A
For example, mining a diamond ore for the first time.
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic final void
__handleStatChange
(net.minecraft.server.network.ServerPlayerEntity player, net.minecraft.stat.Stat<?> stat, int oldValue, int newValue) AnApiStatus.Internal
method responsible for handlingStat
value changes forServerPlayerEntity
s.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.
-
Field Details
-
FIRST_MINED_BLOCKS
-
FIRST_CRAFTED_ITEMS
-
FIRST_KILLED_ENTITIES
-
FIRST_KILLED_BY_ENTITIES
-
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 AnApiStatus.Internal
method responsible for handlingStat
value changes forServerPlayerEntity
s.- Parameters:
player
- TheServerPlayerEntity
whoseStat
value is changing.stat
- TheStat
in question.oldValue
- The old value of theStat
.newValue
- The new value being assigned to theStat
.- Throws:
NullPointerException
- If an argument isnull
.
-
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
- AServerPlayerEntity
that mined aBlock
for their first time.minedBlock
- TheBlock
they mined for their first time.- Throws:
NullPointerException
- If an argument isnull
.
-
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
- AServerPlayerEntity
that crafted anItem
for their first time.craftedItem
- TheItem
they crafted for their first time.- Throws:
NullPointerException
- If an argument isnull
.
-
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
- AServerPlayerEntity
that killed anEntityType
for their first time.victimType
- TheEntityType
that was killed.- Throws:
NullPointerException
- If an argument isnull
.
-
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
- AServerPlayerEntity
that got killed by anEntityType
for their first time.killerType
- TheEntityType
that killed the player.- Throws:
NullPointerException
- If an argument isnull
.
-
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
- AServerPlayerEntity
that died for their first time.- Throws:
NullPointerException
- If an argument isnull
.
-
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
- TheServerPlayerEntity
whose general/custom stat increased.stat
- The general/customStat
in question.statValue
- The newStat
value.- Throws:
NullPointerException
- If an argument isnull
.
-