Skip to content

Bug fixing ItemStack, CustomModelData, Encoding, Performance, CleanUP

Compare
Choose a tag to compare
@cooffeeRequired cooffeeRequired released this 22 Feb 17:28
· 362 commits to main since this release

skJson 2.7.0⚠️

Introduce 🟢

Hello everyone.

  • Fix small bugs #26 #24 #23 #22 #21 #20
  • Merges #27 #28
  • Fixed bundles
  • Cleanup code
  • fix Typos
  • fix issue with null in JsonInventory

Example

{
  "items": [
      {"==":"org.bukkit.inventory.ItemStack","v":3218,"type":"APPLE","meta":{"==":"ItemMeta","meta-type":"UNSPECIFIC","display-name":"{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Tomate\"}],\"text\":\"\"}","custom-model-data":1}},
      {"==":"org.bukkit.inventory.ItemStack","v":3218,"type":"APPLE","meta":{"==":"ItemMeta","meta-type":"UNSPECIFIC","display-name":"{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Tomate2\"}],\"text\":\"\"}","custom-model-data":1}},
      {"==":"org.bukkit.inventory.ItemStack","v":3218,"type":"APPLE","meta":{"==":"ItemMeta","meta-type":"UNSPECIFIC","display-name":"{\"extra\":[{\"bold\":false,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"white\",\"text\":\"Tomate3\"}],\"text\":\"\"}","custom-model-data":1}}

  ],
  "nums": [
    1,
    2,
    3,
    0
  ]
}
command try:
    trigger:
        set {_} to json from file "items/test.json"
        send {_}
        remove json object player's tool from nested object "items" of {_}
        remove json index 1 from nested object "nums" of {_}
        send {_} with pretty print
  • Fixed olders issue contains invalid mapping or invalid converting to the json.
  • Also fixed issue what should remove the meta from the ItemStack, which should not be removed.
  • Also fixed issue with CustomModelData contains id of model was lost from converting to json.
  • Path-Hotlinking will not added because it's necessary use that hotlink instead link file instead.
  • #13 null as new Data (Bug) was fully fixed -> Will apear error when you tried converting null json to the object.
  • #15 fully supported new syntax for remove json from nested object.
  • #18 - Item Conversion. When you put item to the Skript list and then you want retrieve it as json form, you got broken json from BukkitSerilization instead of our json normal representation, Example Bellow

Skript Code

add diamond sword, apple, stone pickaxe to {_map::*}
send {_map::*}'s form

Broken

{
   "types": [
    {
      "isAnything": false,
      "itemForm": false,
      "isAlias": false,
      "plain": false,
      "itemFlags": 2
    }
  ],
  "all": false,
  "amount": -1
}

Fixed

[
    {
        "==": "org.bukkit.inventory.ItemStack",
        "v": 3218,
        "type": "DIAMOND_SWORD"
    },
    {
        "==": "org.bukkit.inventory.ItemStack",
        "v": 3218,
        "type": "APPLE"
    },
    {
        "==": "org.bukkit.inventory.ItemStack",
        "v": 3218,
        "type": "STONE_PICKAXE"
    }
]
  • #19 UTF-8 encoding error, Fixed
  • #20 Item-Data encoding error, Fixed
  • #24 Bundle(Custom model Data) lost, Fixed (Minecraft 1.19+)

PLEASE READ THE NEW SYNTAXE'S! on the Skript hub

Please check SkriptHub or Wikipedia for syntax changes.

❌ If you found any bugs, feel free to post it.

Sincerely, Coffee. 👋

Full Changelog: 2.6.0...2.7.0