-
Added list value expression
[[skript-]y[a]ml] value %number% (of|in|from) list %string% (of|in|from) %string% [without string checks]
- Warns if the node is not a list or if the index is not within range
-
Added more verbose error logging
- Internal errors now show the sk file and line number also there are more error/warning messages for certain things
-
Bug fixes
- Sometimes strings would split between multiple lines (which snakeyaml does by default) causing data to sometimes be lost
- Fixed by preventing strings from splitting
- Sometimes strings containing '&' would save without double quotes and cause an error preventing the data from loading correctly
- Fixed by forcing those strings to save with double quotes (currently )
- Fixed some NPEs laying around the place
- Sometimes strings would split between multiple lines (which snakeyaml does by default) causing data to sometimes be lost
-
Skript versions
- In Skript 2.4 some api changes were made to some class names and methods and again in Skript 2.6 some other changes were made
- This update addresses those changes and makes things backwards compatible
- In Skript 2.4 some api changes were made to some class names and methods and again in Skript 2.6 some other changes were made
Thanks to @wallace4BR and others for helping me test unreleased updates between the last release
This update should fix the issue with yaml directory ids not working in the last release!
-
Backwards compatibility
- Some time during 1.13.2 spigot decided to update snakeyaml
- In the previous update I made skript-yaml work with the newer version but didn't make things backwards compatible
- Now everything works with versions 1.13.2 and lower
-
Updated load effect
[re]load [(1¦non[(-| )]relative)] [y[a]ml] %string% as %string%
(only allows a single input)[re]load [(1¦non[(-| )]relative)] [y[a]ml] %strings% [using [the] [file] path[s] as [the] id[s]]
- Using
[using [the] [file] path[s] as [the] id[s]]
replaces having to manually enter the file path as an id - This second syntax allows for multiple inputs
- Using
-
Updated unload effect to
unload [y[a]ml] [(1¦director(y|ies))] %strings%
(allows for multiple inputs)- The [(1¦director(y|ies))] option requires one or more directories as an input and unloads any loaded yaml files from them
-
Updated save effect to
save [y[a]ml] %strings% [with an indentation of %-number%] [(1¦[and] with(out| no) extra lines between nodes)]
- Now allows for multiple inputs
- You can also set the amount of indentation
-
Updated delete yaml effect to
delete [y[a]ml] %strings%
- Now allows for multiple inputs
-
Moved all delete yaml directory syntax to a single class(internal stuff)
- Updated
delete (all|any) [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings%
- Moved
delete (all|any) loaded [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings%
- Moved
delete (all|any) loaded [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings% using [the] filename as [the] id
- Updated
-
Updated all loaded yaml expression to
[(the|all [(of the|the)])] [currently] loaded y[a]ml [files] [from (director(y|ies) %-strings%|all directories)]
- Using the
from director(y|ies) %-strings%
option outputs all loaded yaml from one or more directories
- Using the
-
Added all loaded yaml directories expression
[(the|all [(of the|the)])] [currently] loaded y[a]ml directories
-
Added yaml file exists condition
[(1¦non[(-| )]relative)] y[a]ml file %string% exists
and[(1¦non[(-| )]relative)] y[a]ml file %string% does(n't| not) exist
-
Fixed issue in the yaml expression where node keys were not adding and removing properly.
-
Fixed issue with using AsyncEffect during
on disable:
event -
Added some loop stuff for the yaml expression
-
Added ability for other (java)addon developers to register custom tags(!location, !vector, etc..) with skript-yaml
- Warns if the tag or class you are trying to register is already registered
- Also warns if the represented or constructed class doesn't match the class you are registering
- This is only useful if for some reason you want to add the ability to save something to yaml that doesnt already serialize
1.13 support
- Fixed issue with stuff not saving properly due to 'NoSuchMethod' error
EDIT: At the moment this version doesn't work with some older versions of spigot(1.8 etc.), you can safely use 1.2.4 if you get a 'NoSuchMethod' error
More fixes
- Fixed issue with files not loading if some keys contained integers
- They now get converted into characters, keep this in mind when fetching data from those nodes
- Fixed issue with elements not saving in the same order they were set
- Fixed error when loading a file with empty nodes
- Fixed a casting issue with lists
- Fixed issue #6 before it was reported <3
- Moved serialization method to better location to address an issue where certain serialization didn't happen if the file was loaded and saved again(without setting the value)
- Added more skript classes to the representer
- Date, Time, Timespan, Color and WeatherType
- Date is parsed the same way snakeyaml would have converted 'java.util.Date'
- The rest use skript methods to convert back and forth
- Date, Time, Timespan, Color and WeatherType
Bugfixes
- Added Skripts ItemType and Slot class to the yaml representer
- This fixes certain items not being saved as ItemStack
- Fixed stacktrace when saving empty yaml
- Updated the Yaml expression to filter color codes back and forth
- Use the
without string checks
option to disable it
- Use the
Bugfixes and more
- Updated how de/serialization works using Snakeyamls built in methods
- This means you will see a change in how Skript serialized classes look removing the map node 'skriptclass' to a tag '!skriptclass' that Snakeyaml uses to parse data types
- Vector and Location also have a tag and removal of the map node representing the data type
- Bukkits ConfigurationSerializable data types are also de/serializable using the same method bukkit feeds to snakeyaml
- These types have their own serialized structure
- It will update any previously saved data types
- Added Effect to delete all yaml or any loaded yaml from a directory
delete all [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings%
delete (all|any) loaded [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings% [using [the] filename as [the] id]
- Re-added 'Does yaml path exist' condition since the built in skript version was returning the wrong result (check docs for more info)
- Changed 'Yaml' expression to
[[skript-]y[a]ml] (1¦value|2¦(node|path) list|3¦(node|path)[s with] keys|4¦list) %string% (of|in|from) %string% [without string checks]
- Using '(node|path) list' only gets a list of nodes at that path (full names like 'rootnode.subnode' are returned)
- Fixed comments and header not loading into memory during a fresh load (causing them to not be saved as a result)
- Snakeyaml loads asynchronously already so i changed loading 'Effect' instead of 'AsyncEffect' (it fixes an error that happens sometimes)
Skript serialized classes now look like...
nodeName: !skriptclass
type: someclasstype
data: bGF3bHMgZ2V0IHJla3QgPDMgdGhpcyBpcyBvbmx5IGZvciBleGFtcGxl
Added even more things to make the addon more feature complete
- Added effect
[re]load all [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings% [using [the] filename as [the] id]
(loads all .yml from a directory thx pikachu for the idea) - Files are now saved with additional lines between each node
- Updated 'Save yaml' effect to...
save [y[a]ml] %string% [(1¦without extra lines between nodes)]
- Updated 'Save yaml' effect to...
- Comments and header no longer add additional lines by default
- Updated 'Yaml comment/header' expressions to...
[the] comment[s] (of|from) [y[a]ml] node[s] %strings% (of|in|from) %string% [(1¦with [an] extra line)]
[the] (comment[s] (at|on) [the] top of |header (of|from)) %string% [(1¦with [an] extra line)]
- Updated 'Yaml comment/header' expressions to...
- Updated 'Yaml' expression return type now stuff like this works...
broadcast yaml value "location" from "plugins/skript-yaml/teleport.yml"
teleport player to yaml value "location" from "plugins/skript-yaml/teleport.yml"