minecolonies icon indicating copy to clipboard operation
minecolonies copied to clipboard

[BUG] Beekeeper AI will crash upon trying to read honey level from non beehive

Open Thodor12 opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Are you using the latest MineColonies Version?

  • [X] I am running the latest beta version of MineColonies for my Minecraft version.

Did you check on the Wiki? or ask on Discord?

  • [X] I checked the MineColonies Wiki and made sure my issue is not covered there. Or I was sent from discord to open an issue here.

What were you playing at the time? Were you able to reproduce it in both settings?

  • [X] Single Player
  • [ ] Multi Player

Minecraft Version

1.20.1

MineColonies Version

1.20.1-1.1.593-BETA

Structurize Version

1.20.1-1.0.737-BETA

Related Mods and their Versions

No response

Current Behavior

The Beekeeper is somehow able to read the honey level from non beehive blocks, causing a crash

Expected Behavior

The Beekeeper should first check if the block is a beehive, before attempting to read a property that does not exist.

Reproduction Steps

None were provided by the OP, but a good guess:

  • Place an apiary
  • Tag beehives with the hive tool
  • Destroy one of the beehives by hand
  • Crash should appear upon the next cycle of the AI

Logs

https://mclo.gs/y1GLSJ9

Anything else?

  • Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
  • Add a comment if you have any insights or background information that isn't already part of the conversation.

Thodor12 avatar Jun 18 '24 19:06 Thodor12

I attempted to reproduce this in 1.21 (MineColonies 1.1.978) and could not. The AI handled my replacement of hives gracefully. With a code review of EntityAIWorkBeekeeper.decideWhatToDo() I see that there is a check of the block instance that removes a hive block from the set of configured hives if it is not a BeehiveBlock.

I suggest this could probably be closed.

armele avatar Jun 07 '25 19:06 armele