Skip to content

Releases: cooffeeRequired/skJson

Fix nbt issues, add ~ as path identifier

18 Mar 09:10
Compare
Choose a tag to compare

Full Changelog: 3.0.6...3.0.7

Important

BugFixes

1. Bug regarding bad parsing of nbt 🚩#90
command /addtrade:
   permission: OP
   trigger:
      set {_jt} to json from file "plugins/SkJson/test.json" # this is my json file
       set {_slot0} to full nbt compound of slot 0 of player
       set {_slot1} to full nbt compound of slot 1 of player
       set {_slot2} to full nbt compound of slot 2 of player
       set {_n} to 0

       send {_jt} with pretty print to console

       write {_jt} to json file "plugins/SkJson/trader.json"
       loop values "trade::%{_n}%" of {_jt}:
           send json-key to console
           set value of json object "trade::0::%{_n}%::0::nbt" in {_jt} to {_slot0}
           set value of json object "trade::0::%{_n}%::1::nbt" in {_jt} to {_slot1}
           set value of json object "trade::0::%{_n}%::2::nbt" in {_jt} to {_slot2}
       write {_jt} to json file "plugins/SkJson/trader.json"

At this point the nbt are converted successfully to the Object

         "nbt": {
          "..": "com.shanebeestudios.skbee.api.nbt.NBTContainer",
           "nbt": "{Count:1b,id:\"minecraft:stone\",tag:{CustomModelData:222,Damage:222,Enchantments:[{id:\"aqua_affinity\",lvl:1},{id:\"binding_curse\",lvl:1},{id:\"vanishing_curse\",lvl:1}],RepairCost:2222,Tags:[\"Test\",\" test2\",\" test\"],display:{Lore:['[{\"text\":\"asdasdasdasd\",\"italic\":false}]'],Name:'[{\"text\":\"asdasdasd\",\"italic\":false}]'}}}"
         }
2. Bug regarding to wrong parsed http headers 🚩

Sometime could happen the Content-Type headers was broken, missing space or basically sending body to the GET request
That is already fixed, all headers could be used no matter what.

3. Bug regarding to response types (JsonArray or Plain/Text) 🚩

The response of type JsonArray or Plain/Text was ignored, that's already fixed and sanitized!

Note

Add

~ as path identifier of plugins/Skript/scripts

Example

on load:
   set {_file} to json from file "~/test.json"
   new json file "~/raw.json"
   send {_file}

So the file will be created in the plugins/Skript/scripts

Note

Huge thanks to the guys who continue to diligently report bugs and test limits to the world of json - SkJson
👏 @Pex666
👏 @kubaczak
👏 @boxic
👏 @KITOXIS
👏 @DRAGNIL68

📢Big Shout Out to Them!

3.0.6

17 Mar 13:25
Compare
Choose a tag to compare

Full Changelog: 3.0.5...3.0.6

Important

Fix reading json arrays from web requests.

3.0.5

09 Mar 17:38
Compare
Choose a tag to compare

Full Changelog: 3.0.4...3.0.5

Important

Fix permission escalation for skjson command, now you need to have permission node skjson.use or op

Fix editing files, request on authorized website, fix patch request

09 Mar 07:41
Compare
Choose a tag to compare

Full Changelog: 3.0.3...3.0.4

Important

BugFixes

1. Bug regarding on editing files. with effect edit

command changefile:
  trigger:
  	edit value "type" of json file "plugins/Skript/scripts/test.json" to "DIAMOND"
Before
changefile
[08:28:42 INFO]: [SkJson] WARN Cannot create a file plugins/Skript/scripts/test.json cause the file already exists.

2. Bug regarding on sending web request on authorized apis (google, icloud, crypto stuff, and more)

Fix Some small issues and typos

26 Feb 01:46
Compare
Choose a tag to compare

What's Changed

  • Switch from json serializaton to custom adapters by @SkJsonTeam in #85
  • Switch from json serializaton to custom adapters by @cooffeeRequired in #89

Full Changelog: 3.0.1...3.0.3

Important

BugFixes

