This commit is contained in:
nossr50
2023-05-13 14:42:14 -07:00
parent 133a60c4bf
commit db01b61371
11 changed files with 78 additions and 24 deletions

View File

@@ -185,7 +185,7 @@ public class FishingManager extends SkillManager {
return false;
}
return EventUtils.simulateBlockBreak(block, player, false);
return EventUtils.simulateBlockBreak(block, player);
}
/**

View File

@@ -690,7 +690,7 @@ public class HerbalismManager extends SkillManager {
for (HylianTreasure treasure : treasures) {
if (skillLevel >= treasure.getDropLevel()
&& RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(treasure.getDropChance(), getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK))) {
if (!EventUtils.simulateBlockBreak(blockState.getBlock(), player, false)) {
if (!EventUtils.simulateBlockBreak(blockState.getBlock(), player)) {
return false;
}
blockState.setType(Material.AIR);

View File

@@ -111,7 +111,7 @@ public class MiningManager extends SkillManager {
Block targetBlock = player.getTargetBlock(BlockUtils.getTransparentBlocks(), BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
//Blast mining cooldown check needs to be first so the player can be messaged
if (!blastMiningCooldownOver() || targetBlock.getType() != Material.TNT || !EventUtils.simulateBlockBreak(targetBlock, player, true)) {
if (!blastMiningCooldownOver() || targetBlock.getType() != Material.TNT || !EventUtils.simulateBlockBreak(targetBlock, player)) {
return;
}

View File

@@ -1,8 +1,10 @@
package com.gmail.nossr50.skills.woodcutting;
import com.gmail.nossr50.api.FakeBlockBreakEventType;
import com.gmail.nossr50.api.ItemSpawnReason;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
@@ -277,7 +279,7 @@ public class WoodcuttingManager extends SkillManager {
int beforeXP = xp;
Block block = blockState.getBlock();
if (!EventUtils.simulateBlockBreak(block, player, true)) {
if (!EventUtils.simulateBlockBreak(block, player, FakeBlockBreakEventType.TREE_FELLER)) {
continue;
}
@@ -321,7 +323,7 @@ public class WoodcuttingManager extends SkillManager {
processedLogCount = updateProcessedLogCount(xp, processedLogCount, beforeXP);
}
applyXpGain(xp, XPGainReason.PVE);
applyXpGain(xp, XPGainReason.PVE, XPGainSource.SELF);
}
private int updateProcessedLogCount(int xp, int processedLogCount, int beforeXP) {