Minecraftforge: BlockWeb does not implement IShearable

Created on 9 Jan 2017  路  6Comments  路  Source: MinecraftForge/MinecraftForge

Let's take a proper example: BlockVine

Vanilla's shearing logic is patched out in harvestBlock, and IShearable is properly implemented instead via isShearable and onSheared

The same logic is present in BlockWeb but it hasn't been patched with IShearable

Bug help wanted

All 6 comments

A pr is in need, or this will be forgotten soon. @mezz for adding tags.

I've started working on a PR to unify the behaviour of shearable blocks like BlockWeb, but I'm not entirely sure on the desired behaviour.

Should these blocks fire BlockEvent.HarvestDropsEvent with an empty drops list when sheared? BlockVine currently does this, but BlockLeaves doesn't. Shearing the bottom half of BlockDoublePlant fires the event for the bottom half, but shearing the top half fires the event for both halves.

Should this be done where the vanilla shearing logic was (to hopefully reduce patch size) or in a single method like Block#harvestBlock (to make the code more consistent)?

Just imagine writing a mod that uses that event, e.g. to add a piece of coal to the drops when the blocks are sheared, replace the drop with a diamond if they are sheared broken or sheared with a silk-touch tool, add a block of of gold when they are broken with a stick, and remove all drops when they are broken any other way.

the inconsistent event firing should be looked at as a whole in another issue

Is this resolved by 403eda184abb405779a39df2614f2fe992c66d36?

Yep, looks like it. Thanks

Was this page helpful?
0 / 5 - 0 ratings