webNBT
webNBT copied to clipboard
Copy & paste as SNBT
Implement copying & pasting of subtrees as text, that should be valid SNBT (the syntax used in command blocks, but I have not tested).
Current limitations
- The only pasting option available is replacement of an existing tag; old & new tag types must much, so new tags should be created, named & set the the correct type manually
- Recovery from end of input while checking number type may be incomlete, so you may want add a trailing space when pasting double/int tags (or just use
Edit value...
instead) - Not tested very much (especially different
*ArrayTag
s), so there may be other problems - It currently uses old clipboard API, pasting falls back to
prompt
Closes https://github.com/iRath96/webNBT/issues/5, https://github.com/iRath96/webNBT/issues/15
There seems to be a problem with copying doubles. They are exported in hexadecimal notation, which they are not supposed to be afaik.
The error message when pasting something of incorrect type is confusing. It says "Parse error at position 0" even though the pasted content is syntactically correct. Perhaps it should say something along the lines of, e.g., "Cannot paste content of type 'Double' into property of type 'Long'".
In the future, it would be cool to automatically cast at some of the types (in particular among the numerical types). But for now we can live without this :-)