Stevertus / objD

objD is a framework for developing Datapacks for Minecraft. It uses the Dart programming language.
https://objd.stevertus.com
BSD 2-Clause "Simplified" License
45 stars 13 forks source link

Workaround for UUIDs in item nbt tags #28

Closed Globbi closed 1 year ago

Globbi commented 1 year ago

This fixes an issue with int array representation of UUIDs in nbt tags for items.

Minecraft does not used the standard array format for UUIDs but presumably expects a marker at the beginning.

UUID:[11,22,33,44] // not recognized by Minecraft
UUID:[I;11,22,33,44] // this however is

To solve this issue a little post processing step has been introduced which inserts the expected I; for every UUID in int array representation.

Stevertus commented 1 year ago

Does this only apply to items? I guess this would also be relevant to other places where nbt is used. I guess a UUID class would be a bit cleaner, with the library of @MinimineLP, we could write a custom converter: https://github.com/MinimineLP/dart-gson/blob/master/lib/values.dart#L5

Globbi commented 1 year ago

I'll take a look at those converters. a UUID class would definitely be cleaner than a post processor!

Globbi commented 1 year ago

solved with 3da5882