3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 22:02:50 +02:00

Some javadoc changes

Dieser Commit ist enthalten in:
KennyTV 2020-04-24 11:39:11 +02:00
Ursprung 32826467d3
Commit 4b9a15b003
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
4 geänderte Dateien mit 22 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -2,6 +2,7 @@ package us.myles.ViaVersion;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.platform.ViaConnectionManager;
import us.myles.ViaVersion.api.platform.ViaInjector;
import us.myles.ViaVersion.api.platform.ViaPlatform;
import us.myles.ViaVersion.api.platform.ViaPlatformLoader;
@ -130,6 +131,9 @@ public class ViaManager {
return platform.getConnectionManager().getConnectedClients();
}
/**
* @see ViaConnectionManager#isClientConnected(UUID)
*/
public boolean isClientConnected(UUID player) {
return platform.getConnectionManager().isClientConnected(player);
}
@ -176,6 +180,9 @@ public class ViaManager {
return subPlatforms;
}
/**
* @see ViaConnectionManager#getConnectedClient(UUID)
*/
public UserConnection getConnection(UUID playerUUID) {
return platform.getConnectionManager().getConnectedClient(playerUUID);
}

Datei anzeigen

@ -7,7 +7,6 @@ import us.myles.ViaVersion.api.platform.ViaPlatform;
public class Via {
private static ViaPlatform platform;
private static ViaManager manager;
private static boolean cacheJsonMappings;
/**
* Register the ViaManager associated with the platform.

Datei anzeigen

@ -38,8 +38,8 @@ public interface ViaAPI<T> {
*
* @param playerUUID UUID of a player
* @return true if Via has a cached userconnection for this player
* @deprecated as of 0.9.9, because all players are ported use {@link #getPlayerVersion(UUID)},
* or use {@link #isInjected(UUID)}
* @deprecated use {@link #isInjected(UUID)}
* @see #isInjected(UUID)
*/
@Deprecated
default boolean isPorted(UUID playerUUID) {
@ -66,18 +66,18 @@ public interface ViaAPI<T> {
*
* @param player Platform player object, eg. Bukkit this is Player
* @param packet The packet, you need a VarInt ID then the packet contents.
* @throws IllegalArgumentException If not on 1.9 throws IllegalArg
* @throws IllegalArgumentException if the player is not injected by Via
*/
void sendRawPacket(T player, ByteBuf packet) throws IllegalArgumentException;
void sendRawPacket(T player, ByteBuf packet);
/**
* Send a raw packet to the player (Use new IDs)
*
* @param uuid The uuid from the player to send packet
* @param packet The packet, you need a VarInt ID then the packet contents.
* @throws IllegalArgumentException If not on 1.9 throws IllegalArg
* @throws IllegalArgumentException if the player is not injected by Via
*/
void sendRawPacket(UUID uuid, ByteBuf packet) throws IllegalArgumentException;
void sendRawPacket(UUID uuid, ByteBuf packet);
/**
* Create a new bossbar instance

Datei anzeigen

@ -47,6 +47,9 @@ public class ViaConnectionManager {
* Returns null when there isn't a server or connection was not found
* When ViaVersion is reloaded, this method may not return some players.
* May not return ProtocolSupport players.
* <p>
* Note that connections are removed as soon as their channel is closed,
* so avoid using this method during player quits for example.
*/
public UserConnection getConnectedClient(UUID clientIdentifier) {
return clients.get(clientIdentifier);
@ -63,6 +66,12 @@ public class ViaConnectionManager {
return Collections.unmodifiableSet(connections);
}
/**
* Returns if Via injected into this player connection.
*
* @param playerId player uuid
* @return true if the player is handled by Via
*/
public boolean isClientConnected(UUID playerId) {
return clients.containsKey(playerId);
}