From 0a98268bd14bf3497bb6278387717146e5187acc Mon Sep 17 00:00:00 2001 From: ItsNature Date: Wed, 13 May 2026 12:29:21 +0200 Subject: [PATCH] Add `PERSIST_COLORS_ON_UNLOAD` to ColoredFireModule --- .../module/coloredfire/ColoredFireModule.java | 19 +++++++++++++++++++ .../lightweight/json/packet-util.mdx | 1 + .../lightweight/protobuf/packet-util.mdx | 1 + .../example/json/util/JsonPacketUtil.java | 1 + .../proto/util/ProtobufPacketUtil.java | 1 + 5 files changed, 23 insertions(+) diff --git a/api/src/main/java/com/lunarclient/apollo/module/coloredfire/ColoredFireModule.java b/api/src/main/java/com/lunarclient/apollo/module/coloredfire/ColoredFireModule.java index f63dcaba..de217a19 100644 --- a/api/src/main/java/com/lunarclient/apollo/module/coloredfire/ColoredFireModule.java +++ b/api/src/main/java/com/lunarclient/apollo/module/coloredfire/ColoredFireModule.java @@ -25,7 +25,10 @@ import com.lunarclient.apollo.module.ApolloModule; import com.lunarclient.apollo.module.ModuleDefinition; +import com.lunarclient.apollo.option.Option; +import com.lunarclient.apollo.option.SimpleOption; import com.lunarclient.apollo.recipients.Recipients; +import io.leangen.geantyref.TypeToken; import java.awt.Color; import java.util.UUID; import org.jetbrains.annotations.ApiStatus; @@ -39,6 +42,22 @@ @ModuleDefinition(id = "colored_fire", name = "Colored Fire") public abstract class ColoredFireModule extends ApolloModule { + /** + * Whether fire colors should persist when a player unloads from the tracker. + * + * @since 1.2.7 + */ + public static final SimpleOption PERSIST_COLORS_ON_UNLOAD = Option.builder() + .comment("Set to 'true' to keep fire colors when players unload from the tracker, otherwise 'false'.") + .node("persist-colors-on-unload").type(TypeToken.get(Boolean.class)) + .defaultValue(false).notifyClient().build(); + + ColoredFireModule() { + this.registerOptions( + ColoredFireModule.PERSIST_COLORS_ON_UNLOAD + ); + } + @Override public boolean isClientNotify() { return true; diff --git a/docs/developers/lightweight/json/packet-util.mdx b/docs/developers/lightweight/json/packet-util.mdx index cbb8ef03..0dd5b73e 100644 --- a/docs/developers/lightweight/json/packet-util.mdx +++ b/docs/developers/lightweight/json/packet-util.mdx @@ -33,6 +33,7 @@ private static final Table CONFIG_MODULE_PROPERTIES = Ha static { // Module Options the client needs to be notified about. These properties are sent with the enable module packet. // While using the Apollo plugin this would be equivalent to modifying the config.yml + CONFIG_MODULE_PROPERTIES.put("colored_fire", "persist-colors-on-unload", false); CONFIG_MODULE_PROPERTIES.put("combat", "disable-miss-penalty", false); CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-attack.send-packet", false); CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-chat-open.send-packet", false); diff --git a/docs/developers/lightweight/protobuf/packet-util.mdx b/docs/developers/lightweight/protobuf/packet-util.mdx index bca907ab..7290d308 100644 --- a/docs/developers/lightweight/protobuf/packet-util.mdx +++ b/docs/developers/lightweight/protobuf/packet-util.mdx @@ -33,6 +33,7 @@ private static final Table CONFIG_MODULE_PROPERTIES = Has static { // Module Options the client needs to be notified about. These properties are sent with the enable module packet. // While using the Apollo plugin this would be equivalent to modifying the config.yml + CONFIG_MODULE_PROPERTIES.put("colored_fire", "persist-colors-on-unload", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("combat", "disable-miss-penalty", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-attack.send-packet", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-chat-open.send-packet", Value.newBuilder().setBoolValue(false).build()); diff --git a/example/bukkit/json/src/main/java/com/lunarclient/apollo/example/json/util/JsonPacketUtil.java b/example/bukkit/json/src/main/java/com/lunarclient/apollo/example/json/util/JsonPacketUtil.java index d6ff7b8f..c2c03685 100644 --- a/example/bukkit/json/src/main/java/com/lunarclient/apollo/example/json/util/JsonPacketUtil.java +++ b/example/bukkit/json/src/main/java/com/lunarclient/apollo/example/json/util/JsonPacketUtil.java @@ -51,6 +51,7 @@ public final class JsonPacketUtil { static { // Module Options the client needs to be notified about. These properties are sent with the enable module packet. // While using the Apollo plugin this would be equivalent to modifying the config.yml + CONFIG_MODULE_PROPERTIES.put("colored_fire", "persist-colors-on-unload", false); CONFIG_MODULE_PROPERTIES.put("combat", "disable-miss-penalty", false); CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-attack.send-packet", false); CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-chat-open.send-packet", false); diff --git a/example/bukkit/proto/src/main/java/com/lunarclient/apollo/example/proto/util/ProtobufPacketUtil.java b/example/bukkit/proto/src/main/java/com/lunarclient/apollo/example/proto/util/ProtobufPacketUtil.java index f719ecfc..97bea1c8 100644 --- a/example/bukkit/proto/src/main/java/com/lunarclient/apollo/example/proto/util/ProtobufPacketUtil.java +++ b/example/bukkit/proto/src/main/java/com/lunarclient/apollo/example/proto/util/ProtobufPacketUtil.java @@ -52,6 +52,7 @@ public final class ProtobufPacketUtil { static { // Module Options the client needs to be notified about. These properties are sent with the enable module packet. // While using the Apollo plugin this would be equivalent to modifying the config.yml + CONFIG_MODULE_PROPERTIES.put("colored_fire", "persist-colors-on-unload", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("combat", "disable-miss-penalty", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-attack.send-packet", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-chat-open.send-packet", Value.newBuilder().setBoolValue(false).build());