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

seperate events

This commit is contained in:
2022-04-14 15:59:02 +04:00
parent 2bc30ce5f3
commit 8bfefc1ab0
14 changed files with 75 additions and 30 deletions

View File

@@ -4,7 +4,6 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent;
import com.imaginarycode.minecraft.redisbungee.internal.RedisBungeePlugin;
import org.checkerframework.checker.nullness.qual.NonNull;
import redis.clients.jedis.Jedis;

View File

@@ -8,7 +8,6 @@ import com.google.common.util.concurrent.UncheckedExecutionException;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent;
import redis.clients.jedis.Jedis;
import java.lang.reflect.InvocationTargetException;

View File

@@ -0,0 +1,20 @@
package com.imaginarycode.minecraft.redisbungee.internal;
/**
* Since each platform have their own events' implementation for example Bungeecord events extends Event while velocity don't
*
* @author Ham1255
* @since 0.7.0
*
*/
public interface EventsPlatform {
Class<?> getPubSubEventClass();
Class<?> getNetworkJoinEventClass();
Class<?> getServerChangeEventClass();
Class<?> getNetworkQuitEventClass();
}

View File

@@ -2,10 +2,6 @@ package com.imaginarycode.minecraft.redisbungee.internal;
import com.google.common.collect.Multimap;
import com.imaginarycode.minecraft.redisbungee.RedisBungeeAPI;
import com.imaginarycode.minecraft.redisbungee.events.PlayerChangedServerNetworkEvent;
import com.imaginarycode.minecraft.redisbungee.events.PlayerJoinedNetworkEvent;
import com.imaginarycode.minecraft.redisbungee.events.PlayerLeftNetworkEvent;
import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent;
import com.imaginarycode.minecraft.redisbungee.internal.util.uuid.UUIDTranslator;
import java.net.InetAddress;
@@ -23,7 +19,7 @@ import java.util.concurrent.TimeUnit;
* @since 0.7.0
*
*/
public interface RedisBungeePlugin<P> extends JedisSummoner {
public interface RedisBungeePlugin<P> extends JedisSummoner, EventsPlatform{
default void enable() {
@@ -93,22 +89,6 @@ public interface RedisBungeePlugin<P> extends JedisSummoner {
void sendProxyCommand(String cmd);
default Class<?> getPubSubEventClass() {
return PubSubMessageEvent.class;
}
default Class<?> getNetworkJoinEventClass() {
return PlayerJoinedNetworkEvent.class;
}
default Class<?> getServerChangeEventClass() {
return PlayerChangedServerNetworkEvent.class;
}
default Class<?> getNetworkQuitEventClass() {
return PlayerLeftNetworkEvent.class;
}
long getRedisTime(List<String> timeRes);
void loadConfig() throws Exception;