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

make the api the plugin

This commit is contained in:
2026-04-02 16:35:45 +04:00
parent c6a45e6b0c
commit 42e8a861a3
12 changed files with 186 additions and 57 deletions

View File

@@ -27,7 +27,7 @@ dependencies {
api(libs.protobuf)
api(libs.caffeine)
api(libs.slf4j)
api(libs.redisson)
testImplementation(libs.testing.juipter)
testImplementation(libs.testing.slf4j.simple)
}

View File

@@ -33,12 +33,12 @@ import org.slf4j.Logger;
* locally Why abstract? Because it allows us to develop alternative implementation to use other
* software than valkey or redis
*/
public abstract class ProxyManager {
public abstract class ProxyNetworkManager {
protected final UUID proxyManagerId = UUID.randomUUID();
protected final ValioBungeePlatform platform;
public ProxyManager(ValioBungeePlatform platform) {
public ProxyNetworkManager(ValioBungeePlatform platform) {
this.platform = platform;
}

View File

@@ -18,10 +18,9 @@
*/
package net.limework.valiobungee.core;
import net.limework.valiobungee.api.ValioBungeeAPIProvider;
import net.limework.valiobungee.core.api.entities.NetworkEntitiesProvider;
import net.limework.valiobungee.api.ValioBungeeAPI;
public interface ValioBungeePlatform extends NetworkEntitiesProvider, ValioBungeeAPIProvider {
public interface ValioBungeePlatform extends ValioBungeeAPI {
int localOnlinePlayers();
@@ -31,7 +30,7 @@ public interface ValioBungeePlatform extends NetworkEntitiesProvider, ValioBunge
String proxyId();
ProxyManager proxyManager();
ProxyNetworkManager proxyNetworkManager();
@Override
default String getGitCommit() {

View File

@@ -1,23 +0,0 @@
/*
* Copyright (c) 2026 ValioBungee contributors
*
* This file is part of ValioBungee.
*
* ValioBungee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ValioBungee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ValioBungee. If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
*/
package net.limework.valiobungee.core.api;
import net.limework.valiobungee.api.ValioBungeeAPI;
public class AbstractValioBungeeAPI implements ValioBungeeAPI {}

View File

@@ -39,8 +39,8 @@ public abstract class AbstractNetworkProxy implements NetworkProxy {
}
@Override
public int onlinePlayersCount() {
return this.platform.proxyManager().onlinePlayersCount(this.proxyId);
public int onlinePlayerCount() {
return this.platform.proxyNetworkManager().onlinePlayersCount(this.proxyId);
}
@Override

View File

@@ -1,32 +0,0 @@
/*
* Copyright (c) 2026 ValioBungee contributors
*
* This file is part of ValioBungee.
*
* ValioBungee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ValioBungee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ValioBungee. If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
*/
package net.limework.valiobungee.core.api.entities;
import java.util.UUID;
import net.limework.valiobungee.api.entity.NetworkPlayer;
import net.limework.valiobungee.api.entity.NetworkProxy;
public interface NetworkEntitiesProvider {
NetworkPlayer getNetworkPlayer(UUID uuid);
NetworkProxy getNetworkProxy(String id);
NetworkProxy getSelfProxy();
}