Skip to content

Commit

Permalink
Added a warning about marketplace worlds (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlegiantJGC committed Jun 23, 2021
1 parent 4d30d9f commit 9b16ac3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions amulet/level/formats/leveldb_world/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,20 @@ def _reload_world(self):
(-30_000_000, 0, -30_000_000), (30_000_000, 256, 30_000_000)
)
)
except OSError as e:
self._is_open = self._has_lock = False
raise LevelDBException(
"It looks like this world is from the marketplace.\nThese worlds are encrypted and cannot be edited."
) from e
except LevelDBException as e:
msg = str(e)
self._is_open = self._has_lock = False
# I don't know if there is a better way of handling this.
self._is_open = False
self._has_lock = False
if msg.startswith("IO error:") and msg.endswith(": Permission denied"):
traceback.print_exc()
raise LevelDBException(
f"Failed to load the database. The world may be open somewhere else.\n{msg}"
)
) from e
else:
raise e

Expand Down

0 comments on commit 9b16ac3

Please sign in to comment.