Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect sign text in Chunk data #120

Closed
aremath opened this issue Mar 15, 2021 · 3 comments
Closed

Incorrect sign text in Chunk data #120

aremath opened this issue Mar 15, 2021 · 3 comments

Comments

@aremath
Copy link

aremath commented Mar 15, 2021

Describe the bug
A clear and concise description of what the bug is.

When reading a world file using load_level and the calling .get_chunk(x,y), the returned Chunk object stores the signs that are in that chunk in the entity. The signs stored in block_entities do not have text, despite the in-game signs having text.

To Reproduce

from amulet import load_level
# A world with a sign
level = load_level("worlds/test")
# A chunk in the world with a sign
chunk = level.get_chunk(5,6)
for e in c.block_entities:
    print(e.nbt)

And output

NBTFile("":{utags: {Text4: "{\"text\":\"\"}", Text3: "{\"text\":\"\"}", Text2: "{\"text\":\"\"}", Text1: "{\"text\":\"\"}"}})
NBTFile("":{utags: {Text4: "{\"text\":\"\"}", Text3: "{\"text\":\"\"}", Text2: "{\"text\":\"\"}", Text1: "{\"text\":\"\"}"}})
NBTFile("":{utags: {Text4: "{\"text\":\"\"}", Text3: "{\"text\":\"\"}", Text2: "{\"text\":\"\"}", Text1: "{\"text\":\"\"}"}})

Expected behavior

NBTFile("":{utags: {Text4: "{\"text\":\"\"}", Text3: "{\"text\":\"THIS SIGN\"}", Text2: "{\"text\":\"TEXT ON\"}", Text1: "{\"text\":\"THERE IS\"}"}})
NBTFile("":{utags: {Text4: "{\"text\":\"\"}", Text3: "{\"text\":\"\"}", Text2: "{\"text\":\"\"}", Text1: "{\"text\":\"THIS ONE TOO\"}"}})
NBTFile("":{utags: {Text4: "{\"text\":\"\"}", Text3: "{\"text\":\"\"}", Text2: "{\"text\":\"\"}", Text1: "{\"text\":\"WHEEE\"}"}})

Screenshots
2021-03-08 10_06_16-saves

Desktop (please complete the following information):

  • OS: Ubuntu 18.04.3 (Using Windows Subsystem for Linux)
  • Program Version:
    • amulet-core: 1.2.0b6
    • amulet-nbt: 1.0.3.7
  • Python Version: 3.9.2
@gentlegiantJGC
Copy link
Member

Java/Bedrock? game version?

@gentlegiantJGC
Copy link
Member

After a bit of testing I have reproduced the issue in Java 1.16.
It was caused by an issue in our NBT library. I don't know how it was not spotted sooner.

@gentlegiantJGC
Copy link
Member

Amulet-Team/Amulet-NBT/pull/12 should fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants