#(hyper) retrieving and checking whether a value in the config is a color (spigot java)
37 messages · Page 1 of 1 (latest)
(hyper) retrieving and checking whether a value in the config is a color (java)
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
(hyper) retrieving and checking whether a value in the config is a color (spigot java)
config.getConfig().isColor("color") the following should read the color value in the config, no?
We'll need a bit more context then that - what's config? what does getConfig return? what do you mean by is a color? the name of a color? a valid hex?
config retrieves the config.yml file in the plugin "test" folder and has the value "color" in it.
does .isColor only accept hex?
currently listing it in the config.yml with its name
I'm still not sure what are you trying to do, is config your plugin instance and you're calling getConfig to get a FileConfiguration?
yes
If so, these methods are usually whatever serializing spigot has for that object type iirc?
Which, in the case of org.bukkit.Color, is
@NotNull
public Map<String, Object> serialize() {
return ImmutableMap.of("RED", this.getRed(), "BLUE", this.getBlue(), "GREEN", this.getGreen());
}
@NotNull
public static Color deserialize(@NotNull Map<String, Object> map) {
return fromRGB(asInt("RED", map), asInt("GREEN", map), asInt("BLUE", map));
}
its using bukkit
As in, bukkit alone o.O? what version are you developing for?
Oh you meant the object is using bukkit
Spigot is an expansion to the Bukkit API basically
They maintain it and expand it as Spigot
(And implement it, ofc)
yeah sorry im not too well-versed with java lingo or java programming for that matter, trying to learn java and apply those learned concepts into a plugin
gotcha
1.19.3
That's great :D - as to your original question, it looks like these methods just check for whatever serializing Spigot has, so in Color's case, a map with RED GREEN and BLUE keys
Yeah thought you said you were using bukkit for a second lol
lol
okay gotcha
+> YAY!!!