2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2026-04-08 16:10:26 +00:00

player manager

This commit is contained in:
2026-04-04 10:40:46 +04:00
parent f58a212782
commit c97de82970
17 changed files with 311 additions and 76 deletions

View File

@@ -21,18 +21,44 @@ import java.util.UUID;
import net.limework.valiobungee.api.entity.NetworkPlayer;
import net.limework.valiobungee.api.entity.NetworkProxy;
/**
* The api interface
*
* @author Ham1255
* @since 1.0.0
*/
public interface ValioBungeeAPI {
/**
* @param uuid of player
* @return {@link Optional} if empty player is offline and if present player on the network
*/
Optional<NetworkPlayer> getNetworkPlayer(UUID uuid);
/**
* @param id the proxy id
* @return {@link Optional} if empty the proxy doesn't exist if present it's an online proxy
*/
Optional<NetworkProxy> getNetworkProxy(String id);
/**
* @return the local proxy
*/
NetworkProxy getLocalProxy();
/**
* @return Returns the network proxies that is currently online including the local
*/
Set<NetworkProxy> getNetworkProxies();
/**
* @return the local players empty if no players
*/
Set<NetworkPlayer> getLocalProxyPlayers();
/**
* @return the network players empty if no players
*/
Set<NetworkPlayer> getNetworkPlayers();
/**

View File

@@ -15,6 +15,8 @@
*/
package net.limework.valiobungee.api.entity;
import java.util.UUID;
/**
* Network player.
*
@@ -33,7 +35,16 @@ public interface NetworkPlayer {
boolean isLocal();
/**
* This used when we already had the object but player went offline since getting a player as
* {@link java.util.Optional} we check if its present if not means offline see {@link
* net.limework.valiobungee.api.ValioBungeeAPI#getNetworkPlayer(UUID)}
*
* @return true when a player is online on the network
*/
boolean isOnline();
/**
* @return player unique id
*/
UUID getUniqueId();
}

View File

@@ -1,31 +0,0 @@
/*
* Copyright (c) 2026 ValioBungee contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.limework.valiobungee.api.entity;
import java.util.UUID;
/**
* Network player. that uses UUID as an ID
*
* @author Ham1255
* @since 1.0.0
*/
public interface UUIDPlayer {
/**
* @return player unique id
*/
UUID getUniqueId();
}

View File

@@ -18,7 +18,6 @@ package net.limework.valiobungee.velocity.api.entities;
import com.velocitypowered.api.proxy.Player;
import java.util.Optional;
import net.limework.valiobungee.api.entity.NetworkPlayer;
import net.limework.valiobungee.api.entity.UUIDPlayer;
/**
* Velocity Network player. hold specific stuff for velocity platform
@@ -26,7 +25,7 @@ import net.limework.valiobungee.api.entity.UUIDPlayer;
* @author Ham1255
* @since 1.0.0
*/
public interface VelocityNetworkPlayer extends NetworkPlayer, UUIDPlayer {
public interface VelocityNetworkPlayer extends NetworkPlayer {
/**
* @return an optional that contains a player if he is on the same proxy