Amulet-Team / Amulet-Map-Editor

A new Minecraft world editor and converter that supports all versions since Java 1.12 and Bedrock 1.7.
https://www.amuletmc.com/
1.79k stars 123 forks source link

[Bug Report] Residue from deleted chunks #1110

Open clarencesampang opened 1 month ago

clarencesampang commented 1 month ago

Bug Report

Current Behaviour:

Amulet does not completely delete chunks and instead leaves residue data that can be seen in mapping apps like Unmined.

Expected behavior:

Deleting chunks should also delete the data and files of that chunk. And in turn, it should also lower the world's file size and that chunk must be blank, with no residue data, in mapping apps such as Unmined. I believe that was the case before?

Steps To Reproduce:

These are the exact steps I took to recreate this issue.

  1. Created new world, went north to generate chunks
  2. Close Minecraft
  3. Opened in Unmined to Check (see screenshot 001)
  4. Closed Unmined
  5. Opened Amulet and deleted chunks (see screenshot 002)
  6. Closed Amulet
  7. Opened Unmined again; you can see the residue data with the slight 'ghosting' or grey color on a chunk rather than being completely blank like the surrounding chunks that haven't been generated yet. You can also see residue data on the right panel using the Chunk Inspector tool. (see screenshot 003)

Environment:

Additional context

I opened a question on Discord about this issue and I was told to open a bug report. You can find the question here. I've also added the world I tested with below, in the Worlds section.

Attachments

001 002 See 003

Screenshots

See attached files above.

Worlds

OZ6UtOHg4a0=.zip

gentlegiantJGC commented 1 month ago

I have no idea how unmined is displaying that. I am tempted to say it is a bug in unmined.

LevelDB works by adding entries to the database. A deletion doesn't actually delete the data it just adds another entry saying it is deleted. The ghost chunks have been marked as deleted in the database but the data hasn't been removed. Somehow unmined is displaying that data anyway.

This is a photo after unzipping. image

After opening and closing the database with our LevelDB library the chunks are somehow visible again.

from leveldb import LevelDB
db = LevelDB(db_path)
db.close()

image

After running compaction the chunk data is actually deleted from the database and unmined can no longer display it.

from leveldb import LevelDB
db = LevelDB(db_path)
db.compact()
db.close()

image

gentlegiantJGC commented 1 month ago

As far as I can see Amulet and our LevelDB library are working as intended. I would suggest filing a bug with the Unmined developer.

clarencesampang commented 3 weeks ago

Noted. So Amulet's deletion works 100% - correct?

gentlegiantJGC commented 3 weeks ago

As far as I can see yes.