Skip to content

Commit 8199d70

Browse files
uecasmsomeaddons
andauthored
Fix wrong thread used after reloading world (#11704)
* Fix wrong thread used after reloading world * Sync callback if possible --------- Co-authored-by: someaddons <38401808+someaddons@users.noreply.github.com>
1 parent 850ddda commit 8199d70

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/com/minecolonies/core/colony/workorders/AbstractWorkOrder.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,14 @@ public String getStructurePack()
421421
@Override
422422
public void loadBlueprint(final Level world, final Consumer<Blueprint> afterLoad)
423423
{
424-
loadBlueprintFuture(world).thenAccept(afterLoad);
424+
if (blueprint != null)
425+
{
426+
afterLoad.accept(blueprint);
427+
}
428+
else
429+
{
430+
loadBlueprintFuture(world).thenAcceptAsync(afterLoad, WorldUtil.getMainThread(world));
431+
}
425432
}
426433

427434
@Override

0 commit comments

Comments
 (0)