diff --git a/api/src/main/java/com/lunarclient/apollo/module/serverrule/ServerRuleModule.java b/api/src/main/java/com/lunarclient/apollo/module/serverrule/ServerRuleModule.java index 79a6a2de9..b7931ea71 100644 --- a/api/src/main/java/com/lunarclient/apollo/module/serverrule/ServerRuleModule.java +++ b/api/src/main/java/com/lunarclient/apollo/module/serverrule/ServerRuleModule.java @@ -165,6 +165,16 @@ public final class ServerRuleModule extends ApolloModule { .node("max-chat-length").type(TypeToken.get(Integer.class)) .defaultValue(256).min(1).max(256).notifyClient().build(); + /** + * Whether to enable crystal optimizer. + * + * @since 1.2.4 + */ + public static final SimpleOption CRYSTAL_OPTIMIZER = Option.builder() + .comment("Set to 'true' to enable the crystal optimizer, otherwise 'false'.") + .node("crystal-optimizer").type(TypeToken.get(Boolean.class)) + .defaultValue(false).notifyClient().build(); + ServerRuleModule() { this.registerOptions( ServerRuleModule.COMPETITIVE_GAME, @@ -178,7 +188,8 @@ public final class ServerRuleModule extends ApolloModule { ServerRuleModule.OVERRIDE_NAMETAG_RENDER_DISTANCE, ServerRuleModule.NAMETAG_RENDER_DISTANCE, ServerRuleModule.OVERRIDE_MAX_CHAT_LENGTH, - ServerRuleModule.MAX_CHAT_LENGTH + ServerRuleModule.MAX_CHAT_LENGTH, + ServerRuleModule.CRYSTAL_OPTIMIZER ); } diff --git a/docs/developers/lightweight/json/packet-util.mdx b/docs/developers/lightweight/json/packet-util.mdx index b7263a486..1a3a12e74 100644 --- a/docs/developers/lightweight/json/packet-util.mdx +++ b/docs/developers/lightweight/json/packet-util.mdx @@ -46,6 +46,7 @@ static { CONFIG_MODULE_PROPERTIES.put("server_rule", "nametag-render-distance", 64); CONFIG_MODULE_PROPERTIES.put("server_rule", "override-max-chat-length", false); CONFIG_MODULE_PROPERTIES.put("server_rule", "max-chat-length", 256); + CONFIG_MODULE_PROPERTIES.put("server_rule", "crystal-optimizer", false); CONFIG_MODULE_PROPERTIES.put("tnt_countdown", "tnt-ticks", 80); CONFIG_MODULE_PROPERTIES.put("title", "clear-title-on-server-switch", false); CONFIG_MODULE_PROPERTIES.put("waypoint", "server-handles-waypoints", false); diff --git a/docs/developers/lightweight/protobuf/packet-util.mdx b/docs/developers/lightweight/protobuf/packet-util.mdx index b74f9b56e..19ad54521 100644 --- a/docs/developers/lightweight/protobuf/packet-util.mdx +++ b/docs/developers/lightweight/protobuf/packet-util.mdx @@ -50,6 +50,7 @@ static { CONFIG_MODULE_PROPERTIES.put("server_rule", "nametag-render-distance", Value.newBuilder().setNumberValue(64).build()); CONFIG_MODULE_PROPERTIES.put("server_rule", "override-max-chat-length", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("server_rule", "max-chat-length", Value.newBuilder().setNumberValue(256).build()); + CONFIG_MODULE_PROPERTIES.put("server_rule", "crystal-optimizer", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("tnt_countdown", "tnt-ticks", Value.newBuilder().setNumberValue(80).build()); CONFIG_MODULE_PROPERTIES.put("title", "clear-title-on-server-switch", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("waypoint", "server-handles-waypoints", Value.newBuilder().setBoolValue(false).build()); diff --git a/docs/developers/modules/serverrule.mdx b/docs/developers/modules/serverrule.mdx index fb4e8fd01..16133b808 100644 --- a/docs/developers/modules/serverrule.mdx +++ b/docs/developers/modules/serverrule.mdx @@ -219,3 +219,9 @@ public void setNametagRenderDistanceExample(int value) { - Default: `256` - Minimum: `1` - Maximum: `256` + +- __`CRYSTAL_OPTIMIZER`__ + - Whether to enable crystal optimizer. + - Values + - Type: `Boolean` + - Default: `false` 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 57b945613..7b862ef50 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 @@ -64,6 +64,7 @@ public final class JsonPacketUtil { CONFIG_MODULE_PROPERTIES.put("server_rule", "nametag-render-distance", 64); CONFIG_MODULE_PROPERTIES.put("server_rule", "override-max-chat-length", false); CONFIG_MODULE_PROPERTIES.put("server_rule", "max-chat-length", 256); + CONFIG_MODULE_PROPERTIES.put("server_rule", "crystal-optimizer", false); CONFIG_MODULE_PROPERTIES.put("tnt_countdown", "tnt-ticks", 80); CONFIG_MODULE_PROPERTIES.put("title", "clear-title-on-server-switch", false); CONFIG_MODULE_PROPERTIES.put("waypoint", "server-handles-waypoints", 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 423d6214c..a9be9f648 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 @@ -71,6 +71,7 @@ public final class ProtobufPacketUtil { CONFIG_MODULE_PROPERTIES.put("server_rule", "nametag-render-distance", Value.newBuilder().setNumberValue(64).build()); CONFIG_MODULE_PROPERTIES.put("server_rule", "override-max-chat-length", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("server_rule", "max-chat-length", Value.newBuilder().setNumberValue(256).build()); + CONFIG_MODULE_PROPERTIES.put("server_rule", "crystal-optimizer", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("tnt_countdown", "tnt-ticks", Value.newBuilder().setNumberValue(80).build()); CONFIG_MODULE_PROPERTIES.put("title", "clear-title-on-server-switch", Value.newBuilder().setBoolValue(false).build()); CONFIG_MODULE_PROPERTIES.put("waypoint", "server-handles-waypoints", Value.newBuilder().setBoolValue(false).build());