TeamLapen / Vampirism

A Minecraft mod called Vampirism
https://vampirism.dev
Other
190 stars 56 forks source link

[Bug]: Vampire Expert causes massive lag after changing trades #1131

Closed Einhornyordle closed 1 year ago

Einhornyordle commented 1 year ago

Minecraft Version

1.18.x

Forge Version

43.1.32

Vampirism Version

1.8.0

Modpack

No response

Singleplayer/Multiplayer

Singleplayer

What happened?

First of all, this bug occurred in 1.19.2, the Minecraft Version dropdown element had no 1.19+ option so I chose the latest version available which was 1.18.x

When you open the trade gui of a vampire expert villager for the first time after it changed its trades there is a chance for it to cause massive lag that freezes the world (blocks won't drop, GUIs won't open, Entities will freeze completly in place but you can move freely until the game catches up) for multiple seconds, sometimes even more than a minute. My personal guess why this happens would be a bugged/impossible trade option.

Relevant log output

Sadly there is nothing relevant in the log. Only the lag message itself which states:
[Server thread/WARN]: Can't keep up! Is the server overloaded? Running 104929ms or 2098 ticks behind

Reproduce steps

0.1. Use a singleplayer creative world with cheats enabled to make it easier to reproduce this issue. 0.2. You can also install the Easy Villagers mod to force new trades with the click of a button to save time with steps 4 to 6.

  1. Load the creative singleplayer world mentioned above.
  2. Use the locate command to find a village.
  3. Use the vampirism-test command to capture the village in the name of the vampire faction if it isn't already.
  4. Find the Vampire Expert villager or wait for an unemployed village to become one.
  5. Right click the villager to open the trade gui.
  6. If you are (un-)lucky, the game will now lag massively for a few seconds/minutes, else just kill the villager and repeat from step 4 or wait for it to switch to a new set of trades (if you installed Easy Villagers there should be a button in the trade GUI to cycle through the possible trades manually).

Other relevant mods

No response

maxanier commented 1 year ago

Oh, forgot to respond. I tried to reproduce this a while ago, but did not succeed. Today I gave it another attempt, and I was able to reproduce it.