Skip to content

Commit 1fd1e83

Browse files
committed
API & Spigot: Fix cache clearing, fix cache command
1 parent 9fa09cc commit 1fd1e83

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Spigot/src/main/java/me/innectic/permissify/spigot/commands/PermissifyCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ public boolean onCommand(CommandSender sender, Command command, String s, String
109109
}
110110
sender.sendMessage(ColorUtil.makeReadable(response.getResponse()));
111111
} else if (args[0].equalsIgnoreCase("format")) {
112-
CommandResponse response = plugin.getFormatCommand().handleSetFormat(sender, ArgumentUtil.getRemainingArgs(2, args));
112+
CommandResponse response = plugin.getFormatCommand().handleSetFormat(sender, ArgumentUtil.getRemainingArgs(1, args));
113113
sender.sendMessage(ColorUtil.makeReadable(response.getResponse()));
114114
} else if (args[0].equalsIgnoreCase("cache")) {
115-
CommandResponse response = plugin.getCacheCommand().handleCache(sender, ArgumentUtil.getRemainingArgs(2, args));
115+
CommandResponse response = plugin.getCacheCommand().handleCache(sender, ArgumentUtil.getRemainingArgs(1, args));
116116
sender.sendMessage(ColorUtil.makeReadable(response.getResponse()));
117117
}
118118
}

Spigot/src/main/java/me/innectic/permissify/spigot/commands/permissify/CacheCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public CommandResponse handleCache(CommandSender sender, String[] args) {
2323
private CommandResponse handleCacheClear(CommandSender sender, String[] args) {
2424
if (!PermissifyMain.getInstance().getPermissifyAPI().getDatabaseHandler().isPresent())
2525
return new CommandResponse(PermissifyConstants.UNABLE_OTHER.replace("<REASON>", "No database handler"), false);
26+
PermissifyMain.getInstance().getPermissifyAPI().getDatabaseHandler().get().clear();
2627
return new CommandResponse(PermissifyConstants.CACHE_CLEARED, true);
2728
}
2829
}

0 commit comments

Comments
 (0)