LunarClient / Apollo

Next-generation Lunar Client server API
https://lunarclient.dev
MIT License
92 stars 18 forks source link

[Bug Report] Unable to wrap value of type 'Color'! #155

Closed Immutabled closed 4 months ago

Immutabled commented 5 months ago

Checklist before creating an issue:

Issue Description

Basically when it comes to putting a custom color in the bossbar mod it doesn't work, I have tried multiple colors, and without or with # at this moment I am trying with color (#FFFFAA00)

[19:45:47 WARN]: [Library] Task #63 for Library v2024.18.2 generated an exception java.lang.RuntimeException: Unable to wrap value of type 'Color'! at com.lunarclient.apollo.option.OptionsImpl.wrapValue(OptionsImpl.java:277) ~[?:?] at com.lunarclient.apollo.option.OptionsImpl.postPacket(OptionsImpl.java:338) ~[?:?] at com.lunarclient.apollo.option.OptionsImpl.set(OptionsImpl.java:140) ~[?:?] at net.midesprojects.library.bossbar.BossBarHandler.create(BossBarHandler.kt:29) ~[?:?] at net.midesprojects.library.bossbar.listener.BossBarListener$onPlayerJoin$1.run(BossBarListener.kt:25) ~[?:?] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:67) ~[spigot.jar:?] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:355) [spigot.jar:?] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:889) [spigot.jar:?] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:377) [spigot.jar:?] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:808) [spigot.jar:?] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:702) [spigot.jar:?] at java.base/java.lang.Thread.run(Thread.java:829) [?:?]

Reproduction steps

1. It happens every time you enter, but it's only with the color.

Code Snippet (If applicable, if not write N/A)

thats my create bossbar method fun create(player: Player): BossBar {

    if (player.isRunningApollo()) {
        modsModules.options.set(player.getApolloPlayer(), ModBossbar.ENABLED, true)
        modsModules.options.set(player.getApolloPlayer(), ModBossbar.BAR_COLOR, "#FFFFAA00")
        modsModules.options.set(player.getApolloPlayer(), ModBossbar.CUSTOM_BOSS_BAR, true)
        modsModules.options.set(player.getApolloPlayer(), ModBossbar.RENDER_BAR, true)
    }

    return BossBar().apply {
        create(player, adapter!!.getEntry(player)!!.text, adapter!!.getEntry(player)!!.health)
    }
}

Versions

1.8

Platforms

Spigot / Bukkit

Server Version

1.8

Modules

Optifine

Screenshots

![Basically it looks like this is the latest version of Apollo.](https://gyazo.com/3cc5221676150975741fb92385824121)
![There you can see that the other part of the code does work.](https://gyazo.com/424c216c2f5441b3e34035db65187948)

Contact Information

Discord - @immutabled

Additional Context (Examples, Links, ETC)

No response

ItsNature commented 4 months ago

This issue was resolved in the Apollo update: 1.1.4