|
5 | 5 | import java.util.Set; |
6 | 6 | import java.util.UUID; |
7 | 7 |
|
| 8 | +/** |
| 9 | + * An interface holding all methods, which need a version specific implementation. |
| 10 | + */ |
8 | 11 | public interface VersionBridge { |
| 12 | + /** |
| 13 | + * Gets the mod version. |
| 14 | + * |
| 15 | + * @return Returns the mod version. |
| 16 | + */ |
9 | 17 | @NotNull String getVersion(); |
10 | 18 |
|
| 19 | + /** |
| 20 | + * Adds a message to the player chat. |
| 21 | + * |
| 22 | + * @param message The message. |
| 23 | + */ |
11 | 24 | void addMessageToChat(final @NotNull String message); |
12 | 25 |
|
| 26 | + /** |
| 27 | + * Checks if the player is not in a world. |
| 28 | + * |
| 29 | + * @return Returns {@code true} if the player is not in a world, else {@code false}. |
| 30 | + */ |
13 | 31 | boolean isNotInWorld(); |
14 | 32 |
|
| 33 | + /** |
| 34 | + * Gets a list with player wrappers with their game profile UUID and name for all players in the current world. |
| 35 | + * |
| 36 | + * @return Returns the list with player wrappers with all players in the world. |
| 37 | + */ |
15 | 38 | @NotNull List<@NotNull PlayerInfo> getWorldPlayers(); |
16 | 39 |
|
| 40 | + /** |
| 41 | + * Updates a player by its UUID. |
| 42 | + * |
| 43 | + * @param commonHandler The common handler. |
| 44 | + * @param uuid The player UUID. |
| 45 | + * @param oldPrefixes A Set with old prefixes. |
| 46 | + */ |
17 | 47 | void updatePlayerByUuid(final @NotNull CommonHandler commonHandler, final @NotNull UUID uuid, final @NotNull Set<@NotNull String> oldPrefixes); |
18 | 48 |
|
| 49 | + /** |
| 50 | + * Updates the prefixes for all players. |
| 51 | + * |
| 52 | + * @param commonHandler The common handler. |
| 53 | + * @param oldPrefixes A Set with old prefixes. |
| 54 | + */ |
19 | 55 | void updatePrefixes(final @NotNull CommonHandler commonHandler, final @NotNull Set<String> oldPrefixes); |
20 | 56 |
|
| 57 | + /** |
| 58 | + * Checks is the player list key is pressed. |
| 59 | + * |
| 60 | + * @return Returns {@code true} if the key is pressed, else {@code false}. |
| 61 | + */ |
21 | 62 | boolean isPlayerListKeyPressed(); |
22 | 63 |
|
| 64 | + /** |
| 65 | + * Wraps a given text in the version specific text component and unformat it for later possible comparison. |
| 66 | + * |
| 67 | + * @param text The text. |
| 68 | + * @return Returns the unformatted text. |
| 69 | + */ |
23 | 70 | @NotNull String wrapAndUnformatText(final @NotNull String text); |
24 | 71 | } |
0 commit comments