Class KillCountWeapon

java.lang.Object
tech.anonymoushacker1279.immersiveweapons.item.KillCountWeapon

public abstract class KillCountWeapon extends Object
A utility class for weapons that have a kill count.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    An enum of weapon name tiers, which are used to determine the level of a weapon based on the amount of kills.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    getKillCount(net.minecraft.world.item.ItemStack stack)
    Get the kill count of an item stack.
    static net.minecraft.network.chat.MutableComponent
    getTierText(net.minecraft.world.item.ItemStack stack)
    Get the tier text for an item stack.
    static net.minecraft.network.chat.MutableComponent
    getTooltipText(net.minecraft.world.item.ItemStack stack)
    Get additional tooltip text (currently containing the total kills).
    static boolean
    hasKillCount(net.minecraft.world.item.ItemStack stack)
    Determine if an item stack has a kill count.
    static void
    incrementKillCount(net.minecraft.world.item.ItemStack stack)
    Increment the kill count of an item stack.
    static net.minecraft.world.item.ItemStack
    initialize(net.minecraft.world.item.ItemStack stack, int amount)
    Make an item stack have a kill count.

    Methods inherited from class java.lang.Object

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

  • 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 - the ItemStack to 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 - the ItemStack to initialize
      amount - 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 - the ItemStack to increment
    • getKillCount

      public static int getKillCount(net.minecraft.world.item.ItemStack stack)
      Get the kill count of an item stack.
      Parameters:
      stack - the ItemStack to 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 - the ItemStack to 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 - the ItemStack to check
      Returns:
      MutableComponent