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

GTCE pickaxe and shovel not dropping correct items when breaking blocks #279

Open Rarity1 opened 4 years ago

Rarity1 commented 4 years ago

Issue Description

GregtechCE tools do not properly count as their material's corresponding harvesting level.

What Happens

Using Gregtech pickaxes all of the item drops are exactly the same regardless of mining level. The same is also true for Gregtech shovels.

What You Expect to Happen

The tools should definitely have different item drops. A Gregtech Brass pickaxe should drop low tier items when mining stone and a Gregtech Darmstadtium pickaxe should drop high tier items.

Affected Versions

codetaylor commented 4 years ago

GTCE MetaTool doesn't properly implement Item#getToolClasses. Similar to #274

codetaylor commented 4 years ago

image

https://paste.dimdev.org/ecuxiyabid.mccrash

codetaylor commented 4 years ago

Because GTCE overrides a method that accepts null values, then explicitly throws an exception if there is a null value.

    public int getHarvestLevel(ItemStack stack, String toolClass, @Nullable EntityPlayer player, @Nullable IBlockState blockState)

https://github.com/GregTechCE/GregTech/blob/master/src/main/java/gregtech/api/items/toolitem/ToolMetaItem.java#L254