#(hyper) retrieving and checking whether a value in the config is a color (spigot java)

37 messages · Page 1 of 1 (latest)

balmy sluice
#

title

fresh marlinBOT
#

(hyper) retrieving and checking whether a value in the config is a color (java)

fresh marlinBOT
#

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>

balmy sluice
#

(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?

dim trail
balmy sluice
#

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

dim trail
#

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?

balmy sluice
#

yes

dim trail
#

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));
    }
dim trail
#

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)

balmy sluice
#

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

balmy sluice
dim trail
#

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

dim trail
balmy sluice
#

figured it out

#

java programming is fun

#

yay

fiery pollenBOT
#

+> YAY!!!