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

Allow persistent storage of colors into variables #2486

Closed
Matocolotoe opened this issue Sep 29, 2019 · 7 comments
Closed

Allow persistent storage of colors into variables #2486

Matocolotoe opened this issue Sep 29, 2019 · 7 comments
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

Comments

@Matocolotoe
Copy link
Contributor

Matocolotoe commented Sep 29, 2019

Description

A variable can't be set to a color nor a string parsed as color

Steps to Reproduce

set {color} to aqua
set {color} to "aqua" parsed as color

Expected Behavior

No error should appear.

Errors / Screenshots

[16:46:36] [Server thread/ERROR]: #!#! ch.njol.skript.SkriptAPIException: Serializer of color must override newInstance(), canBeInstantiated() or mustSyncDeserialization() if its class does not have a nullary constructor
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.classes.Serializer.newInstance(Serializer.java:80)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.yggdrasil.Yggdrasil.newInstance(Yggdrasil.java:337)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.yggdrasil.Yggdrasil.isSerializable(Yggdrasil.java:155)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.yggdrasil.Yggdrasil.getID(Yggdrasil.java:215)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.registrations.Classes.getYggdrasilStart(Classes.java:658)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.registrations.Classes.serialize(Classes.java:712)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.variables.Variables.serialize(Variables.java:531)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.variables.Variables.serialize(Variables.java:524)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.variables.Variables.saveVariableChange(Variables.java:535)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.variables.Variables.setVariable(Variables.java:367)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.variables.Variables.setVariable(Variables.java:358)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Variable.set(Variable.java:419)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Variable.change(Variable.java:479)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:271)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:52)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands.handleEffectCommand(Commands.java:277)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands$3$1.call(Commands.java:210)
[16:46:36] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands$3$1.call(Commands.java:1)
[16:46:36] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftFuture.run(CraftFuture.java:89)
[16:46:36] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[16:46:36] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723)
[16:46:36] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[16:46:36] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[16:46:36] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[16:46:36] [Server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:748)

Server Information

  • Server version/platform: any
  • Skript version: latest (beta7)
@Runakai1
Copy link

Iirc you can simply set it as a string and use the color code within "send colored""" or as a text just put it in <> and use send colored "".

Having that as an enhancement would be great tho

@Matocolotoe
Copy link
Contributor Author

This is not supposed to happen, and I use that for leather armor pieces :/

@Runakai1
Copy link

You could possibly parse it as an item then but that would be annoying

@Whimsyturtle
Copy link
Member

Does 2.4-beta9's color API improvements resolve this?

@Matocolotoe
Copy link
Contributor Author

Well there isn't any error anymore but

a color cannot be saved, i.e. the contents of the variable {color} will be lost when the server stops. (test.sk, line 2: set {color} to blue')

@Whimsyturtle
Copy link
Member

Marking as enhancement.

@Whimsyturtle Whimsyturtle changed the title SkriptAPIException when setting a variable to a color Allow persistent storage of colors into variables May 17, 2020
@Whimsyturtle Whimsyturtle added enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements). labels May 17, 2020
@Whimsyturtle Whimsyturtle added needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls. and removed needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls. labels Jul 10, 2020
@TheLimeGlass
Copy link
Contributor

Closing as duplicate, but using the newer issue as I have placed more information there. #5176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Projects
None yet
Development

No branches or pull requests

4 participants