1. Bug regarding bad encoding of ASCII characters 🚩#88
local function ASCIISymbolsFix2_26_24():
  set {_json} to json from file "./plugins/Scripts/test.json"
  send json from "»»»" to console
  send {_json} with pretty print to console

At this point the json file returned "B»B»B»" for some it was ~A"~A"~A"
This is already fixed.

2. Bug regarding to completed resource handling for requests 🚩discord
local function requestSyncFix2_26_24() :: object:
  set {_request} to prepare new GET request on "https://raw.githubusercontent.com/SkJsonTeam/skJson/main/skjson.json"
  set {_request}'s request content to @{"A": true}
  set {_request}'s headers to @{"Content-Type": "application/json+vhd"}
  sync send prepared {_request}

  if response status of {_request} is "OK":
  	return response content of {_request}

Fixed for now, working with web request is always meh, but if you really need to use synchronous request you can now use [:sync] (send|execute) [prepared] %request%

3. Bug regarding to wrong parsing for value of %json% 🚩#86

Now fully fixed

4. Bug regarding to FileWriting 🚩#84

Writing and formatting was handled by one method, which was not properly checked now fixed

Note

Huge thanks to the guys who continue to diligently report bugs and test limits to the world of json - SkJson
👏 @envizar
👏 @kubaczak
👏 @ExCorde
👏 @ImNotStable
👏 @Pumkinhead
👏 @MinecraftNight4

📢Big Shout Out to Them!

3.0.2-IO

18 Jan 23:53
Compare
Choose a tag to compare

Fix broken save json %string% For example, the operations for linking a file were error, fix (save json "..."), that will handle in the newest
Skript version as World. (changed to save cached json %string%
Fix cache - cache will be keep until reload/restart your server

Full Changelog: 3.0.1...3.0.2-IO

Fix async save/load cache and add Sync for requests

18 Jan 19:33
Compare
Choose a tag to compare

Change from Effect to AsyncEffect to process asynchronous operations exactly as expected. For example, the operations for linking a file were error

Full Changelog: 3.0.0...3.0.1

Major SkJson Update (Breaking changes!)

12 Jan 21:33
Compare
Choose a tag to compare

Major updates to SkJson (breaking changes!)

Internal API has been changed for the latest version only Skript 2.8+ is supported, also requests have been changed, now they are more skript friendly from

on script load:
    async make POST request to "https://dummyjson.com/carts/add":
        headers: "Content-Type: application/json"
        content: json from text "{userId: 1, products: [{id: 1, quantity: 1}, {id: 50, > quantity: 2}]}"
        save incorrect response: true
        lenient: true
        save:
            content: {-content}
            headers: {-header}
            status code: {-code}
            url: {-url}

At @Requests

    set {_request} to prepare new GET request on "https://raw.githubusercontent.com/SkJsonTeam/skJson/main/skjson.json"
    set {_request}'s request content to @{"A": true}
    set {_request}'s headers to @{"Content-Type": "application/json+vhd"}
    send prepared {_request}

    if response status is "OK":
        send response status code of {_request}
        send response content of {_request}
        send response status code of {_request}
        send response headers of {_request}

webhooks will be updated in future versions..
Supplied

Modified algorithm for parsing a string to a Key Structure. Faster file processing. Fixed working with files.. now files are locked only if really used.

Finished single line literal json.

What's Changed

  • 3.0.0 pre by @SkJsonTeam in #83

Full Changelog: 2.9.7...3.0.0

new expression for handling files in the directory.

29 Dec 21:35
Compare
Choose a tag to compare

AllJsonInFolder

on script load:
    send all json files in dir "./plugins/Skript/JSONS"

    loop all json files in dir "./plugins/Skript/JSONS":
        send loop-file
        send json from file loop-file

that will allowed to you, loop through directory and get the path of the given file and also the json from it.

Full Changelog: 2.9.6...2.9.7

From NBT-ITems to SkBee NBT

13 Dec 22:38
fdcbe5a
Compare
Choose a tag to compare

we changed from using NBT-Items to SKBee because Nbt was not working properly.

What's Changed

Full Changelog: 2.9.4...2.9.6