File tree Expand file tree Collapse file tree 3 files changed +30
-5
lines changed
api/src/main/java/com/lunarclient/apollo/module/glow
common/src/main/java/com/lunarclient/apollo/module/glow Expand file tree Collapse file tree 3 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,20 @@ public boolean isClientNotify() {
4747 /**
4848 * Overrides the glow effect for the glowingPlayer, visible by the viewers.
4949 *
50+ * <p>If no color is specified, the glowing color will match the player's scoreboard team color.</p>
51+ *
52+ *
53+ * @param recipients the recipients that are receiving the packet
54+ * @param glowingPlayer the UUID of the player whose glowing effect will be overwrote
55+ * @since 1.1.9
56+ */
57+ public abstract void overrideGlow (Recipients recipients , UUID glowingPlayer );
58+
59+ /**
60+ * Overrides the glow effect for the glowingPlayer, visible by the viewers.
61+ *
62+ * <p>If the {@code color} parameter is {@code null}, the glowing color will match the player's scoreboard team color.</p>
63+ *
5064 * @param recipients the recipients that are receiving the packet
5165 * @param glowingPlayer the UUID of the player whose glowing effect will be overwrote
5266 * @param color the new color glowingPlayer should glow in.
Original file line number Diff line number Diff line change 3232import java .awt .Color ;
3333import java .util .UUID ;
3434import lombok .NonNull ;
35+ import org .jetbrains .annotations .Nullable ;
3536
3637/**
3738 * Provides the glow module.
4142public final class GlowModuleImpl extends GlowModule {
4243
4344 @ Override
44- public void overrideGlow (@ NonNull Recipients recipients , @ NonNull UUID glowingPlayer , @ NonNull Color color ) {
45- OverrideGlowEffectMessage message = OverrideGlowEffectMessage .newBuilder ()
46- .setPlayerUuid (NetworkTypes .toProtobuf (glowingPlayer ))
47- .setColor (NetworkTypes .toProtobuf (color ))
48- .build ();
45+ public void overrideGlow (@ NonNull Recipients recipients , @ NonNull UUID glowingPlayer ) {
46+ this .overrideGlow (recipients , glowingPlayer , null );
47+ }
48+
49+ @ Override
50+ public void overrideGlow (@ NonNull Recipients recipients , @ NonNull UUID glowingPlayer , @ Nullable Color color ) {
51+ OverrideGlowEffectMessage .Builder builder = OverrideGlowEffectMessage .newBuilder ()
52+ .setPlayerUuid (NetworkTypes .toProtobuf (glowingPlayer ));
53+
54+ if (color != null ) {
55+ builder .setColor (NetworkTypes .toProtobuf (color ));
56+ }
4957
58+ OverrideGlowEffectMessage message = builder .build ();
5059 recipients .forEach (player -> ((AbstractApolloPlayer ) player ).sendPacket (message ));
5160 }
5261
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ The glow module allows you to take advantage of the vanilla Minecraft Glow Effec
1010- Backports all vanilla Minecraft glow effect functionality, found on 1.9+ to the 1.7 and 1.8 version of Lunar Client.
1111- Adds improvements to glow effect for Lunar Client users.
1212 - Customizable colors for the glow effect, different from the vanilla Minecraft colors.
13+ - If no color is specified, the glow effect will default to the player's scoreboard team color.
1314
1415<Callout type = " Warning" >
1516 In Version 1.12, Optifine's 'Fast Render' setting alters player rendering. This is expected behavior for Optifine.
@@ -65,6 +66,7 @@ public void resetGlowEffectsExample(Player viewer) {
65662 . ` UUID target `
6667 - The player or living entity you want to display the glow effect on.
67683 . ` Color glowColor `
69+ - If ` null ` is passed (or if no color is specified), the glow effect will default to the target's scoreboard team color.
6870 - How you'll dictate the color of the glow effect, see the [ colors page] ( /apollo/developers/utilities/colors ) for more.
6971
7072</Tab >
You can’t perform that action at this time.
0 commit comments