2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-22 20:28:00 +00:00

seperate events

This commit is contained in:
mohammed jasem alaajel 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;

View File

@ -90,6 +90,11 @@
<artifactId>RedisBungee-API</artifactId>
<version>0.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.imaginarycode.minecraft</groupId>
<artifactId>RedisBungee-BungeeEvents</artifactId>
<version>0.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>

View File

@ -1,6 +1,6 @@
package com.imaginarycode.minecraft.redisbungee;
import com.imaginarycode.minecraft.redisbungee.events.bungee.PubSubMessageEvent;
import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent;
import com.imaginarycode.minecraft.redisbungee.internal.DataManager;
import com.imaginarycode.minecraft.redisbungee.internal.RedisBungeePlugin;
import net.md_5.bungee.api.connection.ProxiedPlayer;

View File

@ -9,7 +9,9 @@ import com.google.common.collect.Multimap;
import com.google.common.io.ByteStreams;
import com.google.gson.Gson;
import com.imaginarycode.minecraft.redisbungee.commands.RedisBungeeCommands;
import com.imaginarycode.minecraft.redisbungee.events.bungee.*;
import com.imaginarycode.minecraft.redisbungee.events.PlayerChangedServerNetworkEvent;
import com.imaginarycode.minecraft.redisbungee.events.PlayerJoinedNetworkEvent;
import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent;
import com.imaginarycode.minecraft.redisbungee.internal.*;
import com.imaginarycode.minecraft.redisbungee.internal.util.IOUtil;
import com.imaginarycode.minecraft.redisbungee.internal.util.LuaManager;

View File

@ -9,7 +9,7 @@ import com.google.common.io.ByteStreams;
import com.imaginarycode.minecraft.redisbungee.internal.AbstractRedisBungeeListener;
import com.imaginarycode.minecraft.redisbungee.internal.DataManager;
import com.imaginarycode.minecraft.redisbungee.internal.RedisBungeePlugin;
import com.imaginarycode.minecraft.redisbungee.events.bungee.PubSubMessageEvent;
import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent;
import com.imaginarycode.minecraft.redisbungee.internal.RedisUtil;
import com.imaginarycode.minecraft.redisbungee.internal.util.RedisCallable;
import net.md_5.bungee.api.AbstractReconnectHandler;

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>RedisBungee</artifactId>
<groupId>com.imaginarycode.minecraft</groupId>
<version>0.7.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>RedisBungee-BungeeEvents</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.17-R0.1-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,4 +1,4 @@
package com.imaginarycode.minecraft.redisbungee.events.bungee;
package com.imaginarycode.minecraft.redisbungee.events;
import net.md_5.bungee.api.plugin.Event;

View File

@ -1,4 +1,4 @@
package com.imaginarycode.minecraft.redisbungee.events.bungee;
package com.imaginarycode.minecraft.redisbungee.events;
import net.md_5.bungee.api.plugin.Event;

View File

@ -1,4 +1,4 @@
package com.imaginarycode.minecraft.redisbungee.events.bungee;
package com.imaginarycode.minecraft.redisbungee.events;
import net.md_5.bungee.api.plugin.Event;

View File

@ -1,4 +1,4 @@
package com.imaginarycode.minecraft.redisbungee.events.bungee;
package com.imaginarycode.minecraft.redisbungee.events;
import net.md_5.bungee.api.plugin.Event;

View File

@ -23,6 +23,7 @@
<modules>
<module>RedisBungee-API</module>
<module>RedisBungee-Bungee</module>
<module>RedisBungee-BungeeEvents</module>
</modules>