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) {
|
for (Block block : xp) {
|
||||||
if (!mcMMO.placeStore.isTrue(block)) {
|
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 player The player to award XP to
|
||||||
* @param block The block to award XP for
|
* @param block The block to award XP for
|
||||||
*/
|
*/
|
||||||
public static void miningXP(Player player, Block block) {
|
protected static void miningXP(Player player, PlayerProfile profile, Block block, Material type) {
|
||||||
PlayerProfile profile = Users.getProfile(player);
|
|
||||||
Material type = block.getType();
|
|
||||||
|
|
||||||
int xp = 0;
|
int xp = 0;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -44,4 +44,8 @@ public class MiningBlockEventHandler {
|
|||||||
Mining.miningDrops(block, blockLocation, blockType);
|
Mining.miningDrops(block, blockLocation, blockType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void processXP() {
|
||||||
|
Mining.miningXP(manager.getPlayer(), manager.getProfile(), block, blockType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,14 +32,14 @@ public class MiningManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mining.miningXP(player, block);
|
MiningBlockEventHandler eventHandler = new MiningBlockEventHandler(this, block);
|
||||||
|
|
||||||
|
eventHandler.processXP();
|
||||||
|
|
||||||
if (!Permissions.miningDoubleDrops(player)) {
|
if (!Permissions.miningDoubleDrops(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MiningBlockEventHandler eventHandler = new MiningBlockEventHandler(this, block);
|
|
||||||
|
|
||||||
int randomChance = 100;
|
int randomChance = 100;
|
||||||
if (Permissions.luckyMining(player)) {
|
if (Permissions.luckyMining(player)) {
|
||||||
randomChance = (int) (randomChance * 0.75);
|
randomChance = (int) (randomChance * 0.75);
|
||||||
@ -63,4 +63,8 @@ public class MiningManager {
|
|||||||
protected Player getPlayer() {
|
protected Player getPlayer() {
|
||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected PlayerProfile getProfile() {
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user