Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when saving cached JSON #96

Closed
Val-K opened this issue Jun 3, 2024 · 2 comments
Closed

Issue when saving cached JSON #96

Val-K opened this issue Jun 3, 2024 · 2 comments

Comments

@Val-K
Copy link

Val-K commented Jun 3, 2024

Every time I try to save a cached JSON to a file, the script I'm running will crash. I'm running a server with Paper 1.20.6 (#133), so given the latest SkJson doesn't work with 1.20.5+ I have used the patched release I have found in a closed issue (here).

This is the code causing the crash:

on script load:
	# Setting up the JSON file and caching it
	new json file "my/path.json" if json file "my/path.json" doesn't exist
	link json file "my/path.json" as "myjson"
	set value of json object "location" in (json "myjson") to location(10, 20, 30, world("world"))
	set {_location} to value "location" of (json "myjson")
	broadcast {_location}
	save json "myjson" # Commenting this line will prevent the error

This is the error:

[22:55:45] [Server thread/ERROR]: #!#!
[22:55:45] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[22:55:45] [Server thread/ERROR]: #!#!
[22:55:45] [Server thread/ERROR]: #!#! Something went horribly wrong with Skript.
[22:55:45] [Server thread/ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[22:55:45] [Server thread/ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[22:55:45] [Server thread/ERROR]: #!#! Here is full list of them:
[22:55:45] [Server thread/ERROR]: #!#! Skript-AnvilGUI v1.7 skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect) SkJson v3.1.0 (https://www.skjson.xyz/) SkBee v3.5.2 (https://github.com/ShaneBeee/SkBee) 
[22:55:45] [Server thread/ERROR]: #!#! We could not identify which of those are specially related, so this might also be Skript issue.
[22:55:45] [Server thread/ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[22:55:45] [Server thread/ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[22:55:45] [Server thread/ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[22:55:45] [Server thread/ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[22:55:45] [Server thread/ERROR]: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
[22:55:45] [Server thread/ERROR]: #!#! 
[22:55:45] [Server thread/ERROR]: #!#! Stack trace:
[22:55:45] [Server thread/ERROR]: #!#! java.lang.ArrayStoreException: com.google.gson.JsonObject
[22:55:45] [Server thread/ERROR]: #!#!     at Skript-2.8.6.jar//org.skriptlang.skript.lang.converter.Converters.convert(Converters.java:503)
[22:55:45] [Server thread/ERROR]: #!#!     at Skript-2.8.6.jar//ch.njol.skript.lang.util.ConvertedExpression.getArray(ConvertedExpression.java:196)
[22:55:45] [Server thread/ERROR]: #!#!     at Skript-2.8.6.jar//ch.njol.skript.effects.EffWorldSave.execute(EffWorldSave.java:61)
[22:55:45] [Server thread/ERROR]: #!#!     at Skript-2.8.6.jar//ch.njol.skript.lang.Effect.run(Effect.java:49)
[22:55:45] [Server thread/ERROR]: #!#!     at Skript-2.8.6.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[22:55:45] [Server thread/ERROR]: #!#!     at Skript-2.8.6.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:88)
[22:55:45] [Server thread/ERROR]: #!#!     at Skript-2.8.6.jar//ch.njol.skript.util.AsyncEffect.lambda$walk$0(AsyncEffect.java:72)
[22:55:45] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:101)
[22:55:45] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:482)
[22:55:45] [Server thread/ERROR]: #!#!     at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1699)
[22:55:45] [Server thread/ERROR]: #!#!     at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:467)
[22:55:45] [Server thread/ERROR]: #!#!     at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1571)
[22:55:45] [Server thread/ERROR]: #!#!     at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1231)
[22:55:45] [Server thread/ERROR]: #!#!     at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323)
[22:55:45] [Server thread/ERROR]: #!#!     at java.base/java.lang.Thread.run(Thread.java:1583)
[22:55:45] [Server thread/ERROR]: #!#! 
[22:55:45] [Server thread/ERROR]: #!#! Version Information:
[22:55:45] [Server thread/ERROR]: #!#!   Skript: 2.8.6 (latest)
[22:55:45] [Server thread/ERROR]: #!#!     Flavor: skriptlang-github
[22:55:45] [Server thread/ERROR]: #!#!     Date: 15:29:23.319558700
[22:55:45] [Server thread/ERROR]: #!#!   Bukkit: 1.20.6-R0.1-SNAPSHOT
[22:55:45] [Server thread/ERROR]: #!#!   Minecraft: 1.20.6
[22:55:45] [Server thread/ERROR]: #!#!   Java: 21.0.2 (OpenJDK 64-Bit Server VM 21.0.2+13-58)
[22:55:45] [Server thread/ERROR]: #!#!   OS: Linux aarch64 6.6.28+rpt-rpi-2712
[22:55:45] [Server thread/ERROR]: #!#! 
[22:55:45] [Server thread/ERROR]: #!#! Server platform: Paper
[22:55:45] [Server thread/ERROR]: #!#! 
[22:55:45] [Server thread/ERROR]: #!#! Current node: null
[22:55:45] [Server thread/ERROR]: #!#! Current item: save the world(s) (get json "myjson" >> cz.coffee.skjson.skript.types.Types$$Lambda/0x000000900273f9c0@222d790b: ConverterInfo{from=class com.google.gson.JsonElement,to=interface org.bukkit.World,converter=cz.coffee.skjson.skript.types.Types$$Lambda/0x000000900273f9c0@222d790b,flags=0})
[22:55:45] [Server thread/ERROR]: #!#! Current trigger: script load (script load) (parcelService.sk, line 19)
[22:55:45] [Server thread/ERROR]: #!#! 
[22:55:45] [Server thread/ERROR]: #!#! Thread: Server thread
[22:55:45] [Server thread/ERROR]: #!#! 
[22:55:45] [Server thread/ERROR]: #!#! Language: english
[22:55:45] [Server thread/ERROR]: #!#! Link parse mode: DISABLED
[22:55:45] [Server thread/ERROR]: #!#! 
[22:55:45] [Server thread/ERROR]: #!#! End of Error.

I hope this helps, and thank you for your valuable work.

@cooffeeRequired
Copy link
Owner

Hello there can you provide more information, like /skjson about, /about, /version, /sk info

@cooffeeRequired
Copy link
Owner

cooffeeRequired commented Jun 4, 2024

this error is because the script added the option to save the world under the syntax save ... and therefore I was forced to modify the syntax to be save cached json ...

so please use

save cached json "..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants