Mekanism

Mekanism

111M Downloads

SpongeForge: Flamethrower's flame spawns charcoal after hitting a wood log block even when block break event is cancelled

Aquerr opened this issue ยท 1 comments

commented

Issue description:

Hello Mekanism team!

Firstly, thank you for making this mod! It is awesome! You guys rock!

Secondly, my issue is more like about proper event usage than about functionality issue.

Anyway, I encountered a problem while developing a plugin on SpongeForge.

SpongeAPI lets us use and (if we want) cancel Forge events.

Talking about the real problem:
Normally, flamethrower's flame, when hitting a wood log block, destroys it and spawns a charcoal in its place.
This is fine, but... when BlockBreakEvent is cancelled so that the wood log block is not being destroyed, the charcoal still spawns.

It would be cool if cancelling the BlockBreakEvent could also stop the charcoal from spawning.
At this time, to make charcoal not spawn when BlockBreakEvent is cancelled, one have to catch the charcoal in EntitySpawnEvent and cancel it if needed.
It would be much better if cancelling BlockBreakEvent would stop the rest code (spawning charcoal) from executing.

Steps to reproduce:

  1. Install SpongeForge on the server and a plugin that gives territory protection.
  2. Equip flamethrower and fire on the wood log block that is located inside protected territory.
  3. Watch how block does not break but the charcoal still spawns.

Version (make sure you are on the latest version before reporting):

Forge: 1.12.2-14.23.5.2838
Mekanism: Mekanism-1.12.2-9.8.3.390
Other relevant version: SpongeForge-1.12.2-2838-7.2.3

If a (crash)log is relevant for this issue, link it here: Not relevant this time. ๐Ÿค—

commented

Glancing at the code (at least in the 1.16 version as we are no longer developing for 1.12) it seems like we are not firing any block break events at all for this, and just changing the state of the block. So for now I will leave this issue open mainly as a reminder that we should probably be firing a block break event.