mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-02 04:25:26 +02:00
Moving the center of block drops to block center. Fixes #2544.
This commit is contained in:
@@ -51,7 +51,7 @@ public class Mining {
|
||||
|
||||
case GLOWING_REDSTONE_ORE:
|
||||
if (Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, Material.REDSTONE_ORE)) {
|
||||
Misc.dropItem(blockState.getLocation(), new ItemStack(Material.REDSTONE_ORE));
|
||||
Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(Material.REDSTONE_ORE));
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -65,12 +65,12 @@ public class Mining {
|
||||
case REDSTONE_ORE:
|
||||
case STONE:
|
||||
case PRISMARINE:
|
||||
Misc.dropItem(blockState.getLocation(), blockState.getData().toItemStack(1));
|
||||
Misc.dropItem(Misc.getBlockCenter(blockState), blockState.getData().toItemStack(1));
|
||||
return;
|
||||
|
||||
default:
|
||||
if (mcMMO.getModManager().isCustomMiningBlock(blockState)) {
|
||||
Misc.dropItem(blockState.getLocation(), blockState.getData().toItemStack(1));
|
||||
Misc.dropItem(Misc.getBlockCenter(blockState), blockState.getData().toItemStack(1));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -101,18 +101,18 @@ public class Mining {
|
||||
case STAINED_CLAY:
|
||||
case STONE:
|
||||
case QUARTZ_ORE:
|
||||
Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
|
||||
return;
|
||||
|
||||
case GLOWING_REDSTONE_ORE:
|
||||
if (Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, Material.REDSTONE_ORE)) {
|
||||
Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
if (mcMMO.getModManager().isCustomMiningBlock(blockState)) {
|
||||
Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@@ -148,7 +148,7 @@ public class MiningManager extends SkillManager {
|
||||
xp += Mining.getBlockXp(blockState);
|
||||
}
|
||||
|
||||
Misc.dropItem(blockState.getLocation(), blockState.getData().toItemStack(1)); // Initial block that would have been dropped
|
||||
Misc.dropItem(Misc.getBlockCenter(blockState), blockState.getData().toItemStack(1)); // Initial block that would have been dropped
|
||||
|
||||
if (!mcMMO.getPlaceStore().isTrue(blockState)) {
|
||||
for (int i = 1; i < dropMultiplier; i++) {
|
||||
@@ -161,7 +161,7 @@ public class MiningManager extends SkillManager {
|
||||
if (debrisYield > 0) {
|
||||
for (BlockState blockState : debris) {
|
||||
if (Misc.getRandom().nextFloat() < debrisYield) {
|
||||
Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user