Class AttackDamage

java.lang.Object
net.glowstone.constants.AttackDamage

public final class AttackDamage extends Object
Map of attack damage values and durability costs for various weapon types, until better item type support is available.
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    getMeleeDamage(org.bukkit.Material material)
    Gets the damage an item in-hand would cause without added benefits.
    static float
    getMeleeDamage(org.bukkit.Material material, boolean critical)
    Gets the damage an item in-hand would cause without added benefits.
    static short
    getMeleeDurabilityLoss(org.bukkit.Material material)
    Gets the durability loss of the supplied type for a successful hit.

    Methods inherited from class java.lang.Object

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

    • getMeleeDamage

      public static float getMeleeDamage(org.bukkit.Material material)
      Gets the damage an item in-hand would cause without added benefits. This assumes a non-critical attack.
      Parameters:
      material - the item type
      Returns:
      the raw damage caused by that item
    • getMeleeDamage

      public static float getMeleeDamage(org.bukkit.Material material, boolean critical)
      Gets the damage an item in-hand would cause without added benefits.
      Parameters:
      material - the item type
      critical - true if critical damage should be returned
      Returns:
      the raw damage caused by that item
    • getMeleeDurabilityLoss

      public static short getMeleeDurabilityLoss(org.bukkit.Material material)
      Gets the durability loss of the supplied type for a successful hit.
      Parameters:
      material - the item type
      Returns:
      the durability points lost, or 0