Multi-use tools don't drop the right type of items
belathus opened this issue ยท 2 comments
Issue Description
Using a tool that counts as multiple types, such as EnderIO's dark pick with the spoon upgrade (which should make it act like a shovel) drops dirt clumps and rocks when mining dirt and gravel.
I've tested this with Mekanism's atomic disassembler and Erebus's jade paxel with similar results. Even though these tools should have a high enough mining level to get the better drops. Interestingly, the atomic disassembler didn't count as any type of tool apparently, and only returned the worst drops. Same with the jade paxel. The dark pick at least behaved like a pick.
What Happens
Mine dirt with a non-shovel that can supposedly mine dirt and get clumps rather than a block.
What You Expect to Happen
I expected these tools to behave as shovels, pickaxes, etc. when dropping items -- in that I got their full block rather than clumps and rocks.
Script
N/A
Crash Log
N/A
Affected Versions
- Minecraft: 1.12.2
- Forge: 14.23.5.2847
- CraftTweaker: 4.1.20
- Dropt: 1.16.1
- Pyrotech: 1.4.19
- Athenaeum: 1.17.4
Pyrotech uses Dropt to manage all of the modified drops.
This is occurring because those tools don't properly override and implement Item#getToolClasses(ItemStack)
which should return all of the tool's classes.
https://github.com/vadis365/TheErebus/blob/mc1.12/src/main/java/erebus/items/ItemPaxel.java
https://github.com/mekanism/Mekanism/blob/master/src/main/java/mekanism/common/item/gear/ItemAtomicDisassembler.java
EnderIO's dark pick with the spoon upgrade (which should make it act like a shovel) drops dirt clumps and rocks when mining dirt and gravel.
It looks like the Dark Steel Pickaxe from EnderIO does handle the Item#getToolClasses
method properly, but doesn't properly override and implement Item#getHarvestLevel
. Since it subclasses the ItemPickaxe
, when queried for the harvest level of a shovel, it returns -1
.