mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-07-11 23:38:03 +00:00
fixed bug where PlayerNetoworkJoin is not fireing, and also fixed wrong arguments being passed on server change network event, Moved Payload creation to it own Util class, Remove player creation from RedisUtils class and move it to GenericPlayerUtils, and also renamed Bungeecord/Velocity Player Util classes to <PLATFORM>PlayerUtils.java, removed the use of reflection to create event instances
28 lines
708 B
Java
28 lines
708 B
Java
package com.imaginarycode.minecraft.redisbungee.api;
|
|
|
|
|
|
import redis.clients.jedis.JedisPubSub;
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
|
|
public class JedisPubSubHandler extends JedisPubSub {
|
|
|
|
private final RedisBungeePlugin<?> plugin;
|
|
|
|
public JedisPubSubHandler(RedisBungeePlugin<?> plugin) {
|
|
this.plugin = plugin;
|
|
}
|
|
|
|
@Override
|
|
public void onMessage(final String s, final String s2) {
|
|
if (s2.trim().length() == 0) return;
|
|
plugin.executeAsync(new Runnable() {
|
|
@Override
|
|
public void run() {
|
|
Object event = plugin.createPubSubEvent(s, s2);
|
|
plugin.callEvent(event);
|
|
}
|
|
});
|
|
}
|
|
} |