Skip to content

Commit

Permalink
Refactored paths and added education path (#1081)
Browse files Browse the repository at this point in the history
* Refactored paths and added education path

* Added Education Edition string
  • Loading branch information
gentlegiantJGC authored Aug 6, 2024
1 parent 1ef147d commit 7af4508
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
36 changes: 21 additions & 15 deletions amulet_map_editor/api/wx/ui/select_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,12 @@
# macOS ~/Library/Application Support/minecraft
# Linux ~/.minecraft


def get_java_dir():
if platform == "win32":
return os.path.join(os.getenv("APPDATA"), ".minecraft")
elif platform == "darwin":
return os.path.expanduser("~/Library/Application Support/minecraft")
else:
return os.path.expanduser("~/.minecraft")


def get_java_saves_dir():
return os.path.join(get_java_dir(), "saves")


minecraft_world_paths = {lang.get("world.java_platform"): get_java_saves_dir()}
minecraft_world_paths = {}

if platform == "win32":
minecraft_world_paths[lang.get("world.java_platform")] = os.path.join(
os.getenv("APPDATA"), ".minecraft", "saves"
)
minecraft_world_paths[lang.get("world.bedrock_platform")] = os.path.join(
os.getenv("LOCALAPPDATA"),
"Packages",
Expand All @@ -51,6 +40,23 @@ def get_java_saves_dir():
"com.mojang",
"minecraftWorlds",
)
minecraft_world_paths[lang.get("world.bedrock_education_platform")] = os.path.join(
os.getenv("LOCALAPPDATA"),
"Packages",
"Microsoft.MinecraftEducationEdition_8wekyb3d8bbwe",
"LocalState",
"games",
"com.mojang",
"minecraftWorlds",
)
elif platform == "darwin":
minecraft_world_paths[lang.get("world.java_platform")] = os.path.join(
os.path.expanduser("~"), "Library", "Application Support", "minecraft", "saves"
)
elif platform == "linux":
minecraft_world_paths[lang.get("world.java_platform")] = os.path.join(
os.path.expanduser("~"), ".minecraft", "saves"
)

world_images: Dict[str, Tuple[int, wx.Bitmap, int]] = {}

Expand Down
1 change: 1 addition & 0 deletions amulet_map_editor/lang/en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ app.browser_open_tooltip=Clicking will open the page in your browser

world.java_platform=Java
world.bedrock_platform=Bedrock
world.bedrock_education_platform=Education Edition
world.close_world=Close World

# Menu bar
Expand Down

0 comments on commit 7af4508

Please sign in to comment.