NBTExplorer icon indicating copy to clipboard operation
NBTExplorer copied to clipboard

Add Unsigned short, unsigned integer and unsigned long tags.

Open Zifiv opened this issue 11 years ago • 10 comments

Add the unsigned short, unsigned integer and unsigned long because for exemple, into idcounts.dat, the tag map is an unsigned short into minecraft. Actually we can't set (with your app) more than 32767 (max of signed short)... Please fixe it !

Zifiv avatar Aug 19 '14 23:08 Zifiv

This is a limitation of Minecraft itself. Unless Mojang adds new tag types to the NBT format this isn't really something anyone will add.

LB-- avatar Aug 19 '14 23:08 LB--

"This is limited to the size of a short (65,536)." Minecraft.GamePedia

Zifiv avatar Aug 20 '14 00:08 Zifiv

Put in a negative number between -1 and -32768. Does it work? LB-- is correct, there is no tag for unsigned integers, and Java does not support unsigned integers. It's still possible for the game to interpret the values as unsigned if it's passing around ints internally.

If that's the case, then I would consider this a feature request to let NBTExplorer change the interpretation of the integers between signed and unsigned. But there is no way to automatically provide this. Separate tags do not exist.

jaquadro avatar Aug 20 '14 00:08 jaquadro

Negative number between -32768 and -1, it work, but Minecraft don't use it correctly, because this "map" tag is used to set the ID of the map data (who are used to create the file name of this map data, "map_ID.dat") When we are beginning with a empty world and create the first map in this world, this tag ("map" tag in "idcounts.dat" file) is at "0" not "-32768".

I think you should just use a warning when we are trying to set the value of an short, integer or long. If the value written is between -32768 and 32767 no warning, if the value is more greater than 32767 just display a warning to explain that this value will be interpreted like an unsigned by Minecraft.

Because actually it's impossible to set a value more greater than 32767 in this data, but normaly it's possible with Minecraft.

Zifiv avatar Aug 20 '14 01:08 Zifiv

If Minecraft isn't using the negative numbers correctly, then there's nothing I can change to extend the range beyond 32767. When a signed short overflows, the next value in sequence after 32767 is -32768, and then the numbers continue decrementing until -1.

IF minecraft were interpreting the full 16 bits of a short tag as unsigned data, then entering -32768 should give you an in-game value of 32768. If it doesn't, then Notch's tweet is misinformed. One other thing you could try is replacing the short tag with an int tag instead. Minecraft may accept that, particularly if it doesn't have to write it out again.

jaquadro avatar Aug 20 '14 02:08 jaquadro

Okey okey ;) thanks you for your help... I will try with the -32768 to see if minecraft understands 32768 before to close this issue.

Zifiv avatar Aug 20 '14 02:08 Zifiv

@beaucoralk ah, the wiki is wrong there - I'll fix it.

LB-- avatar Aug 20 '14 03:08 LB--

@LB-- it reflects the information in the provided reference, but I believe the reference itself is wrong. Even if it is Notch.

jaquadro avatar Aug 20 '14 03:08 jaquadro

@jaquadro ah, yeah I think Notch was thinking of 2^16 instead

LB-- avatar Aug 20 '14 03:08 LB--

@LB-- @jaquadro I'm right with you, Notch, with this tweet didn't say, "the maximum value of the map tag is 65,536.", with this tweet, he said just, it's possible to create 65,536 map for a world. I think that it's in the wiki that someone interpreted this tweet... I'm right with you to this part of wiki, there is confusions.

Zifiv avatar Aug 20 '14 03:08 Zifiv