MinedMap icon indicating copy to clipboard operation
MinedMap copied to clipboard

Text not appearing in signs

Open Bradshaw opened this issue 1 year ago • 3 comments

Versions tested

Minedmap:

Minecraft: itzg/minecraft-server docker image running Minecraft 1.20.1 "Paper"

Issue

Signs all appear empty. Image

The entities.json file is generated with all of the signs, but none of them have the front_text field, despite their other metadata being present and correct (coordinates, kind, material).

One of the signs from the entities.json file, formatted with jq:

    {
      "x": 358,
      "y": 64,
      "z": 227,
      "type": "sign",
      "kind": "sign",
      "material": "spruce"
    }

Manually editing entities.json to insert a correctly-formatted front-text field will display the manually-added text in the viewer. Edited entities.json:

    {
      "x": 358,
      "y": 64,
      "z": 227,
      "type": "sign",
      "kind": "sign",
      "material": "spruce",
      "front_text": [
        [{"text": "hello", "color": "black"}],
        [{"text": "world", "color": "black"}],
        [{"text": "manually", "color": "black"}],
        [{"text": "edited", "color": "black"}]
      ]
    },

Result: Image

This implies that the issue is not with the viewer, but instead that MinedMap isn't correctly extracting the sign entity data from the Minecraft world.

I know some Rust and am willing to help fix this issue, but I'm not familiar with this codebase, so I'd appreciate some advice and pointers to track down the problem.

Bradshaw avatar Apr 01 '25 10:04 Bradshaw

Hmm, there are a few things to check. First of all, what is the command line passed to minedmap?

The text not appearing might mean that the "Paper" mod changes the way sign text is stored. The minedmap-nbt crate has an example regiondump that will dump a region file (.mca extension) in a human-readable format. Look for minecraft:sign or maybe minecraft:standing_sign in the output and add the relevant section to this ticket.

The whole structure is deserialized using serde into the structs defined in https://github.com/neocturne/MinedMap/blob/main/src/world/de.rs - here, BlockEntitySign is the most interesting part. Check if the sign data in your region dump matches the V0 or V1_20 variants.

neocturne avatar Apr 01 '25 16:04 neocturne

I've just noticed a similar issue when adding support for Minecraft 1.21.5, so it doesn't seem to be specific to Paper (if we're seeing the same problem). I'm also looking into this - looks like the weird "JSON in NBT" format for sign text got ditched in favor of embedding rich text directly as an NBT substructure.

neocturne avatar Apr 02 '25 17:04 neocturne

Okay, the new incompatibility I found turned out to be specific to 1.21.5; this is now handled here: https://github.com/neocturne/MinedMap/blob/main/src/world/text_value.rs#L178-L188

However, the newly added code should also make it easier to debug your issue: you can just output the values of data_version and &self.0 using dbg!() or similar in deserialize().

neocturne avatar Apr 02 '25 21:04 neocturne