mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-14 11:34:43 +02:00
More mining restructuring.
This commit is contained in:
@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.Users;
|
||||
|
||||
@ -44,13 +45,37 @@ public class MiningManager {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
float chance = (float) (((double) Mining.DOUBLE_DROPS_MAX_CHANCE / Mining.DOUBLE_DROPS_MAX_BONUS_LEVEL) * eventHandler.skillModifier);
|
||||
float chance = ((float) Mining.DOUBLE_DROPS_MAX_CHANCE / Mining.DOUBLE_DROPS_MAX_BONUS_LEVEL) * eventHandler.skillModifier;
|
||||
|
||||
if (chance > Mining.getRandom().nextInt(randomChance)) {
|
||||
eventHandler.processDrops();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the Super Breaker ability.
|
||||
*
|
||||
* @param player The player using the ability
|
||||
* @param block The block being affected
|
||||
*/
|
||||
public void superBreakerBlockCheck(Block block) {
|
||||
if (mcMMO.placeStore.isTrue(block) || Misc.blockBreakSimulate(block, player, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
MiningManager manager = new MiningManager(player);
|
||||
SuperBreakerEventHandler eventHandler = new SuperBreakerEventHandler(manager, block);
|
||||
|
||||
if (eventHandler.tierCheck()) {
|
||||
return;
|
||||
}
|
||||
|
||||
eventHandler.callFakeArmswing();
|
||||
eventHandler.processDurabilityLoss();
|
||||
eventHandler.processDropsAndXP();
|
||||
eventHandler.playSpoutSound();
|
||||
}
|
||||
|
||||
protected int getSkillLevel() {
|
||||
return skillLevel;
|
||||
}
|
||||
|
Reference in New Issue
Block a user