1818 * <p>
1919 * A character may or may not be backed by a real server entity, depending on
2020 * provider capabilities and spawn state.
21+ *
22+ * @since 2.2.0
2123 */
2224public interface Character {
2325 /**
@@ -26,20 +28,23 @@ public interface Character {
2628 * @param location the {@code Location} to which the character will be teleported
2729 * @return a {@code CompletableFuture} that resolves to {@code true} if the teleportation was
2830 * successful, or {@code false} otherwise
31+ * @since 2.2.0
2932 */
3033 CompletableFuture <Boolean > teleportAsync (Location location );
3134
3235 /**
3336 * Retrieves the name of the character.
3437 *
3538 * @return the name of the character
39+ * @since 3.0.0
3640 */
3741 String getName ();
3842
3943 /**
4044 * Checks if this character is persistent.
4145 *
4246 * @return {@code true} if this character is persistent, {@code false} otherwise
47+ * @since 3.0.0
4348 */
4449 boolean isPersistent ();
4550
@@ -48,27 +53,31 @@ public interface Character {
4853 *
4954 * @param persistent {@code true} if this character should be persistent, {@code false} otherwise
5055 * @return {@code true} if the persistence was changed, {@code false} otherwise
56+ * @since 3.0.0
5157 */
5258 boolean setPersistent (boolean persistent );
5359
5460 /**
5561 * Persists this character.
5662 *
5763 * @return {@code true} if the character was persisted, {@code false} otherwise
64+ * @since 3.0.0
5865 */
5966 boolean persist ();
6067
6168 /**
6269 * Retrieves the display name of the character.
6370 *
6471 * @return the {@code Component} representing the display name of the character
72+ * @since 2.2.0
6573 */
6674 Component getDisplayName ();
6775
6876 /**
6977 * Retrieves the type of entity associated with the character.
7078 *
7179 * @return the entity type of the character
80+ * @since 2.2.0
7281 */
7382 EntityType getType ();
7483
@@ -77,6 +86,7 @@ public interface Character {
7786 *
7887 * @return the current location, or an empty {@code Optional} if it is not
7988 * available
89+ * @since 3.0.0
8090 */
8191 Optional <Location > getLocation ();
8292
@@ -85,6 +95,7 @@ public interface Character {
8595 *
8696 * @return the current world, or an empty {@code Optional} if it is not
8797 * available
98+ * @since 3.0.0
8899 */
89100 Optional <World > getWorld ();
90101
@@ -98,13 +109,15 @@ public interface Character {
98109 *
99110 * @return an {@code Optional} containing the associated entity, or an empty {@code Optional}
100111 * if no entity is associated with the character
112+ * @since 3.0.0
101113 */
102114 Optional <Entity > getEntity ();
103115
104116 /**
105117 * Retrieves an unmodifiable set of players currently tracking this character.
106118 *
107119 * @return the players currently tracking this character
120+ * @since 3.0.0
108121 */
109122 @ Unmodifiable
110123 Set <Player > getTrackedBy ();
@@ -114,6 +127,7 @@ public interface Character {
114127 * of this character.
115128 *
116129 * @return the configured viewers of this character
130+ * @since 3.0.0
117131 */
118132 @ Unmodifiable
119133 Set <Player > getViewers ();
@@ -123,6 +137,7 @@ public interface Character {
123137 *
124138 * @param player the player to add
125139 * @return {@code true} if the viewer was added, {@code false} otherwise
140+ * @since 3.0.0
126141 */
127142 boolean addViewer (Player player );
128143
@@ -131,6 +146,7 @@ public interface Character {
131146 *
132147 * @param players the players to add
133148 * @return {@code true} if any viewers were added, {@code false} otherwise
149+ * @since 3.0.0
134150 */
135151 boolean addViewers (Collection <Player > players );
136152
@@ -139,6 +155,7 @@ public interface Character {
139155 *
140156 * @param player the player to check
141157 * @return {@code true} if the player is tracking this character, {@code false} otherwise
158+ * @since 3.0.0
142159 */
143160 boolean isTrackedBy (Player player );
144161
@@ -148,13 +165,15 @@ public interface Character {
148165 * @param player the player to check
149166 * @return {@code true} if the player currently qualifies to see this
150167 * character, {@code false} otherwise
168+ * @since 3.0.0
151169 */
152170 boolean canSee (Player player );
153171
154172 /**
155173 * Checks if this character is visible by default.
156174 *
157175 * @return {@code true} if this character is visible by default, {@code false} otherwise
176+ * @since 3.0.0
158177 */
159178 boolean isVisibleByDefault ();
160179
@@ -163,6 +182,7 @@ public interface Character {
163182 *
164183 * @param player the player to remove
165184 * @return {@code true} if the viewer was removed, {@code false} otherwise
185+ * @since 3.0.0
166186 */
167187 boolean removeViewer (Player player );
168188
@@ -171,20 +191,23 @@ public interface Character {
171191 *
172192 * @param players the players to remove
173193 * @return {@code true} if any viewers were removed, {@code false} otherwise
194+ * @since 3.0.0
174195 */
175196 boolean removeViewers (Collection <Player > players );
176197
177198 /**
178199 * Retrieves the display range of this character.
179200 *
180201 * @return the display range
202+ * @since 3.0.0
181203 */
182204 double getDisplayRange ();
183205
184206 /**
185207 * Sets the display range of this character.
186208 *
187209 * @param range the new display range
210+ * @since 3.0.0
188211 */
189212 void setDisplayRange (double range );
190213
@@ -193,48 +216,55 @@ public interface Character {
193216 *
194217 * @param visible {@code true} if this character should be visible by default, {@code false} otherwise
195218 * @return {@code true} if the visibility was changed, {@code false} otherwise
219+ * @since 3.0.0
196220 */
197221 boolean setVisibleByDefault (boolean visible );
198222
199223 /**
200224 * Despawns the character, effectively removing it from the world or rendering it inactive.
201225 *
202226 * @return {@code true} if the character was successfully despawned, otherwise {@code false}
227+ * @since 2.2.0
203228 */
204229 boolean despawn ();
205230
206231 /**
207232 * Checks if the character is collidable, meaning it can interact physically with other entities.
208233 *
209234 * @return {@code true} if the character is collidable, otherwise {@code false}
235+ * @since 2.2.0
210236 */
211237 boolean isCollidable ();
212238
213239 /**
214240 * Checks if the character is invulnerable.
215241 *
216242 * @return {@code true} if the character is invulnerable, otherwise {@code false}
243+ * @since 2.2.0
217244 */
218245 boolean isInvulnerable ();
219246
220247 /**
221248 * Checks if the character is currently spawned in the world.
222249 *
223250 * @return {@code true} if the character is spawned, otherwise {@code false}
251+ * @since 2.2.0
224252 */
225253 boolean isSpawned ();
226254
227255 /**
228256 * Checks whether the tablist entry for the character is currently hidden.
229257 *
230258 * @return {@code true} if the tablist entry is hidden, otherwise {@code false}
259+ * @since 2.2.0
231260 */
232261 boolean isTablistEntryHidden ();
233262
234263 /**
235264 * Respawns the character, bringing it back to the world if it was previously despawned.
236265 *
237266 * @return {@code true} if the character was successfully respawned, otherwise {@code false}
267+ * @since 2.2.0
238268 */
239269 boolean respawn ();
240270
@@ -243,26 +273,31 @@ public interface Character {
243273 *
244274 * @param location the {@code Location} where the character will be spawned
245275 * @return {@code true} if the character was successfully spawned, otherwise {@code false}
276+ * @since 2.2.0
246277 */
247278 boolean spawn (Location location );
248279
249280 /**
250281 * Adjusts the character's orientation to face the given entity.
251282 *
252283 * @param entity the {@code Entity} that the character should face
284+ * @since 2.2.0
253285 */
254286 void lookAt (Entity entity );
255287
256288 /**
257289 * Adjusts the character's orientation to face the specified location.
258290 *
259291 * @param location the {@code Location} that the character should face
292+ * @since 2.2.0
260293 */
261294 void lookAt (Location location );
262295
263296 /**
264297 * Permanently removes the character, rendering it inaccessible and removing all associated data.
265298 * After invoking this method, the character can't be respawned or interacted with.
299+ *
300+ * @since 2.2.0
266301 */
267302 void remove ();
268303
@@ -271,27 +306,31 @@ public interface Character {
271306 * with other entities in the world.
272307 *
273308 * @param collidable {@code true} to make the character collidable, allowing physical interactions
309+ * @since 2.2.0
274310 */
275311 void setCollidable (boolean collidable );
276312
277313 /**
278314 * Sets the display name for the character.
279315 *
280316 * @param displayName the {@code Component} representing the new display name to be set
317+ * @since 2.2.0
281318 */
282319 void setDisplayName (Component displayName );
283320
284321 /**
285322 * Sets whether the character should be invulnerable.
286323 *
287324 * @param invulnerable {@code true} if the character should be invulnerable, {@code false} otherwise
325+ * @since 2.2.0
288326 */
289327 void setInvulnerable (boolean invulnerable );
290328
291329 /**
292330 * Sets the visibility state of the character's tablist entry.
293331 *
294332 * @param hidden {@code true} to hide the tablist entry, {@code false} to make it visible
333+ * @since 2.2.0
295334 */
296335 void setTablistEntryHidden (boolean hidden );
297336}
0 commit comments