Skip to content

Commit

Permalink
Fix the fix fixing the fixes. Fixes #39, #37, #36, #29.
Browse files Browse the repository at this point in the history
Item damage handled elsewhere. Change axeDamageMode in DT config for more.
Apply stone axe return rate to every stack, not to entire event.
  • Loading branch information
Gaelmare committed Jan 22, 2021
1 parent 67afd83 commit 0f12177
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ public static void onHarvestDrops(BlockEvent.HarvestDropsEvent event)
ItemStack held = player.getHeldItemMainhand();
if (OreDictionaryHelper.doesStackMatchOre(held, "axeStone"))
{
event.setDropChance(((float) ConfigTFC.General.TREE.stoneAxeReturnRate));
for (ItemStack s: event.getDrops())
{
if (OreDictionaryHelper.doesStackMatchOre(s,"logWood"))
{
s.setCount((int) (s.getCount() * ConfigTFC.General.TREE.stoneAxeReturnRate));
//not consolidating partial item stacks on ground
}
}
}
if (!player.isCreative())
held.damageItem(event.getDrops().size(), player);
}
}
}

0 comments on commit 0f12177

Please sign in to comment.