Skip to content

Commit a12ad3d

Browse files
committed
Merge branch 'version/1.2.5' into feature/installed-mods-api
2 parents 68a233d + 22e0c1d commit a12ad3d

55 files changed

Lines changed: 2110 additions & 262 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* This file is part of Apollo, licensed under the MIT License.
3+
*
4+
* Copyright (c) 2026 Moonsworth
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package com.lunarclient.apollo.common.icon;
25+
26+
import lombok.Builder;
27+
import lombok.Getter;
28+
29+
/**
30+
* Represents a resource location icon.
31+
*
32+
* @since 1.2.5
33+
*/
34+
@Getter
35+
@Builder
36+
public final class ResourceLocationIcon extends Icon {
37+
38+
/**
39+
* Returns the icon {@link String} resource location.
40+
*
41+
* <p>Represents a path to an icon that will appear for the player.</p>
42+
*
43+
* @return the icon resource location
44+
* @since 1.2.5
45+
*/
46+
String resourceLocation;
47+
48+
}

api/src/main/java/com/lunarclient/apollo/module/cooldown/Cooldown.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.time.Duration;
2828
import lombok.Builder;
2929
import lombok.Getter;
30+
import org.jetbrains.annotations.Nullable;
3031

3132
/**
3233
* Represents a cooldown which can be shown on the client.
@@ -64,4 +65,14 @@ public final class Cooldown {
6465
*/
6566
Icon icon;
6667

