-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add logger level for quartz + add: LanguageModule
- Loading branch information
1 parent
104ff96
commit b3f841a
Showing
10 changed files
with
97 additions
and
20 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 was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
...awald/mixin/config/ServerPlayerMixin.java → ...ald/mixin/language/ServerPlayerMixin.java
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
34 changes: 34 additions & 0 deletions
34
src/main/java/io/github/sakurawald/module/language/LanguageModule.java
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.github.sakurawald.module.language; | ||
|
||
import io.github.sakurawald.ServerMain; | ||
import io.github.sakurawald.module.AbstractModule; | ||
import lombok.extern.slf4j.Slf4j; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import org.apache.commons.io.FileUtils; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
@Slf4j | ||
public class LanguageModule extends AbstractModule { | ||
|
||
private final Path STORAGE_PATH = ServerMain.CONFIG_PATH.resolve("language").toAbsolutePath(); | ||
|
||
@Override | ||
public void onInitialize() { | ||
loadLanguages(); | ||
} | ||
|
||
public void loadLanguages() { | ||
if (!Files.exists(STORAGE_PATH)) { | ||
log.info("Create language folder."); | ||
try { | ||
Files.createDirectories(STORAGE_PATH); | ||
FileUtils.copyDirectory(FabricLoader.getInstance().getModContainer(ServerMain.MOD_ID).flatMap(modContainer -> modContainer.findPath("assets/sakurawald/lang")).get().toFile(), STORAGE_PATH.toFile()); | ||
} catch (IOException e) { | ||
log.warn("Failed to create language folder -> {}", e.getMessage()); | ||
} | ||
} | ||
} | ||
} |
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