mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Abilities damage tools again.
Closes MCCORE-30
This commit is contained in:
parent
cb4b5d1c71
commit
89802e23e2
@ -16,6 +16,7 @@ Version 1.3.00-dev
|
||||
+ Added framework for new Blast Mining skill
|
||||
+ Added Fast Food Service subskill to Taming
|
||||
+ Re-added mcMMO reporting damage events
|
||||
= Fixed Super Breaker & Giga Drill Breaker failing to damage tools
|
||||
= Fixed Tree Feller not giving proper XP for different kinds of trees
|
||||
= Fixed Tree Feller conflicting with NoCheat
|
||||
= Fixed memory leak with mob spawner tracking
|
||||
|
@ -28,6 +28,7 @@ import com.gmail.nossr50.datatypes.SkillType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -287,10 +288,22 @@ public class mcBlockListener implements Listener
|
||||
if(LoadProperties.excavationRequiresShovel)
|
||||
{
|
||||
if(m.isShovel(inhand)){
|
||||
|
||||
event.setInstaBreak(true);
|
||||
Excavation.gigaDrillBreaker(player, block);
|
||||
}
|
||||
} else {
|
||||
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
|
||||
{
|
||||
short durability = player.getItemInHand().getDurability();
|
||||
durability += (LoadProperties.abilityDurabilityLoss);
|
||||
player.getItemInHand().setDurability(durability);
|
||||
}
|
||||
}
|
||||
|
||||
event.setInstaBreak(true);
|
||||
Excavation.gigaDrillBreaker(player, block);
|
||||
}
|
||||
@ -323,6 +336,17 @@ public class mcBlockListener implements Listener
|
||||
if(LoadProperties.miningrequirespickaxe)
|
||||
{
|
||||
if(m.isMiningPick(inhand)){
|
||||
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
|
||||
{
|
||||
short durability = player.getItemInHand().getDurability();
|
||||
durability += (LoadProperties.abilityDurabilityLoss);
|
||||
player.getItemInHand().setDurability(durability);
|
||||
}
|
||||
}
|
||||
|
||||
event.setInstaBreak(true);
|
||||
Mining.SuperBreakerBlockCheck(player, block, plugin);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user