-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fab6adb
commit be22ec7
Showing
4 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,37 @@ | ||
package diacritics.owo; | ||
|
||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; | ||
import net.minecraft.text.Text; | ||
import static net.minecraft.server.command.CommandManager.literal; | ||
|
||
public class DynamicSkinsClient implements ClientModInitializer { | ||
@Override | ||
public void onInitializeClient() { | ||
// This entrypoint is suitable for setting up client-specific logic, such as rendering. | ||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { | ||
dispatcher.register(literal("dynamic-skins") | ||
.then(literal("cache") | ||
.then(literal("reload").executes(context -> { | ||
DynamicSkins.config.resetCache(); | ||
context.getSource().sendFeedback(() -> Text.of("Successfully reloaded configuration cache"), false); | ||
return 1; | ||
}))) | ||
.then(literal("error") | ||
.executes(context -> { | ||
context.getSource().sendFeedback( | ||
() -> Text.of(DynamicSkins.dynamicSkinsError == null ? "No errors found" | ||
: DynamicSkins.dynamicSkinsError.toString()), | ||
false); | ||
return 1; | ||
}) | ||
.then(literal("reset").executes(context -> { | ||
DynamicSkins.config.resetCache(); | ||
DynamicSkins.dynamicSkinsError = null; | ||
context.getSource().sendFeedback( | ||
() -> Text.of("Dynamic Skins has been restarted"), | ||
false); | ||
return 1; | ||
})))); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters