Create NBT Support with Variant in cItem #5454
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tries to kick of further development if additional data is stored into an item.
There is a new member
m_Properties
which is a vector of a variant which stores all possible data.Access is done with
get<>()
andset<>()
which both are templated methods which return a optional which contains the requested data. I tried to keep access as simple as possible to ensure easy programming. Sadly optional doesn't support references so the value has to be retrieved withget
, modified ad written back with.set
.Any use in the C++ code is adapted to this. Old Lua Binding should be intact by manual binding the old values.
Im am not 100% sure about my Lua implementation, please check that!