RedisBungee/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/api/RedisBungeePlugin.java

97 lines
2.5 KiB
Java
Raw Normal View History

2022-10-29 20:02:09 +00:00
/*
* Copyright (c) 2013-present RedisBungee contributors
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
*
* http://www.eclipse.org/legal/epl-v10.html
*/
2022-07-16 12:50:09 +00:00
package com.imaginarycode.minecraft.redisbungee.api;
import com.imaginarycode.minecraft.redisbungee.AbstractRedisBungeeAPI;
import com.imaginarycode.minecraft.redisbungee.api.config.LangConfiguration;
import com.imaginarycode.minecraft.redisbungee.api.config.RedisBungeeConfiguration;
import com.imaginarycode.minecraft.redisbungee.api.events.EventsPlatform;
2022-07-16 12:50:09 +00:00
import com.imaginarycode.minecraft.redisbungee.api.summoners.Summoner;
import com.imaginarycode.minecraft.redisbungee.api.util.uuid.UUIDTranslator;
import net.kyori.adventure.text.Component;
import java.net.InetAddress;
2024-04-12 18:37:02 +00:00
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* This Class has all internal methods needed by every redis bungee plugin, and it can be used to implement another platforms than bungeecord or another forks of RedisBungee
* <p>
* Reason this is interface because some proxies implementations require the user to extend class for plugins for example bungeecord.
*
* @author Ham1255
* @since 0.7.0
*/
public interface RedisBungeePlugin<P> extends EventsPlatform {
2022-07-07 23:23:44 +00:00
default void initialize() {
2022-04-13 18:17:38 +00:00
}
default void stop() {
2022-04-13 18:17:38 +00:00
}
2024-04-12 18:37:02 +00:00
void logInfo(String msg);
2024-04-12 18:37:02 +00:00
void logInfo(String format, Object... object);
2024-04-12 18:37:02 +00:00
void logWarn(String msg);
2024-04-12 18:37:02 +00:00
void logWarn(String format, Object... object);
2024-04-12 18:37:02 +00:00
void logFatal(String msg);
2024-04-12 18:37:02 +00:00
void logFatal(String format, Throwable throwable);
2022-04-13 18:17:38 +00:00
2024-04-12 18:37:02 +00:00
RedisBungeeConfiguration configuration();
LangConfiguration langConfiguration();
2024-04-12 18:37:02 +00:00
Summoner<?> getSummoner();
2024-04-12 18:37:02 +00:00
RedisBungeeMode getRedisBungeeMode();
2024-04-12 18:37:02 +00:00
AbstractRedisBungeeAPI getAbstractRedisBungeeApi();
2024-04-12 18:37:02 +00:00
ProxyDataManager proxyDataManager();
2024-04-12 18:37:02 +00:00
PlayerDataManager<P, ?, ?, ?, ?, ?, ?> playerDataManager();
2024-04-12 18:37:02 +00:00
UUIDTranslator getUuidTranslator();
2024-04-12 18:37:02 +00:00
boolean isOnlineMode();
P getPlayer(UUID uuid);
P getPlayer(String name);
UUID getPlayerUUID(String player);
String getPlayerName(UUID player);
boolean handlePlatformKick(UUID uuid, Component message);
String getPlayerServerName(P player);
boolean isPlayerOnAServer(P player);
2022-04-13 18:17:38 +00:00
InetAddress getPlayerIp(P player);
2022-07-19 11:30:45 +00:00
2024-04-12 18:37:02 +00:00
void executeAsync(Runnable runnable);
2022-07-19 11:30:45 +00:00
2024-04-12 18:37:02 +00:00
void executeAsyncAfter(Runnable runnable, TimeUnit timeUnit, int time);
2022-07-16 05:18:33 +00:00
2022-07-20 09:21:24 +00:00
}