`send "%var% <any text>"` throws a `java.lang.IllegalStateException: zip file closed`
stedwesd opened this issue · 3 comments
Skript/Server Version
> skript info
[18:23:53 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[18:23:53 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[18:23:53 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[18:23:53 INFO]: [Skript] Server Version: git-Paper-463 (MC: 1.20.4)
[18:23:53 INFO]: [Skript] Skript Version: 2.8.3 (skriptlang-github)
[18:23:53 INFO]: [Skript] Installed Skript Addons: None
[18:23:53 INFO]: [Skript] Installed dependencies: None
Bug Description
When putting a variable into a string with the %-notation, while also including ANY other kind of text, e.g.:
send "%var% <any regular text>" to player
a java.lang.IllegalStateException: zip file closed
is thrown.
The following code variations work fine:
send "%var%" to player
send "<any regular text>" to player
set {_string} to "%var% <any other text>"
send "%{_string}%" to player
The last variation is functionally the same as the problematic code, yet not throwing the error.
Expected Behavior
send "%var% <any regular text>" to player
should print out the requested message instead of causing an error.
Steps to Reproduce
Here's some sample code I used to identify the issue. The comments show the corresponding behavior.
on left mouseclick:
# test
set {_loc} to location of player
set {_yaw} to yaw of {_loc}
set {_pitch} to pitch of {_loc}
#send "%{_pitch}%" to player # loads, works as expected
#send "%{_yaw}%" to player # loads, works as expected
#send "%{_loc}%" to player # loads, works as expected
#send "%player%" to player # loads, works as expected
#send "yaw: %{_yaw}%" to player # loads, causes java.lang.IllegalStateException: zip file closed
#send "%{_yaw}% " to player # loads, causes java.lang.IllegalStateException: zip file closed
#send "%{_yaw}% %{_pitch}%" to player # loads, causes java.lang.IllegalStateException: zip file closed
#send "yaw: %{_yaw}% pitch: %{_pitch}%" to player # loads, causes java.lang.IllegalStateException: zip file closed
#send "%player%: test" to player # loads, causes java.lang.IllegalStateException: zip file closed
#set {_string} to "%player%: test" # loads, works as expected
#send {_string} to player
Errors or Screenshots
https://gist.github.com/stedwesd/485e4ff13bb0b8aed787d1d1c7cedd55
Other
I am absolutely new to this. The bug was discovered in my second attempt to make something in skript. hope it wasn't reported yet and that i can help :D
Agreement
- I have read the guidelines above and affirm I am following them with this report.
Did you happen to every do a /reload
or reload skript with plugman or a similar plugin? That's what usually causes errors like this.
I did use the built-in /reload confirm
command.
After stopping and starting the server again, the issue seems to be resolved and all cases seem to work fine. I swear that i've fully restarted the server before with no avail, but seems like that wasn't the case and I thought that restarting didn't help🤷.
Apologies for the inconvenience and thanks for help!