Class KillCountWeapon

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

public class KillCountWeapon extends Object
A utility class for items 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 number of kills.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.network.chat.MutableComponent
    getKillComponent(net.minecraft.world.item.ItemStack stack)
    Get the kill count component of an item.
    static net.minecraft.network.chat.MutableComponent
    getTierComponent(net.minecraft.world.item.ItemStack stack)
    Get the tier component of an item.
    static net.minecraft.network.chat.MutableComponent
    Get the tier component of an item.
    static boolean
    hasKillCount(net.minecraft.world.item.ItemStack stack)
    Check if an item has a kill count.
    static void
    increment(net.minecraft.world.item.ItemStack stack)
    Increment the kill count of an item.
    static void
    initialize(net.minecraft.world.item.ItemStack stack)
    Initialize an item with a kill count.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 - the ItemStack to initialize
    • hasKillCount

      public static boolean hasKillCount(net.minecraft.world.item.ItemStack stack)
      Check if an item has a kill count.
      Parameters:
      stack - the ItemStack to 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 - the ItemStack to 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 - the ItemStack to check
      Returns:
      MutableComponent
    • getTierComponent

      public static net.minecraft.network.chat.MutableComponent getTierComponent(KillCountWeapon.WeaponTier tier)
      Get the tier component of an item.
      Parameters:
      tier - the WeaponTier to 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 - the ItemStack to check
      Returns:
      MutableComponent