Villagers POI is not invalidated when they teleport through portals
How to reproduce
- Make villager pathfind toward workstation / bed and fall, see picture below
- Make this contraption far away from 0,0 : usually strongholds are far from origin
- Load the end, or overworld
- Spawn some villagers, and remove workstation and replace, move beds, etc.
- Set time to day / night, villagers will try to pathfind toward previous workstation, and cause massive lag, also chunk saving is blocked while they're trying to pathfind.
Video demonstrating the issue: https://www.youtube.com/watch?v=29du1ov38CQ
In Fabric instance (bug itself is vanilla), IO exception is catched as following form:
[03:58:28] [IO-Worker-23/ERROR]: Failed to store chunk [623, 615] java.util.ConcurrentModificationException: null at java.util.HashMap$HashIterator.nextNode(HashMap.java:1597) ~[?:?] at java.util.HashMap$KeyIterator.next(HashMap.java:1620) ~[?:?] at net.minecraft.class_2487.method_10713(class_2487.java:163) ~[client-intermediary.jar:?] at net.minecraft.class_2507.method_10631(class_2507.java:118) ~[client-intermediary.jar:?] at net.minecraft.class_2507.method_10628(class_2507.java:83) ~[client-intermediary.jar:?] at net.minecraft.class_2867.method_23726(class_2867.java:79) ~[client-intermediary.jar:?] at net.minecraft.class_4698.method_23701(class_4698.java:174) ~[client-intermediary.jar:?] at net.minecraft.class_4698.method_23719(class_4698.java:164) ~[client-intermediary.jar:?] at net.minecraft.class_3847$class_3907.run(class_3847.java:59) [client-intermediary.jar:?] at net.minecraft.class_3846.method_16907(class_3846.java:91) [client-intermediary.jar:?] at net.minecraft.class_3846.method_16900(class_3846.java:146) [client-intermediary.jar:?] at net.minecraft.class_3846.run(class_3846.java:102) [client-intermediary.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?] at java.lang.Thread.run(Thread.java:833) [?:?]
With gnembon's carpet mod, mspt is logged as following picture.