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

as new config, check if ye wana load legacy commands

This commit is contained in:
mohammed jasem alaajel 2022-07-22 16:10:06 +04:00
parent 5c6cf405fa
commit 2c8c5fc1cf
3 changed files with 27 additions and 26 deletions

View File

@ -7,7 +7,6 @@ import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams; import com.google.common.io.ByteStreams;
import com.imaginarycode.minecraft.redisbungee.api.AbstractRedisBungeeListener; import com.imaginarycode.minecraft.redisbungee.api.AbstractRedisBungeeListener;
import com.imaginarycode.minecraft.redisbungee.api.AbstractDataManager;
import com.imaginarycode.minecraft.redisbungee.api.GenericPlayerUtils; import com.imaginarycode.minecraft.redisbungee.api.GenericPlayerUtils;
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin; import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
import com.imaginarycode.minecraft.redisbungee.api.tasks.RedisTask; import com.imaginarycode.minecraft.redisbungee.api.tasks.RedisTask;
@ -142,8 +141,6 @@ public class RedisBungeeBungeeListener extends AbstractRedisBungeeListener<Login
@EventHandler @EventHandler
public void onPlayerDisconnect(PlayerDisconnectEvent event) { public void onPlayerDisconnect(PlayerDisconnectEvent event) {
plugin.executeAsync(new RedisTask<Void>(plugin) { plugin.executeAsync(new RedisTask<Void>(plugin) {
@Override @Override
public Void jedisTask(Jedis jedis) { public Void jedisTask(Jedis jedis) {
Pipeline pipeline = jedis.pipelined(); Pipeline pipeline = jedis.pipelined();

View File

@ -742,6 +742,7 @@ public class RedisBungeeBungeePlugin extends Plugin implements RedisBungeePlugin
// register plugin messages channel. // register plugin messages channel.
getProxy().registerChannel("legacy:redisbungee"); getProxy().registerChannel("legacy:redisbungee");
getProxy().registerChannel("RedisBungee"); getProxy().registerChannel("RedisBungee");
if (configuration.doRegisterLegacyCommands()) {
// register commands // register commands
if (configuration.doOverrideBungeeCommands()) { if (configuration.doOverrideBungeeCommands()) {
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.GlistCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.GlistCommand(this));
@ -755,6 +756,7 @@ public class RedisBungeeBungeePlugin extends Plugin implements RedisBungeePlugin
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlayerProxyCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlayerProxyCommand(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlistCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlistCommand(this));
} }
}
@Override @Override
public void stop() { public void stop() {

View File

@ -765,7 +765,8 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player> {
// register plugin messages // register plugin messages
IDENTIFIERS.forEach(getProxy().getChannelRegistrar()::register); IDENTIFIERS.forEach(getProxy().getChannelRegistrar()::register);
// register commands // register legacy commands
if (configuration.doRegisterLegacyCommands()) {
// Override Velocity commands // Override Velocity commands
if (configuration.doOverrideBungeeCommands()) { if (configuration.doOverrideBungeeCommands()) {
getProxy().getCommandManager().register("glist", new RedisBungeeCommands.GlistCommand(this), "redisbungee", "rglist"); getProxy().getCommandManager().register("glist", new RedisBungeeCommands.GlistCommand(this), "redisbungee", "rglist");
@ -779,6 +780,7 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player> {
getProxy().getCommandManager().register("ip", new RedisBungeeCommands.IpCommand(this), "playerip", "rip", "rplayerip"); getProxy().getCommandManager().register("ip", new RedisBungeeCommands.IpCommand(this), "playerip", "rip", "rplayerip");
getProxy().getCommandManager().register("find", new RedisBungeeCommands.FindCommand(this), "rfind"); getProxy().getCommandManager().register("find", new RedisBungeeCommands.FindCommand(this), "rfind");
} }
}
@Override @Override
public void stop() { public void stop() {