Tabnine Logo
ToolCore.hasCategory
Code IndexAdd Tabnine to your IDE (free)

How to use
hasCategory
method
in
slimeknights.tconstruct.library.tools.ToolCore

Best Java code snippets using slimeknights.tconstruct.library.tools.ToolCore.hasCategory (Showing top 5 results out of 315)

origin: SlimeKnights/TinkersConstruct

@Override
protected boolean canApplyCustom(ItemStack stack) throws TinkerGuiException {
 return !((ToolCore) stack.getItem()).hasCategory(Category.NO_MELEE);
}
origin: SlimeKnights/TinkersConstruct

/**
 * Called when an entity is getting damaged with the tool.
 * Reduce the tools durability accordingly
 * player can be null!
 */
public void reduceDurabilityOnHit(ItemStack stack, EntityPlayer player, float damage) {
 damage = Math.max(1f, damage / 10f);
 if(!hasCategory(Category.WEAPON)) {
  damage *= 2;
 }
 ToolHelper.damageTool(stack, (int) damage, player);
}
origin: SlimeKnights/TinkersConstruct

public List<String> getInformation(ItemStack stack, boolean detailed) {
 TooltipBuilder info = new TooltipBuilder(stack);
 info.addDurability(!detailed);
 if(hasCategory(Category.HARVEST)) {
  info.addHarvestLevel();
  info.addMiningSpeed();
 }
 if(hasCategory(Category.LAUNCHER)) {
  info.addDrawSpeed();
  info.addRange();
  info.addProjectileBonusDamage();
 }
 info.addAttack();
 if(ToolHelper.getFreeModifiers(stack) > 0) {
  info.addFreeModifiers();
 }
 if(detailed) {
  info.addModifierInfo();
 }
 return info.getTooltip();
}
origin: SlimeKnights/TinkersConstruct

return hasCategory(Category.TOOL);
origin: SquidDev-CC/plethora

if (tool.hasCategory(Category.HARVEST)) {
  out.put("miningSpeed", ToolHelper.getActualMiningSpeed(stack));
slimeknights.tconstruct.library.toolsToolCorehasCategory

Popular methods of ToolCore

  • getRequiredComponents
  • addCategory
  • addDefaultSubItems
  • afterBlockBreak
  • attackSpeed
    Allows you set the base attack speed, can be changed by modifiers. Equivalent to the vanilla attack
  • breakBlock
    Called to break the base block, return false to perform no breaking
  • breakExtraBlock
    Called when an AOE block is broken by the tool. Use to oveerride the block breaking logic
  • buildItem
  • buildItemForRendering
  • buildItemForRenderingInGui
  • buildItemFromStacks
  • damageCutoff
    A fixed damage value where the calculations start to apply dimishing returns. Basically if you'd hit
  • buildItemFromStacks,
  • damageCutoff,
  • damagePotential,
  • dealDamage,
  • getBrokenTooltip,
  • getDamage,
  • getHarvestLevel,
  • getIdentifier,
  • getInfiTool

Popular in Java

  • Running tasks concurrently on multiple threads
  • getContentResolver (Context)
  • findViewById (Activity)
  • putExtra (Intent)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ImageIO (javax.imageio)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now