Closed Kunfury-blep closed 1 year ago
Thanks for the report, I have not added support for 1.20 yet, but it is in my TODO list.
Can you try the following code to see if it prints out Hello, world!
in the console? I have tested this on 7.18.6 and it seems to work fine, so I am not sure why it would not work for getting other types.
{
ItemStack item = new ItemStack( Material.DIAMOND_HOE );
System.out.println( "Setting value..." );
item = NBTEditor.set( item, "Hello, world!", "io", "github", "bananapuncher714", "nbteditor", "test" );
System.out.println( "Getting value..." );
System.out.println( NBTEditor.getString( item, "io", "github", "bananapuncher714", "nbteditor", "test" ) );
System.out.println( NBTEditor.getNBTCompound( item ) );
}
Just finished testing, looks like the value is getting set, but the get methods are what are having the issue.
The tags are showing correctly in the getNBTCompound, but always seem to be null when using getString.
Ok thanks, I'll go over the code more thoroughly when I get the chance. I tested it on the latest build of Spigot 1.20.1 at the time, so I am not sure what exactly is wrong with your test.
Ok thanks, I'll go over the code more thoroughly when I get the chance. I tested it on the latest build of Spigot 1.20.1 at the time, so I am not sure what exactly is wrong with your test.
Thank you for all your work! Just to rule out anything weird on my end, I've got every plugin besides the one using NBTEditor disabled and am still experiencing the same.
Currently running the server on paper-1.20.1-43.jar
If there's anything more that you'd like me to test please let me know!
I tried it in Paper 1.20.1#55 and it works correctly
I tested using spigot 1.19 API
To test I put it directly into onEnable
function
@Override
public void onEnable() {
ItemStack item = new ItemStack( Material.DIAMOND_HOE );
System.out.println( "Setting value..." );
item = NBTEditor.set( item, "Hello, world!", "io", "github", "bananapuncher714", "nbteditor", "test" );
System.out.println( "Getting value..." );
System.out.println( NBTEditor.getString( item, "io", "github", "bananapuncher714", "nbteditor", "test" ) );
System.out.println( NBTEditor.getNBTCompound( item ) );
}
Tried also with Spigot 1.20.1 API and works fine
I ended up fully uninstalling my IDE and reimported everything back into it and the issue fixed itself! I have no idea what might have been causing it but everything is working without issue on 1.20+! Sorry for the trouble regarding this and I appreciate your assistance on it a ton!
Thank you for the amazing work 💜
Currently running v7.18.6 as of the most recent commit on Github.
The NBTEditor was working without issue in 1.19 but once updating to 1.20 of spigot, NBTEditor.set(ItemStack, Value, Keys...) is no longer working. No errors are thrown when set but the NBTEditor.Get(ItemStack, Keys...) always returns null (Or default 0 in the case of getInt).