mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-09-03 03:10:33 +02:00
Attempt to fix RedisBungee again
This commit is contained in:
parent
eae28963bc
commit
636b7d4b11
|
@ -31,12 +31,13 @@ import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||||
import com.gmail.filoghost.holographicdisplays.HolographicDisplays;
|
import com.gmail.filoghost.holographicdisplays.HolographicDisplays;
|
||||||
import com.gmail.filoghost.holographicdisplays.disk.Configuration;
|
import com.gmail.filoghost.holographicdisplays.disk.Configuration;
|
||||||
import com.gmail.filoghost.holographicdisplays.util.ConsoleLogger;
|
import com.gmail.filoghost.holographicdisplays.util.ConsoleLogger;
|
||||||
import com.gmail.filoghost.holographicdisplays.util.NMSVersion;
|
|
||||||
|
|
||||||
public class BungeeChannel implements PluginMessageListener {
|
public class BungeeChannel implements PluginMessageListener {
|
||||||
|
|
||||||
|
private static final String BUNGEECORD_CHANNEL = "BungeeCord";
|
||||||
|
private static final String REDISBUNGEE_CHANNEL = "legacy:redisbungee";
|
||||||
|
|
||||||
private static BungeeChannel instance;
|
private static BungeeChannel instance;
|
||||||
private String redisBungeeChannel;
|
|
||||||
|
|
||||||
public static BungeeChannel getInstance() {
|
public static BungeeChannel getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
|
@ -46,24 +47,18 @@ public class BungeeChannel implements PluginMessageListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private BungeeChannel(Plugin plugin) {
|
private BungeeChannel(Plugin plugin) {
|
||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord");
|
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, BUNGEECORD_CHANNEL);
|
||||||
Bukkit.getMessenger().registerIncomingPluginChannel(plugin, "BungeeCord", this);
|
Bukkit.getMessenger().registerIncomingPluginChannel(plugin, BUNGEECORD_CHANNEL, this);
|
||||||
|
|
||||||
if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_13_R1)) {
|
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, REDISBUNGEE_CHANNEL);
|
||||||
redisBungeeChannel = "legacy:redisbungee";
|
Bukkit.getMessenger().registerIncomingPluginChannel(plugin, REDISBUNGEE_CHANNEL, this);
|
||||||
} else {
|
|
||||||
redisBungeeChannel = "RedisBungee";
|
|
||||||
}
|
|
||||||
|
|
||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, redisBungeeChannel);
|
|
||||||
Bukkit.getMessenger().registerIncomingPluginChannel(plugin, redisBungeeChannel, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getTargetChannel() {
|
private String getTargetChannel() {
|
||||||
if (Configuration.useRedisBungee) {
|
if (Configuration.useRedisBungee) {
|
||||||
return redisBungeeChannel;
|
return REDISBUNGEE_CHANNEL;
|
||||||
} else {
|
} else {
|
||||||
return "BungeeCord";
|
return BUNGEECORD_CHANNEL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user