Biomes O' Plenty

Biomes O' Plenty

151M Downloads

Scythe breaks original position before expected, causing crash.

williewillus opened this issue ยท 5 comments

commented

Issue Description:

Because of a quirk in how the scythes work, they can cause crashes in other mod's blocks.

Steps to reproduce:

  1. Get Botania 314
  2. Get BOP 2052
  3. Place a botania pure daisy and break it with a scythe directly (not indirectly)

Technical Description:

When, I break a block with BOP scythe in hand these things happen, in order.

  1. Play particles and sound
  2. Call Item.onBlockDestroyed
  3. Call Block.removedByPlayer, which spawns drops via onBlockHarvested, getDrops, that whole process and sets the pos to air in-world
  4. Call Block.onBlockDestroyedByPlayer (irrelevant to issue, here for completeness)

I have custom logic in removedByPlayer/getDrops that drops items based on the Tile Entity of my block (Botania magic flowers).
The problem is, the scythe has already run trimming logic in the original blockpos, overwriting my block with air and removing the TE before the block expects it to be gone. removedByPlayer essentially expects the block to still be in place in the world. It tries to get the TE and crashes. This crash will occur for any block that the scythe trims, that also has harvest logic based on the TE.

1.9 vs 1.10 shouldn't matter for this bug.


Affected Versions (Exact numbers, do not use "latest"):

  • Biomes O' Plenty: 2052
  • Minecraft: 1.10.2
  • Forge: 2041
commented

I can't help with the BOP side, but I want to say thank you for the excellent description, because you've just helped me fix a bug in my mod. :D

commented

I am mostly sure, you can reproduce this with BOP alone by making the scythe "trim" vanilla flower pots (put something in the flower pot to be sure)

then dig the pot directly as described above

commented

I just attempted it with a flowerpot filled with a vanilla Poppy and got no crash when I broke it with a Scythe

commented

@Carrots4U I meant if the BOP devs changed the scythe to run its "trim" on flower pots it would crash the same way

commented

any news on this?