Skip to content

Commit 908271d

Browse files
authored
Add PERSIST_COLORS_ON_UNLOAD to ColoredFireModule (#281)
1 parent 06a5855 commit 908271d

5 files changed

Lines changed: 23 additions & 0 deletions

File tree

api/src/main/java/com/lunarclient/apollo/module/coloredfire/ColoredFireModule.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525

2626
import com.lunarclient.apollo.module.ApolloModule;
2727
import com.lunarclient.apollo.module.ModuleDefinition;
28+
import com.lunarclient.apollo.option.Option;
29+
import com.lunarclient.apollo.option.SimpleOption;
2830
import com.lunarclient.apollo.recipients.Recipients;
31+
import io.leangen.geantyref.TypeToken;
2932
import java.awt.Color;
3033
import java.util.UUID;
3134
import org.jetbrains.annotations.ApiStatus;
@@ -39,6 +42,22 @@
3942
@ModuleDefinition(id = "colored_fire", name = "Colored Fire")
4043
public abstract class ColoredFireModule extends ApolloModule {
4144

45+
/**
46+
* Whether fire colors should persist when a player unloads from the tracker.
47+
*
48+
* @since 1.2.7
49+
*/
50+
public static final SimpleOption<Boolean> PERSIST_COLORS_ON_UNLOAD = Option.<Boolean>builder()
51+
.comment("Set to 'true' to keep fire colors when players unload from the tracker, otherwise 'false'.")
52+
.node("persist-colors-on-unload").type(TypeToken.get(Boolean.class))
53+
.defaultValue(false).notifyClient().build();
54+
55+
ColoredFireModule() {
56+
this.registerOptions(
57+
ColoredFireModule.PERSIST_COLORS_ON_UNLOAD
58+
);
59+
}
60+
4261
@Override
4362
public boolean isClientNotify() {
4463
return true;

docs/developers/lightweight/json/packet-util.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ private static final Table<String, String, Object> CONFIG_MODULE_PROPERTIES = Ha
3333
static {
3434
// Module Options the client needs to be notified about. These properties are sent with the enable module packet.
3535
// While using the Apollo plugin this would be equivalent to modifying the config.yml
36+
CONFIG_MODULE_PROPERTIES.put("colored_fire", "persist-colors-on-unload", false);
3637
CONFIG_MODULE_PROPERTIES.put("combat", "disable-miss-penalty", false);
3738
CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-attack.send-packet", false);
3839
CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-chat-open.send-packet", false);

docs/developers/lightweight/protobuf/packet-util.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ private static final Table<String, String, Value> CONFIG_MODULE_PROPERTIES = Has
3333
static {
3434
// Module Options the client needs to be notified about. These properties are sent with the enable module packet.
3535
// While using the Apollo plugin this would be equivalent to modifying the config.yml
36+
CONFIG_MODULE_PROPERTIES.put("colored_fire", "persist-colors-on-unload", Value.newBuilder().setBoolValue(false).build());
3637
CONFIG_MODULE_PROPERTIES.put("combat", "disable-miss-penalty", Value.newBuilder().setBoolValue(false).build());
3738
CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-attack.send-packet", Value.newBuilder().setBoolValue(false).build());
3839
CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-chat-open.send-packet", Value.newBuilder().setBoolValue(false).build());

example/bukkit/json/src/main/java/com/lunarclient/apollo/example/json/util/JsonPacketUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public final class JsonPacketUtil {
5151
static {
5252
// Module Options the client needs to be notified about. These properties are sent with the enable module packet.
5353
// While using the Apollo plugin this would be equivalent to modifying the config.yml
54+
CONFIG_MODULE_PROPERTIES.put("colored_fire", "persist-colors-on-unload", false);
5455
CONFIG_MODULE_PROPERTIES.put("combat", "disable-miss-penalty", false);
5556
CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-attack.send-packet", false);
5657
CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-chat-open.send-packet", false);

example/bukkit/proto/src/main/java/com/lunarclient/apollo/example/proto/util/ProtobufPacketUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public final class ProtobufPacketUtil {
5252
static {
5353
// Module Options the client needs to be notified about. These properties are sent with the enable module packet.
5454
// While using the Apollo plugin this would be equivalent to modifying the config.yml
55+
CONFIG_MODULE_PROPERTIES.put("colored_fire", "persist-colors-on-unload", Value.newBuilder().setBoolValue(false).build());
5556
CONFIG_MODULE_PROPERTIES.put("combat", "disable-miss-penalty", Value.newBuilder().setBoolValue(false).build());
5657
CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-attack.send-packet", Value.newBuilder().setBoolValue(false).build());
5758
CONFIG_MODULE_PROPERTIES.put("packet_enrichment", "player-chat-open.send-packet", Value.newBuilder().setBoolValue(false).build());

0 commit comments

Comments
 (0)