mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Some patches (#4494)
Fixed blocks being dropped from blast mining even if yield was set to 0. Tree feller not working entirely if one fake block break event is cancelled. (Fixes #4189) Fixes no woodcutting xp being rewarded if a tree is too big while using tree feller.
This commit is contained in:
parent
04459f1ea7
commit
7393421607
@ -941,6 +941,10 @@ public class McMMOPlayer implements Identified {
|
|||||||
//Sounds
|
//Sounds
|
||||||
SoundManager.worldSendSound(player.getWorld(), player.getLocation(), SoundType.ABILITY_ACTIVATED_GENERIC);
|
SoundManager.worldSendSound(player.getWorld(), player.getLocation(), SoundType.ABILITY_ACTIVATED_GENERIC);
|
||||||
|
|
||||||
|
//If the current item is still buffed somehow, remove it to prevent enchantments from stacking.
|
||||||
|
if (superAbilityType == SuperAbilityType.SUPER_BREAKER || superAbilityType == SuperAbilityType.GIGA_DRILL_BREAKER)
|
||||||
|
SkillUtils.removeAbilityBuff(player.getInventory().getItemInMainHand());
|
||||||
|
|
||||||
// Enable the ability
|
// Enable the ability
|
||||||
profile.setAbilityDATS(superAbilityType, System.currentTimeMillis() + (ticks * Misc.TIME_CONVERSION_FACTOR));
|
profile.setAbilityDATS(superAbilityType, System.currentTimeMillis() + (ticks * Misc.TIME_CONVERSION_FACTOR));
|
||||||
setAbilityMode(superAbilityType, true);
|
setAbilityMode(superAbilityType, true);
|
||||||
|
@ -157,8 +157,10 @@ public class MiningManager extends SkillManager {
|
|||||||
//TODO: Rewrite this garbage
|
//TODO: Rewrite this garbage
|
||||||
//TODO: Rewrite this garbage
|
//TODO: Rewrite this garbage
|
||||||
public void blastMiningDropProcessing(float yield, EntityExplodeEvent event) {
|
public void blastMiningDropProcessing(float yield, EntityExplodeEvent event) {
|
||||||
//Strip out only stuff that gives mining XP
|
if (yield == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Strip out only stuff that gives mining XP
|
||||||
List<BlockState> ores = new ArrayList<>();
|
List<BlockState> ores = new ArrayList<>();
|
||||||
|
|
||||||
List<BlockState> notOres = new ArrayList<>();
|
List<BlockState> notOres = new ArrayList<>();
|
||||||
|
@ -107,6 +107,11 @@ public class WoodcuttingManager extends SkillManager {
|
|||||||
treeFellerReachedThreshold = false;
|
treeFellerReachedThreshold = false;
|
||||||
|
|
||||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Woodcutting.Skills.TreeFeller.Threshold");
|
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Woodcutting.Skills.TreeFeller.Threshold");
|
||||||
|
|
||||||
|
//Tree feller won't be activated for this block, award normal xp.
|
||||||
|
processWoodcuttingBlockXP(blockState);
|
||||||
|
processHarvestLumber(blockState);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,7 +287,7 @@ public class WoodcuttingManager extends SkillManager {
|
|||||||
Block block = blockState.getBlock();
|
Block block = blockState.getBlock();
|
||||||
|
|
||||||
if (!EventUtils.simulateBlockBreak(block, player, true)) {
|
if (!EventUtils.simulateBlockBreak(block, player, true)) {
|
||||||
break; // TODO: Shouldn't we use continue instead?
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user