mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Reworked abilityDurabilityLoss() to take an int as dmg dealt
This commit is contained in:
parent
07296f14d7
commit
5da59e6f0a
@ -173,7 +173,7 @@ public class Excavation
|
||||
|
||||
public static void gigaDrillBreaker(Player player, Block block)
|
||||
{
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand());
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss);
|
||||
if(block.getData() != (byte)5)
|
||||
{
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
|
@ -177,10 +177,15 @@ public class Mining
|
||||
public static void SuperBreakerBlockCheck(Player player, Block block, mcMMO plugin)
|
||||
{
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand());
|
||||
Material type = block.getType();
|
||||
|
||||
//Obsidian needs to do more damage than normal
|
||||
if(type != Material.OBSIDIAN)
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss);
|
||||
else
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss*5);
|
||||
|
||||
//Pre-processing
|
||||
Material type = block.getType();
|
||||
int xp = 0;
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
|
||||
|
@ -271,15 +271,13 @@ public class Skills
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void abilityDurabilityLoss(ItemStack inhand)
|
||||
public static void abilityDurabilityLoss(ItemStack inhand, int durabilityLoss)
|
||||
{
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!inhand.containsEnchantment(Enchantment.DURABILITY))
|
||||
{
|
||||
short durability = inhand.getDurability();
|
||||
durability += (LoadProperties.abilityDurabilityLoss);
|
||||
inhand.setDurability(durability);
|
||||
inhand.setDurability((short)(inhand.getDurability()+durabilityLoss));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +160,6 @@ public class WoodCutting
|
||||
|
||||
PP.addXP(SkillType.WOODCUTTING, xp, player); //Tree Feller gives nerf'd XP
|
||||
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand());
|
||||
}
|
||||
|
||||
private static boolean treeFellerCompatible(Block block)
|
||||
@ -265,7 +264,7 @@ public class WoodCutting
|
||||
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand());
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss);
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user