mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Use item in mainhand to get drops when using treefeller (#4781)
This commit is contained in:
parent
fa82fe8e67
commit
aa4011a226
@ -281,6 +281,7 @@ public class WoodcuttingManager extends SkillManager {
|
|||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
int xp = 0;
|
int xp = 0;
|
||||||
int processedLogCount = 0;
|
int processedLogCount = 0;
|
||||||
|
ItemStack itemStack = player.getInventory().getItemInMainHand();
|
||||||
|
|
||||||
for (BlockState blockState : treeFellerBlocks) {
|
for (BlockState blockState : treeFellerBlocks) {
|
||||||
int beforeXP = xp;
|
int beforeXP = xp;
|
||||||
@ -299,7 +300,7 @@ public class WoodcuttingManager extends SkillManager {
|
|||||||
xp += processTreeFellerXPGains(blockState, processedLogCount);
|
xp += processTreeFellerXPGains(blockState, processedLogCount);
|
||||||
|
|
||||||
//Drop displaced block
|
//Drop displaced block
|
||||||
Misc.spawnItemsFromCollection(getPlayer(), Misc.getBlockCenter(blockState), block.getDrops(), ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK);
|
Misc.spawnItemsFromCollection(getPlayer(), Misc.getBlockCenter(blockState), block.getDrops(itemStack), ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK);
|
||||||
|
|
||||||
//Bonus Drops / Harvest lumber checks
|
//Bonus Drops / Harvest lumber checks
|
||||||
processHarvestLumber(blockState);
|
processHarvestLumber(blockState);
|
||||||
@ -307,7 +308,7 @@ public class WoodcuttingManager extends SkillManager {
|
|||||||
//Drop displaced non-woodcutting XP blocks
|
//Drop displaced non-woodcutting XP blocks
|
||||||
|
|
||||||
if(RankUtils.hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD)) {
|
if(RankUtils.hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD)) {
|
||||||
Misc.spawnItemsFromCollection(getPlayer(), Misc.getBlockCenter(blockState), block.getDrops(), ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK);
|
Misc.spawnItemsFromCollection(getPlayer(), Misc.getBlockCenter(blockState), block.getDrops(itemStack), ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK);
|
||||||
|
|
||||||
if(RankUtils.hasReachedRank(2, player, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD)) {
|
if(RankUtils.hasReachedRank(2, player, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD)) {
|
||||||
if(mcMMO.p.getAdvancedConfig().isKnockOnWoodXPOrbEnabled()) {
|
if(mcMMO.p.getAdvancedConfig().isKnockOnWoodXPOrbEnabled()) {
|
||||||
@ -319,7 +320,7 @@ public class WoodcuttingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Misc.spawnItemsFromCollection(getPlayer(), Misc.getBlockCenter(blockState), block.getDrops(), ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK, 1);
|
Misc.spawnItemsFromCollection(getPlayer(), Misc.getBlockCenter(blockState), block.getDrops(itemStack), ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user