-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathApolloPlayer.java
More file actions
158 lines (143 loc) · 5.02 KB
/
Copy pathApolloPlayer.java
File metadata and controls
158 lines (143 loc) · 5.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/*
* This file is part of Apollo, licensed under the MIT License.
*
* Copyright (c) 2026 Moonsworth
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.player;
import com.lunarclient.apollo.client.mod.LunarClientMod;
import com.lunarclient.apollo.client.version.LunarClientVersion;
import com.lunarclient.apollo.client.version.MinecraftVersion;
import com.lunarclient.apollo.common.location.ApolloLocation;
import com.lunarclient.apollo.module.modsetting.ModSettingModule;
import com.lunarclient.apollo.module.paynow.PayNowEmbeddedCheckoutSupport;
import com.lunarclient.apollo.module.tebex.TebexEmbeddedCheckoutSupport;
import com.lunarclient.apollo.option.Option;
import com.lunarclient.apollo.option.Options;
import com.lunarclient.apollo.recipients.Recipients;
import com.lunarclient.apollo.world.ApolloWorld;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import net.kyori.adventure.audience.ForwardingAudience;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
/**
* Represents a player on Apollo.
*
* @since 1.0.0
*/
@ApiStatus.NonExtendable
public interface ApolloPlayer extends Recipients, ForwardingAudience.Single {
/**
* Gets the players unique identifier.
*
* @return the players unique identifier
* @since 1.0.0
*/
UUID getUniqueId();
/**
* Gets the players name.
*
* @return the players name
* @since 1.0.0
*/
String getName();
/**
* Gets the players current world.
*
* @return the players current world
* @since 1.0.0
*/
Optional<ApolloWorld> getWorld();
/**
* Gets the players current location.
*
* @return the players current location
* @since 1.0.0
*/
Optional<ApolloLocation> getLocation();
/**
* Returns {@code true} if the player has the specified {@link String}
* permission from the provided {@link Option}, otherwise returns
* {@code false}.
*
* @param options the options container
* @param option the option
* @return true if the player has permission, otherwise false
* @since 1.0.0
*/
default boolean hasPermission(Options options, Option<String, ?, ?> option) {
String value = options.get(option);
return this.hasPermission(value);
}
/**
* Returns {@code true} if the player has the specified {@link String}
* permission, otherwise returns {@code false}.
*
* @param permissionNode the permission node
* @return true if the player has permission, otherwise false
* @since 1.0.0
*/
boolean hasPermission(String permissionNode);
/**
* Returns the player object associated with the platform.
*
* @return the associated player object
* @since 1.0.9
*/
Object getPlayer();
/**
* Returns the {@link MinecraftVersion} the player is running.
*
* @return the minecraft version
* @since 1.1.6
*/
@Nullable MinecraftVersion getMinecraftVersion();
/**
* Returns the {@link LunarClientVersion} the player is running.
*
* @return the lunar client version
* @since 1.1.6
*/
@Nullable LunarClientVersion getLunarClientVersion();
/**
* Returns a {@link List} of {@link LunarClientMod} the player has installed.
*
* @return the installed mods
* @deprecated for removal since 1.2.5, use {@link ModSettingModule#requestInstalledMods(ApolloPlayer)} instead.
* @since 1.1.6
*/
@Deprecated @Nullable List<LunarClientMod> getInstalledMods();
/**
* Returns the {@link TebexEmbeddedCheckoutSupport} type.
*
* @return the Tebex checkout support type
* @since 1.1.6
*/
@Nullable TebexEmbeddedCheckoutSupport getTebexEmbeddedCheckoutSupport();
/**
* Returns the {@link PayNowEmbeddedCheckoutSupport} type.
*
* @return the Pay Now checkout support type
* @since 1.2.1
*/
@Nullable PayNowEmbeddedCheckoutSupport getPayNowEmbeddedCheckoutSupport();
}