Class TinkersToolHelper
java.lang.Object
com.minecolonies.api.compatibility.tinkers.TinkersToolProxy
com.minecolonies.api.compatibility.tinkers.TinkersToolHelper
Class to check if certain tinkers items serve as weapons for the guards.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckTinkersBroken(@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.doublegetAttackDamage(@NotNull net.minecraft.world.item.ItemStack stack) Calculate the actual attack damage of the tinkers weapon.static doublegetDamage(@NotNull net.minecraft.world.item.ItemStack stack) Calculate the actual attack damage of the tinkers weapon.intgetToolLevel(@NotNull net.minecraft.world.item.ItemStack stack) Calculate the tool level of the stack.static intgetToolLvl(@NotNull net.minecraft.world.item.ItemStack stack) Calculate the tool level of the stack.static booleanisTinkersSword(@NotNull net.minecraft.world.item.ItemStack stack) Check if a certain itemstack is a tinkers weapon.booleanisTinkersTool(@Nullable net.minecraft.world.item.ItemStack stack, EquipmentTypeEntry toolType) Check if a certain item stack is a tinkers tool of the given tool type.booleanisTinkersWeapon(@NotNull net.minecraft.world.item.ItemStack stack) Check if a certain itemstack is a tinkers weapon.
-
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:
isTinkersWeaponin classTinkersToolProxy- 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:
getAttackDamagein classTinkersToolProxy- 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:
getToolLevelin classTinkersToolProxy- 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:
checkTinkersBrokenin classTinkersToolProxy- 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:
isTinkersToolin classTinkersToolProxy- Parameters:
stack- the stack to check for.toolType- the tool type.- Returns:
- true if so.
-