That's right, Redis is working!

- Fix end date for bans not being correct
- Add a lot of debug information
- Add ban reasons
This commit is contained in:
2022-02-04 02:18:07 -06:00
parent 753dba8986
commit 93a8a10212
13 changed files with 128 additions and 54 deletions

View File

@ -6,6 +6,7 @@ import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.rank.enums.Rank;
import java.util.List;
@ -28,7 +29,7 @@ public class PlexCMD extends PlexCommand
send(sender, ChatColor.LIGHT_PURPLE + "Plex. The long awaited TotalFreedomMod rewrite starts here...");
return componentFromString(ChatColor.LIGHT_PURPLE + "Plugin version: " + ChatColor.GOLD + "1.0");
}
if (args[0].equals("reload"))
if (args[0].equalsIgnoreCase("reload"))
{
checkRank(sender, Rank.SENIOR_ADMIN, "plex.reload");
Plex.get().config.load();
@ -39,6 +40,17 @@ public class PlexCMD extends PlexCommand
send(sender, "Imported ranks");
send(sender, "Plex successfully reloaded.");
}
else if (args[0].equalsIgnoreCase("redis"))
{
checkRank(sender, Rank.SENIOR_ADMIN, "plex.redis");
if (!plugin.getRedisConnection().isEnabled())
{
throw new CommandFailException("&cRedis is not enabled.");
}
plugin.getRedisConnection().getJedis().set("test", "123");
send(sender, "Set test to 123. Now outputting key test...");
send(sender, plugin.getRedisConnection().getJedis().get("test"));
}
else
{
throw new CommandArgumentException();
@ -49,6 +61,6 @@ public class PlexCMD extends PlexCommand
@Override
public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
{
return ImmutableList.of("reload");
return ImmutableList.of("reload", "redis");
}
}