sk89q/worldedit — comment on commit dbc3053195006768fa0eefcc18bc971587ea2a87
File:  line 0
By TomyLobo:

if usesDamageValue then new item(type, data) else new item(type, 0)

of course there would be one or the other special case, but without this function available, this would be one giant special case.