mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Make repair & salvage respect the sneaking settings. Fixes #1108
This commit is contained in:
parent
9a5f4b638f
commit
f21fbe2d40
@ -343,6 +343,7 @@ public class PlayerListener implements Listener {
|
|||||||
case RIGHT_CLICK_BLOCK:
|
case RIGHT_CLICK_BLOCK:
|
||||||
int blockID = block.getTypeId();
|
int blockID = block.getTypeId();
|
||||||
|
|
||||||
|
if ((Config.getInstance().getAbilitiesOnlyActivateWhenSneaking() && player.isSneaking()) || !Config.getInstance().getAbilitiesOnlyActivateWhenSneaking()) {
|
||||||
/* REPAIR CHECKS */
|
/* REPAIR CHECKS */
|
||||||
if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) {
|
if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) {
|
||||||
RepairManager repairManager = mcMMOPlayer.getRepairManager();
|
RepairManager repairManager = mcMMOPlayer.getRepairManager();
|
||||||
@ -365,6 +366,7 @@ public class PlayerListener implements Listener {
|
|||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* BLAST MINING CHECK */
|
/* BLAST MINING CHECK */
|
||||||
else if (miningManager.canDetonate()) {
|
else if (miningManager.canDetonate()) {
|
||||||
if (blockID == Material.TNT.getId()) {
|
if (blockID == Material.TNT.getId()) {
|
||||||
@ -380,6 +382,7 @@ public class PlayerListener implements Listener {
|
|||||||
case LEFT_CLICK_BLOCK:
|
case LEFT_CLICK_BLOCK:
|
||||||
blockID = block.getTypeId();
|
blockID = block.getTypeId();
|
||||||
|
|
||||||
|
if ((Config.getInstance().getAbilitiesOnlyActivateWhenSneaking() && player.isSneaking()) || !Config.getInstance().getAbilitiesOnlyActivateWhenSneaking()) {
|
||||||
/* REPAIR CHECKS */
|
/* REPAIR CHECKS */
|
||||||
if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) {
|
if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) {
|
||||||
RepairManager repairManager = mcMMOPlayer.getRepairManager();
|
RepairManager repairManager = mcMMOPlayer.getRepairManager();
|
||||||
@ -400,6 +403,7 @@ public class PlayerListener implements Listener {
|
|||||||
player.sendMessage(LocaleLoader.getString("Skills.Cancelled", LocaleLoader.getString("Salvage.Pretty.Name")));
|
player.sendMessage(LocaleLoader.getString("Skills.Cancelled", LocaleLoader.getString("Salvage.Pretty.Name")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user