MineColonies

MineColonies

53M Downloads

[BUG] No XP Study delay in Library under certain conditions

mrlamb opened this issue ยท 0 comments

commented

Is there an existing issue for this?

  • I have searched the existing issues

Are you using the latest MineColonies Verison?

  • I am running the latest alpha version of MineColonies for my Minecraft version.

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

  • 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.

Minecraft Version

1.19.2

MineColonies Version

1.0.1283-ALPHA

Structurize Version

1.0.483-ALPHA

Related Mods and their Versions

No response

Current Behavior

I asked in the discord about this because I am NOT actually using the current version as I play on a server and didn't want to inconvenience my fellow players, however when diving into the code I found the problem (possibly) in the main branch and wanted to bring it to someone's attention.
image

I noticed that my library workers would just pace back and forth from the bookshelf to the hut block never stopping. Later I had a new worker who was just standing at the bookshelf and I heard the page turning sound I hadn't heard before.

This got me intrigued because the bookshelf guy was gaining xp at a much slower rate then the rest of my colony had.
The only difference I could see was that the slow guy had books and paper. I gave books and paper to the other guy and he started doing the same thing. When I took them away he went for his rapid pacing again.

Upon diving in to the code I found the section for the study AI and I believe I've found the solution.

I'm never done a contribution before and when I clicked "make pull request" it said to submit an issue first so here it is. The fix is just moving one line which I show here on my forked repo:
mrlamb@ebd1b13

Essentially the study method awards the xp, looks if the library has any study items, moves to the hut and then returns the function without ever grabbing the items, so the loop just keeps happening for rapid xp gain.

Expected Behavior

I expect library workers to stand around at the bookshelf for STUDY_DELAY time before doing another pass.

Reproduction Steps

  1. Build Library
  2. Assign Workers
  3. Place study items in the hut inventory
  4. manually give study items to one guy
  5. (for most consistent reproduction) give some non study item to second guy
  6. after a short time second guy will start running back and forth getting level up after level up

Logs

https://gist.github.com/mrlamb/e0d8a67c24587a61f96b934b4b59cc1c

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.