codetaylor / pyrotech-1.12

An early game mod with new primitive devices, combustion machines, smelting mechanics, storage options, tools, torches, advancements, and absolutely zero GUIs -- with exception to the substantially complete, mostly illustrated, and charred guidebook.
https://pyrotech.readthedocs.io/en/latest/
Other
52 stars 19 forks source link

Multi-use tools don't drop the right type of items #274

Open belathus opened 4 years ago

belathus commented 4 years ago

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

codetaylor commented 4 years ago

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

codetaylor commented 4 years ago

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.

https://github.com/SleepyTrousers/EnderIO/blob/release/1.12.2/enderio-base/src/main/java/crazypants/enderio/base/item/darksteel/ItemDarkSteelPickaxe.java