Package net.glowstone.constants
Class AttackDamage
java.lang.Object
net.glowstone.constants.AttackDamage
Map of attack damage values and durability costs for various weapon types, until better item type
support is available.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
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 typecritical
- 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
-