Skip to content

Commit

Permalink
Fix world unload event invocation and registry entry removal when unl…
Browse files Browse the repository at this point in the history
…oading worlds (#35)

* fix unload event invocation and registry entry removal

* move unload event call after the save to conform to vanilla
  • Loading branch information
LCLPYT authored Dec 7, 2023
1 parent 8e2bd96 commit 6719e00
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/xyz/nucleoid/fantasy/RuntimeWorldManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ public void setTask(Text task) {}
public void progressStagePercentage(int percentage) {}

@Override
public void setDone() {
ServerWorldEvents.UNLOAD.invoker().onWorldUnload(RuntimeWorldManager.this.server, world);

SimpleRegistry<DimensionOptions> dimensionsRegistry = getDimensionsRegistry(RuntimeWorldManager.this.server);
RemoveFromRegistry.remove(dimensionsRegistry, dimensionKey.getValue());
}
public void setDone() {}
}, true, false);

ServerWorldEvents.UNLOAD.invoker().onWorldUnload(RuntimeWorldManager.this.server, world);

SimpleRegistry<DimensionOptions> dimensionsRegistry = getDimensionsRegistry(RuntimeWorldManager.this.server);
RemoveFromRegistry.remove(dimensionsRegistry, dimensionKey.getValue());
}
}

Expand Down

0 comments on commit 6719e00

Please sign in to comment.