Pass location & type as params, rather than calling inside the function.

This commit is contained in:
gmcferrin
2013-01-08 09:35:41 -05:00
parent 57ff84cd4d
commit 159ec3f04d
4 changed files with 30 additions and 17 deletions

View File

@ -38,17 +38,17 @@ public class MiningManager {
return;
}
MiningDropsBlockHandler blockHandler = new MiningDropsBlockHandler(this, block);
MiningBlockEventHandler eventHandler = new MiningBlockEventHandler(this, block);
int randomChance = 100;
if (Permissions.luckyMining(player)) {
randomChance = (int) (randomChance * 0.75);
}
float chance = (float) (((double) Mining.DOUBLE_DROPS_MAX_CHANCE / Mining.DOUBLE_DROPS_MAX_BONUS_LEVEL) * blockHandler.skillModifier);
float chance = (float) (((double) Mining.DOUBLE_DROPS_MAX_CHANCE / Mining.DOUBLE_DROPS_MAX_BONUS_LEVEL) * eventHandler.skillModifier);
if (chance > Mining.getRandom().nextInt(randomChance)) {
blockHandler.processDrops();
eventHandler.processDrops();
}
}