Skip to content

Commit 38b14ce

Browse files
committed
Fixed minecraft module to add the correct path on every phone
1 parent 9f2c4fc commit 38b14ce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/modules/module_minecraft.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import 'dart:io' show Directory, File, Platform;
33
import 'package:corecoder_develop/util/modules_manager.dart';
44
import 'package:flutter/material.dart';
55
import 'package:uuid/uuid.dart';
6-
6+
import 'package:android_external_storage/android_external_storage.dart';
7+
import 'package:path_provider/path_provider.dart';
78
class MinecraftModule extends Module {
89
String comMojang = ""; // platform dependent
910

@@ -56,14 +57,14 @@ class MinecraftModule extends Module {
5657
}
5758

5859
@override
59-
void onInitialized(ModulesManager modulesManager, BuildContext buildContext) {
60+
void onInitialized(ModulesManager modulesManager, BuildContext buildContext) async {
6061
if (Platform.isWindows) {
6162
comMojang = Platform.environment['LOCALAPPDATA'] as String;
6263
comMojang +=
6364
"\\Packages\\Microsoft.MinecraftUWP_8wekyb3d8bbwe\\LocalState\\games\\com.mojang\\";
6465
} else if (Platform.isAndroid) {
6566
// comMojang = ExtStorage.getExternalStorageDirectory()
66-
comMojang = "/storage/emulated/0/games/com.mojang/";
67+
comMojang = (await getExternalStorageDirectory())!.path+"/games/com.mojang/";
6768
} else {
6869
comMojang = "UNKNOWN";
6970
}

0 commit comments

Comments
 (0)