mega12345mega / NBT-Editor

Edit items, blocks, and entities in-game.
MIT License
46 stars 14 forks source link

Add NaN and NaNd values #48

Closed lNethunter closed 1 year ago

lNethunter commented 1 year ago

Hello, when editing the NBT of an item I have to go through a procedure which takes time for me to insert NaN and NaNd values, well infinityf is just a big number. What would be super helpful is if we had the option to just type the string "NaN" into a value and it actually becomes NaN without the "", if you get what I mean, like the actual value.

mega12345mega commented 1 year ago

The mod uses Minecraft's built in SNBT parser to convert the string based field to actual NBT. I looked it up, and it appears there's a bug in the parser: MC-200070.

I'll look into how easy it is to patch this bug, but considering how obscure this is I might not get around to it. In the meantime, you could vote for the issue so Mojang prioritizes it.

lNethunter commented 1 year ago

I've voted for it already, thanks

lNethunter commented 1 year ago

The mod uses Minecraft's built in SNBT parser to convert the string based field to actual NBT. I looked it up, and it appears there's a bug in the parser: MC-200070.

I'll look into how easy it is to patch this bug, but considering how obscure this is I might not get around to it. In the meantime, you could vote for the issue so Mojang prioritizes it.

Hey, been a week. Have you tried to implement NaN, NaNd and Infinityf? You could just also make so you type like "%9%" and it gets you NaN or "%10%" for infinity

mega12345mega commented 1 year ago

I've been focusing on getting 1.12 tested and released, and then also setting up 1.20 support, so I hadn't had much chance to look into this. However, I checked just now, and it doesn't look like it should be that difficult. I'll make this configurable, default enabled, since this changes the behavior you might expect if you happen to be familiar with this bug. It will also not change the behavior of the /data command. I'm not sure if I plan to include this in the next update, since it is intended to be 1.20 support + bug fixes, to get it released as quickly as possible.

mega12345mega commented 1 year ago

I've just released v1.12.1, which includes this feature.