mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-06 15:44:45 +02:00
Moving the center of block drops to block center. Fixes #2544.
This commit is contained in:
src/main/java/com/gmail/nossr50
listeners
skills
excavation
herbalism
mining
smelting
woodcutting
util
@ -72,7 +72,7 @@ public final class Woodcutting {
|
||||
*/
|
||||
protected static void checkForDoubleDrop(BlockState blockState) {
|
||||
if (mcMMO.getModManager().isCustomLog(blockState) && mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) {
|
||||
Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
|
||||
}
|
||||
else {
|
||||
//TODO Remove this workaround when casting to Tree works again
|
||||
@ -91,7 +91,7 @@ public final class Woodcutting {
|
||||
}
|
||||
|
||||
if (Config.getInstance().getWoodcuttingDoubleDropsEnabled(species)) {
|
||||
Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class WoodcuttingManager extends SkillManager {
|
||||
|
||||
if (material == Material.HUGE_MUSHROOM_1 || material == Material.HUGE_MUSHROOM_2) {
|
||||
xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER);
|
||||
Misc.dropItems(blockState.getLocation(), block.getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
|
||||
}
|
||||
else if (mcMMO.getModManager().isCustomLog(blockState)) {
|
||||
if (canGetDoubleDrops()) {
|
||||
@ -135,10 +135,10 @@ public class WoodcuttingManager extends SkillManager {
|
||||
CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState);
|
||||
xp = customBlock.getXpGain();
|
||||
|
||||
Misc.dropItems(blockState.getLocation(), block.getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
|
||||
}
|
||||
else if (mcMMO.getModManager().isCustomLeaf(blockState)) {
|
||||
Misc.dropItems(blockState.getLocation(), block.getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
|
||||
}
|
||||
else {
|
||||
//TODO Remove this workaround when casting to Tree works again
|
||||
@ -154,12 +154,12 @@ public class WoodcuttingManager extends SkillManager {
|
||||
Woodcutting.checkForDoubleDrop(blockState);
|
||||
}
|
||||
xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER);
|
||||
Misc.dropItems(blockState.getLocation(), block.getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
|
||||
break;
|
||||
|
||||
case LEAVES:
|
||||
case LEAVES_2:
|
||||
Misc.dropItems(blockState.getLocation(), block.getDrops());
|
||||
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Reference in New Issue
Block a user