mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-02-26 00:21:25 +01:00
Some javadoc changes
This commit is contained in:
parent
32826467d3
commit
4b9a15b003
@ -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);
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user