mirror of
https://github.com/Suiranoil/SkinRestorer.git
synced 2026-01-16 04:42:12 +00:00
add skin config reload command
This commit is contained in:
@@ -49,9 +49,14 @@ public final class SkinCommand {
|
||||
var providers = SkinRestorer.getProvidersRegistry().getPublicProviders();
|
||||
for (var entry : providers)
|
||||
set.then(buildSetSubcommand(entry.first(), entry.second()));
|
||||
|
||||
base.then(set);
|
||||
|
||||
base.then(
|
||||
literal("config")
|
||||
.requires(commandSourceStack -> commandSourceStack.hasPermission(3))
|
||||
.then(literal("reload").executes(SkinCommand::configReloadSubcommand))
|
||||
);
|
||||
|
||||
dispatcher.register(base);
|
||||
}
|
||||
|
||||
@@ -160,6 +165,12 @@ public final class SkinCommand {
|
||||
return setSubcommand(src, Collections.singleton(src.getPlayer().getGameProfile()), context, false);
|
||||
}
|
||||
|
||||
private static int configReloadSubcommand(CommandContext<CommandSourceStack> context) {
|
||||
SkinRestorer.reloadConfig();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void sendResponse(CommandSourceStack src, Collection<ServerPlayer> updatedPlayers, boolean setByOperator) {
|
||||
if (updatedPlayers.isEmpty()) {
|
||||
src.sendSuccess(() -> Translation.translatableWithFallback(
|
||||
|
||||
Reference in New Issue
Block a user