Skip to content

Commit

Permalink
fix: crash on client world creation screen
Browse files Browse the repository at this point in the history
  • Loading branch information
RubixDev committed Jul 19, 2023
1 parent ac6a586 commit 1474217
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/de/rubixdev/rug/mixins/LevelStorageMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ public class LevelStorageMixin {
private void storeSession(String directoryName, CallbackInfoReturnable<LevelStorage.Session> cir) {
Storage.session = cir.getReturnValue();
}

@Inject(method = "createSessionWithoutSymlinkCheck", at = @At("RETURN"))
private void storeSessionWithoutSymlinkCheck(
String directoryName, CallbackInfoReturnable<LevelStorage.Session> cir) {
Storage.session = cir.getReturnValue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ private static void loadRugData(
boolean safeMode,
FeatureSet enabledFeatures,
CallbackInfoReturnable<DataConfiguration> cir) {
// if no session exists yet (still in world creation screen), then do nothing
if (Storage.session == null) return;
// make Carpet load the config file early
CarpetServer.settingsManager.attachServer(null);
// initialize `RugData` datapack
Expand Down

0 comments on commit 1474217

Please sign in to comment.