Class KillCountWeapon
java.lang.Object
tech.anonymoushacker1279.immersiveweapons.item.KillCountWeapon
A utility class for items that have a kill count.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum of weapon name tiers, which are used to determine the level of a weapon based on the amount of kills. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.network.chat.MutableComponentgetKillComponent(net.minecraft.world.item.ItemStack stack) Get the kill count component of an item.static net.minecraft.network.chat.MutableComponentgetTierComponent(net.minecraft.world.item.ItemStack stack) Get the tier component of an item.static net.minecraft.network.chat.MutableComponentGet the tier component of an item.static booleanhasKillCount(net.minecraft.world.item.ItemStack stack) Check if an item has a kill count.static voidincrement(net.minecraft.world.item.ItemStack stack) Increment the kill count of an item.static voidinitialize(net.minecraft.world.item.ItemStack stack) Initialize an item with a kill count.
-
Constructor Details
-
KillCountWeapon
public KillCountWeapon()
-
-
Method Details
-
initialize
public static void initialize(net.minecraft.world.item.ItemStack stack) Initialize an item with a kill count.- Parameters:
stack- theItemStackto initialize
-
hasKillCount
public static boolean hasKillCount(net.minecraft.world.item.ItemStack stack) Check if an item has a kill count.- Parameters:
stack- theItemStackto check- Returns:
- boolean
-
increment
public static void increment(net.minecraft.world.item.ItemStack stack) Increment the kill count of an item. Will also check for prefix updates.- Parameters:
stack- theItemStackto increment
-
getTierComponent
public static net.minecraft.network.chat.MutableComponent getTierComponent(net.minecraft.world.item.ItemStack stack) Get the tier component of an item.- Parameters:
stack- theItemStackto check- Returns:
- MutableComponent
-
getTierComponent
public static net.minecraft.network.chat.MutableComponent getTierComponent(KillCountWeapon.WeaponTier tier) Get the tier component of an item.- Parameters:
tier- theWeaponTierto check- Returns:
- MutableComponent
-
getKillComponent
public static net.minecraft.network.chat.MutableComponent getKillComponent(net.minecraft.world.item.ItemStack stack) Get the kill count component of an item.- Parameters:
stack- theItemStackto check- Returns:
- MutableComponent
-