68+
/**
69+
* Returns the cooldown {@link CooldownStyle}.
70+
*
71+
* <p>If {@code null}, the style defaults to the user's local Cooldown Mod settings.</p>
72+
*
73+
* @return the cooldown style
74+
* @since 1.2.5
75+
*/
76+
@Nullable CooldownStyle style;
77+
6778
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* This file is part of Apollo, licensed under the MIT License.
3+
*
4+
* Copyright (c) 2026 Moonsworth
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package com.lunarclient.apollo.module.cooldown;
25+
26+
import java.awt.Color;
27+
import lombok.Builder;
28+
import lombok.Getter;
29+
import org.jetbrains.annotations.Nullable;
30+
31+
/**
32+
* Represents the {@link Cooldown} style, allowing customization of the circle start, end, edge & text color.
33+
*
34+
* @since 1.2.5
35+
*/
36+
@Getter
37+
@Builder
38+
public final class CooldownStyle {
39+
40+
/**
41+
* Returns the cooldown circle start {@link Color}.
42+
*
43+
* @return the circle start color
44+
* @since 1.2.5
45+
*/
46+
@Nullable Color circleStartColor;
47+
48+
/**
49+
* Returns the cooldown circle end {@link Color}.
50+
*
51+
* @return the circle end color
52+
* @since 1.2.5
53+
*/
54+
@Nullable Color circleEndColor;
55+
56+
/**
57+
* Returns the cooldown circle edge {@link Color}.
58+
*
59+
* @return the circle edge color
60+
* @since 1.2.5
61+
*/
62+
@Nullable Color circleEdgeColor;
63+
64+
/**
65+
* Returns the cooldown text {@link Color}.
66+
*
67+
* @return the text color
68+
* @since 1.2.5
69+
*/
70+
@Nullable Color textColor;
71+
72+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* This file is part of Apollo, licensed under the MIT License.
3+
*
4+
* Copyright (c) 2026 Moonsworth
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package com.lunarclient.apollo.module.serverlink;
25+
26+
import lombok.Builder;
27+
import lombok.Getter;
28+
import net.kyori.adventure.text.Component;
29+
30+
/**
31+
* Represents a link entry displayed in the Server Links menu.
32+
*
33+
* @since 1.2.5
34+
*/
35+
@Getter
36+
@Builder
37+
public final class ServerLink {
38+
39+
/**
40+
* Returns the server link {@link String} id.
41+
*
42+
* @return the server link id
43+
* @since 1.2.5
44+
*/
45+
String id;
46+
47+
/**
48+
* Returns the server link {@link Component} display name.
49+
*
50+
* @return the server link display name
51+
* @since 1.2.5
52+
*/
53+
Component displayName;
54+
55+
/**
56+
* Returns the server link {@link String} url.
57+
*
58+
* @return the server link url
59+
* @since 1.2.5
60+
*/
61+
String url;
62+
63+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/*
2+
* This file is part of Apollo, licensed under the MIT License.
3+
*
4+
* Copyright (c) 2026 Moonsworth
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package com.lunarclient.apollo.module.serverlink;
25+
26+
import com.lunarclient.apollo.common.icon.ResourceLocationIcon;
27+
import com.lunarclient.apollo.module.ApolloModule;
28+
import com.lunarclient.apollo.module.ModuleDefinition;
29+
import com.lunarclient.apollo.recipients.Recipients;
30+
import java.util.List;
31+
import org.jetbrains.annotations.ApiStatus;
32+
33+
/**
34+
* Represents the server links module.
35+
*
36+
* <p>This module provides support for the Server Links feature introduced in
37+
* Minecraft 1.21.0, with compatibility extending down to version 1.7.</p>
38+
*
39+
* @since 1.2.5
40+
*/
41+
@ApiStatus.NonExtendable
42+
@ModuleDefinition(id = "server_link", name = "Server Link")
43+
public abstract class ServerLinkModule extends ApolloModule {
44+
45+
/**
46+
* Overrides the server link menu title image for the {@link Recipients}.
47+
*
48+
* <p>The provided {@link ResourceLocationIcon} will be displayed in place of the default
49+
* menu title.</p>
50+
*
51+
* <p>The resource location must reference a valid client-side asset using the standard
52+
* namespace format:</p>
53+
*
54+
* <pre>
55+
* minecraft:textures/item/apple.png
56+
* lunar:logo/logo-100x100.png
57+
* </pre>
58+
*
59+
* <p>For optimal results, a square image (e.g. 128x128) is recommended.</p>
60+
*
61+
* @param recipients the recipients that are receiving the packet
62+
* @param icon the resource location icon
63+
* @since 1.2.5
64+
*/
65+
public abstract void overrideServerLinkResource(Recipients recipients, ResourceLocationIcon icon);
66+
67+
/**
68+
* Resets the server link menu title image for the {@link Recipients}.
69+
*
70+
* <p>Reverts back to displaying the default menu title.</p>
71+
*
72+
* @param recipients the recipients that are receiving the packet
73+
* @since 1.2.5
74+
*/
75+
public abstract void resetServerLinkResource(Recipients recipients);
76+
77+
/**
78+
* Adds or updates the {@link ServerLink} for the {@link Recipients}.
79+
*
80+
* @param recipients the recipients that are receiving the packet
81+
* @param serverLink the server link
82+
* @since 1.2.5
83+
*/
84+
public abstract void addServerLink(Recipients recipients, ServerLink serverLink);
85+
86+
/**
87+
* Adds or updates the {@link ServerLink}s for the {@link Recipients}.
88+
*
89+
* @param recipients the recipients that are receiving the packet
90+
* @param serverLinks the server links
91+
* @since 1.2.5
92+
*/
93+
public abstract void addServerLink(Recipients recipients, List<ServerLink> serverLinks);
94+
95+
/**
96+
* Removes the {@link ServerLink} from the {@link Recipients}.
97+
*
98+
* @param recipients the recipients that are receiving the packet
99+
* @param serverLinkId the server link id
100+
* @since 1.2.5
101+
*/
102+
public abstract void removeServerLink(Recipients recipients, String serverLinkId);
103+
104+
/**
105+
* Removes the {@link ServerLink} from the {@link Recipients}.
106+
*
107+
* @param recipients the recipients that are receiving the packet
108+
* @param serverLink the server link
109+
* @since 1.2.5
110+
*/
111+
public abstract void removeServerLink(Recipients recipients, ServerLink serverLink);
112+
113+
/**
114+
* Removes the {@link ServerLink}s from the {@link Recipients}.
115+
*
116+
* @param recipients the recipients that are receiving the packet
117+
* @param serverLinkIds the server link ids
118+
* @since 1.2.5
119+
*/
120+
public abstract void removeServerLink(Recipients recipients, List<String> serverLinkIds);
121+
122+
/**
123+
* Resets all {@link ServerLink}s for the {@link Recipients}.
124+
*
125+
* @param recipients the recipients that are receiving the packet
126+
* @since 1.2.5
127+
*/
128+
public abstract void resetServerLinks(Recipients recipients);
129+
130+
}

api/src/main/java/com/lunarclient/apollo/module/team/TeamMember.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import lombok.Builder;
3030
import lombok.Getter;
3131
import net.kyori.adventure.text.Component;
32+
import org.jetbrains.annotations.Nullable;
3233

3334
/**
3435
* Represents a team which can be shown on the client.
@@ -50,23 +51,25 @@ public final class TeamMember {
5051
/**
5152
* Returns the team member's {@link Component}.
5253
*
53-
* <p>The display name is only used when the player
54-
* is out of render distance for the observer and when the
55-
* observer hovers over the marker.</p>
54+
* <p>The display name is only shown when the player is outside
55+
* the observer's render distance and when the observer hovers
56+
* over the marker. If not provided, only the marker is displayed.</p>
5657
*
5758
* @return the team member's display name
5859
* @since 1.0.0
5960
*/
60-
Component displayName;
61+
@Nullable Component displayName;
6162

6263
/**
6364
* Returns the team member's assigned {@link Color} - this will be used
6465
* for any markers (such as on duration HUD, above head markers, etc).
6566
*
67+
* <p>If not provided, the default color {@code 0xFFFFFFFF} is used.</p>
68+
*
6669
* @return the team member's marker color
6770
* @since 1.0.0
6871
*/
69-
Color markerColor;
72+
@Nullable Color markerColor;
7073

7174
/**
7275
* Returns the team member's {@link ApolloLocation}.
@@ -78,6 +81,6 @@ public final class TeamMember {
7881
* @return the team member location
7982
* @since 1.0.0
8083
*/
81-
ApolloLocation location;
84+
@Nullable ApolloLocation location;
8285

8386
}

0 commit comments

Comments
 (0)