Skip to content

skript-gson 2.0.4 - Changed internal object mapping

Compare
Choose a tag to compare
@cooffeeRequired cooffeeRequired released this 02 Jan 15:12
· 490 commits to main since this release

skript-gson 2.0.4 🔰

Git

  • Hello everyone 👋

  • Changed internal object mapping for Items, now you are able to pull Item from mapped json as well.

command saveinv:
    trigger:
        set {inv} to json from player's inventory

command listinv:
    trigger:
        map {inv} to {_inv::*}
        loop (indices of {_inv::contents::*}):
            if {_inv::contents::%loop-value%::*} is set:
                set {_item} to {_inv::contents::%loop-value%::*}'s form parsed as skript-type
                give {_item} to "player's name" parsed as player

Another fix of mapping (formatting list to json)

on load:
    set {_k::basic::1} to 1
    set {_k::basic::2} to 2
    set {_k::basic2::*} to "test", "test2", 1, false, json from string "[1,2,false,{}]"
    set {_k::basic4::basic2::basic1::*} to "some data here, basically anything", new json from string "{}", new json from string "[]"

    send "&b%{_k::*}'s form%"

new

{"basic":["1","2"],"basic2":["test","test2","1",false,[1,2,false,{}]],"basic4":{"basic2":{"basic1":["some data here, basically anything",{},[]]}}}

old

{"basic":{"1":"1","2":"2"},"basic2":["test","test2","1",false,[1,2,false,{}]],"basic4":{}}

Thank you all for your attention.
Sincerely Coffee. 👋

FTW skript-gson

Full Changelog: 2.0.3...2.0.4