Class TinkersToolHelper

java.lang.Object
com.minecolonies.api.compatibility.tinkers.TinkersToolProxy
com.minecolonies.api.compatibility.tinkers.TinkersToolHelper

public final class TinkersToolHelper extends TinkersToolProxy
Class to check if certain tinkers items serve as weapons for the guards.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkTinkersBroken(@Nullable net.minecraft.world.item.ItemStack stack)
    Checks to see if STACK is a tinker's tool, and if it is, it checks it's NBT tags to see if it's broken.
    double
    getAttackDamage(@NotNull net.minecraft.world.item.ItemStack stack)
    Calculate the actual attack damage of the tinkers weapon.
    static double
    getDamage(@NotNull net.minecraft.world.item.ItemStack stack)
    Calculate the actual attack damage of the tinkers weapon.
    int
    getToolLevel(@NotNull net.minecraft.world.item.ItemStack stack)
    Calculate the tool level of the stack.
    static int
    getToolLvl(@NotNull net.minecraft.world.item.ItemStack stack)
    Calculate the tool level of the stack.
    static boolean
    isTinkersSword(@NotNull net.minecraft.world.item.ItemStack stack)
    Check if a certain itemstack is a tinkers weapon.
    boolean
    isTinkersTool(@Nullable net.minecraft.world.item.ItemStack stack, EquipmentTypeEntry toolType)
    Check if a certain item stack is a tinkers tool of the given tool type.
    boolean
    isTinkersWeapon(@NotNull net.minecraft.world.item.ItemStack stack)
    Check if a certain itemstack is a tinkers weapon.

    Methods inherited from class java.lang.Object

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

    • TinkersToolHelper

      public TinkersToolHelper()
  • Method Details

    • isTinkersSword

      public static boolean isTinkersSword(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Check if a certain itemstack is a tinkers weapon.
      Parameters:
      stack - the stack to check for.
      Returns:
      true if so.
    • isTinkersWeapon

      public boolean isTinkersWeapon(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Check if a certain itemstack is a tinkers weapon.
      Overrides:
      isTinkersWeapon in class TinkersToolProxy
      Parameters:
      stack - the stack to check for.
      Returns:
      true if so.
    • getAttackDamage

      public double getAttackDamage(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Calculate the actual attack damage of the tinkers weapon.
      Overrides:
      getAttackDamage in class TinkersToolProxy
      Parameters:
      stack - the stack.
      Returns:
      the attack damage.
    • getToolLevel

      public int getToolLevel(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Calculate the tool level of the stack.
      Overrides:
      getToolLevel in class TinkersToolProxy
      Parameters:
      stack - the stack.
      Returns:
      the tool level
    • getDamage

      public static double getDamage(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Calculate the actual attack damage of the tinkers weapon.
      Parameters:
      stack - the stack.
      Returns:
      the attack damage.
    • getToolLvl

      public static int getToolLvl(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Calculate the tool level of the stack.
      Parameters:
      stack - the stack.
      Returns:
      the tool level
    • checkTinkersBroken

      public boolean checkTinkersBroken(@Nullable @Nullable net.minecraft.world.item.ItemStack stack)
      Checks to see if STACK is a tinker's tool, and if it is, it checks it's NBT tags to see if it's broken.
      Overrides:
      checkTinkersBroken in class TinkersToolProxy
      Parameters:
      stack - the item in question.
      Returns:
      boolean whether the stack is broken or not.
    • isTinkersTool

      public boolean isTinkersTool(@Nullable @Nullable net.minecraft.world.item.ItemStack stack, EquipmentTypeEntry toolType)
      Check if a certain item stack is a tinkers tool of the given tool type.
      Overrides:
      isTinkersTool in class TinkersToolProxy
      Parameters:
      stack - the stack to check for.
      toolType - the tool type.
      Returns:
      true if so.