mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 08:39:49 +01:00
More mining restructuring.
This commit is contained in:
parent
159ec3f04d
commit
aee4bcd65e
@ -178,7 +178,7 @@ public class BlastMining {
|
||||
|
||||
for (Block block : xp) {
|
||||
if (!mcMMO.placeStore.isTrue(block)) {
|
||||
Mining.miningXP(player, block);
|
||||
Mining.miningXP(player, Users.getProfile(player), block, block.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,10 +38,7 @@ public class Mining {
|
||||
* @param player The player to award XP to
|
||||
* @param block The block to award XP for
|
||||
*/
|
||||
public static void miningXP(Player player, Block block) {
|
||||
PlayerProfile profile = Users.getProfile(player);
|
||||
Material type = block.getType();
|
||||
|
||||
protected static void miningXP(Player player, PlayerProfile profile, Block block, Material type) {
|
||||
int xp = 0;
|
||||
|
||||
switch (type) {
|
||||
|
@ -44,4 +44,8 @@ public class MiningBlockEventHandler {
|
||||
Mining.miningDrops(block, blockLocation, blockType);
|
||||
}
|
||||
}
|
||||
|
||||
protected void processXP() {
|
||||
Mining.miningXP(manager.getPlayer(), manager.getProfile(), block, blockType);
|
||||
}
|
||||
}
|
||||
|
@ -32,14 +32,14 @@ public class MiningManager {
|
||||
return;
|
||||
}
|
||||
|
||||
Mining.miningXP(player, block);
|
||||
MiningBlockEventHandler eventHandler = new MiningBlockEventHandler(this, block);
|
||||
|
||||
eventHandler.processXP();
|
||||
|
||||
if (!Permissions.miningDoubleDrops(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
MiningBlockEventHandler eventHandler = new MiningBlockEventHandler(this, block);
|
||||
|
||||
int randomChance = 100;
|
||||
if (Permissions.luckyMining(player)) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
@ -63,4 +63,8 @@ public class MiningManager {
|
||||
protected Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
protected PlayerProfile getProfile() {
|
||||
return profile;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user