numismatic-overhaul icon indicating copy to clipboard operation
numismatic-overhaul copied to clipboard

Freeze when using Yung's Better Ocean Monuments

Open Mirsario opened this issue 2 years ago • 7 comments

This is kind of a reopen of #80 (Cartographer level-up freezes servers), but after both of the suggestions from there failed to help me I found one actual cause that isn't "it takes a long time" or vanilla's fault.

The cause of the freeze for me turned out to be the fact that cartographers were trying to locate the vanilla minecraft:monument structures, which Yung's Better Ocean Monuments removes from generation and replaces with the betteroceanmonuments:ocean_monument structure. If I were to make a guess, it's probably due to Numismatic Overhaul changing the trade type to its own special numismatic-overhaul:sell_map, so the generation mod doesn't recognize it to swap the vanilla structure type to its new one? Though I couldn't find the code for that, so I don't know for sure which side is at fault.

Pinging @yungnickyoung just in case.

Temporary Workaround

Applying the following change in NurismaticOverhaul.jar/data/nurismatic-overhaul/villager_trades/cartographer.json helped me avoid the issue for myself:

      {
        "type": "numismatic-overhaul:sell_map",
        "price": 3000,
-        "structure": "monument",
+        "structure": "betteroceanmonuments:ocean_monument",
        "max_uses": 2,
        "villager_experience": 15
      }

Crash Report

If you want to look at my colossal collection of mixins, which I don't think matters, here it is: crash-2023-07-07_00.09.06-server.txt

Mirsario avatar Jul 07 '23 12:07 Mirsario

How do I do this fix myself? Do I make a datapack?

Ricenami avatar Sep 14 '23 18:09 Ricenami

Yes. Copying and editing the cartographer trades from that location will fix this issue. It is unfortunately not easy to handle, as Better Ocean Monuments creates its own structure rather than replacing the vanilla one. The watchdog crash in question is actually a vanilla crash, which happens when a cartographer map tries to look for a structure for too long. I recommend upping the max-tick-time setting in your server.properties as an attempt to mitigate the issue, or fix it via data.

Noaaan avatar Sep 14 '23 19:09 Noaaan

I appreciate your quick response, as for the server max-tick-time, what amount do you recommend?

Ricenami avatar Sep 14 '23 20:09 Ricenami

I recommend upping the max-tick-time setting in your server.properties as an attempt to mitigate the issue, or fix it via data.

The former can't help without the latter in this conflict's case, as the game's structure locator is for some reason completely fine with spending an actual eternity looking for a non-existing vanilla structure, and seemingly doesn't have its own failure state, with only the tick watchdog there to stop that madness. If someone sets max-tick-time to a year - it'll look for that monument for a year.

Mirsario avatar Sep 14 '23 21:09 Mirsario

I sincerely apologize for commenting here, but if I were to create a data pack with the content mentioned above, would it resolve the issue? I'm not very experienced with this sort of thing, so I just wanted to clarify before proceeding.

leonx132 avatar Feb 28 '25 23:02 leonx132

@leonx132 If you manage to make the same change from the datapack, replacing the shop entry or its structure type, instead of just adding a new one while doing nothing to the old one - then yes, a datapack should also work. I'm only familiar with datapacks being able to either add granular data, or replace the whole file from scratch completely, so you may need to copy whole an edit of the original.

Mirsario avatar Mar 02 '25 09:03 Mirsario

Might be best if the custom trades allow for a structure tag to be used instead of an individual structure. Then myself and other modders can add any custom structures to that tag to prevent this issue from happening.

yungnickyoung avatar Mar 02 '25 22:03 yungnickyoung