Class KillCountWeapon
java.lang.Object
tech.anonymoushacker1279.immersiveweapons.item.KillCountWeapon
A utility class for weapons 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. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetKillCount(net.minecraft.world.item.ItemStack stack) Get the kill count of an item stack.static net.minecraft.network.chat.MutableComponentgetTierText(net.minecraft.world.item.ItemStack stack) Get the tier text for an item stack.static net.minecraft.network.chat.MutableComponentgetTooltipText(net.minecraft.world.item.ItemStack stack) Get additional tooltip text (currently containing the total kills).static booleanhasKillCount(net.minecraft.world.item.ItemStack stack) Determine if an item stack has a kill count.static voidincrementKillCount(net.minecraft.world.item.ItemStack stack) Increment the kill count of an item stack.static net.minecraft.world.item.ItemStackinitialize(net.minecraft.world.item.ItemStack stack, int amount) Make an item stack have a kill count.
-
Field Details
-
KILL_COUNT_TAG
- See Also:
-
TIER_TAG
- See Also:
-
-
Constructor Details
-
KillCountWeapon
public KillCountWeapon()
-
-
Method Details
-
hasKillCount
public static boolean hasKillCount(net.minecraft.world.item.ItemStack stack) Determine if an item stack has a kill count.- Parameters:
stack- theItemStackto check- Returns:
- boolean
-
initialize
public static net.minecraft.world.item.ItemStack initialize(net.minecraft.world.item.ItemStack stack, int amount) Make an item stack have a kill count.- Parameters:
stack- theItemStackto initializeamount- the amount of kills to begin with
-
incrementKillCount
public static void incrementKillCount(net.minecraft.world.item.ItemStack stack) Increment the kill count of an item stack. Will also check for prefix updates.- Parameters:
stack- theItemStackto increment
-
getKillCount
public static int getKillCount(net.minecraft.world.item.ItemStack stack) Get the kill count of an item stack.- Parameters:
stack- theItemStackto check- Returns:
- int
-
getTooltipText
public static net.minecraft.network.chat.MutableComponent getTooltipText(net.minecraft.world.item.ItemStack stack) Get additional tooltip text (currently containing the total kills).- Parameters:
stack- theItemStackto check- Returns:
- MutableComponent
-
getTierText
public static net.minecraft.network.chat.MutableComponent getTierText(net.minecraft.world.item.ItemStack stack) Get the tier text for an item stack.- Parameters:
stack- theItemStackto check- Returns:
- MutableComponent
-