Override stack sensitive isCorrectToolForDrops so it's aware of the current power

This commit is contained in:
Mrbysco 2024-03-09 00:03:51 +01:00
parent a622e497b3
commit ed8ea0e616

View file

@ -278,6 +278,11 @@ public class DrillItem extends ItemEnergy {
: HARVEST_LEVEL >= 2));
}*/
@Override
public boolean isCorrectToolForDrops(ItemStack stack, BlockState state) {
return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) && super.isCorrectToolForDrops(stack, state);
}
// @Override
// public int getHarvestLevel(ItemStack stack, ToolType p_getHarvestLevel_2_, @Nullable Player p_getHarvestLevel_3_, @Nullable BlockState p_getHarvestLevel_4_) {
// return HARVEST_LEVEL;