mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 02:04:44 +02:00
Berserk now breaks a soft block if it was used to activate it
This commit is contained in:
@ -849,7 +849,6 @@ public class McMMOPlayer {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//TODO: This is hacky and temporary solution until skills are move to the new system
|
||||
//Potential problems with this include skills with two super abilities (ie mining)
|
||||
if(!skill.isSuperAbilityUnlocked(getPlayer()))
|
||||
|
@ -512,8 +512,23 @@ public class BlockListener implements Listener {
|
||||
else if (mcMMOPlayer.getToolPreparationMode(ToolType.SHOVEL) && ItemUtils.isShovel(heldItem) && BlockUtils.affectedByGigaDrillBreaker(blockState) && Permissions.gigaDrillBreaker(player)) {
|
||||
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.EXCAVATION);
|
||||
}
|
||||
else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || BlockUtils.affectedByBlockCracker(blockState) && Permissions.berserk(player))) {
|
||||
else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (BlockUtils.affectedByGigaDrillBreaker(blockState)
|
||||
|| mcMMO.getMaterialMapStore().isGlass(blockState.getType())
|
||||
|| blockState.getType() == Material.SNOW
|
||||
|| BlockUtils.affectedByBlockCracker(blockState) && Permissions.berserk(player))) {
|
||||
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.UNARMED);
|
||||
|
||||
if(mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK)) {
|
||||
if (SuperAbilityType.BERSERK.blockCheck(blockState) && EventUtils.simulateBlockBreak(blockState.getBlock(), player, true)) {
|
||||
event.setInstaBreak(true);
|
||||
|
||||
if(blockState.getType().getKey().getKey().contains("glass")) {
|
||||
SoundManager.worldSendSound(player.getWorld(), blockState.getLocation(), SoundType.GLASS);
|
||||
} else {
|
||||
SoundManager.sendSound(player, blockState.getLocation(), SoundType.POP);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -593,10 +608,10 @@ public class BlockListener implements Listener {
|
||||
blockState.update();
|
||||
}
|
||||
}
|
||||
else if (SuperAbilityType.BERSERK.blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true)) {
|
||||
else if (!event.getInstaBreak() && SuperAbilityType.BERSERK.blockCheck(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
|
||||
event.setInstaBreak(true);
|
||||
|
||||
if(block.getState().getType().getKey().getKey().contains("glass")) {
|
||||
if(blockState.getType().getKey().getKey().contains("glass")) {
|
||||
SoundManager.worldSendSound(player.getWorld(), block.getLocation(), SoundType.GLASS);
|
||||
} else {
|
||||
SoundManager.sendSound(player, block.getLocation(), SoundType.POP);
|
||||
|
Reference in New Issue
Block a user