generated from axieum/fabric-example-mod
-
-
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(api): add 'i18n' config for translations (#48)
fix: modded translation keys should be resolved (fixes #45) this change will load all modded translation files at startup refactor(chat): move world names option to the `api` module
- Loading branch information
Showing
24 changed files
with
293 additions
and
184 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
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
43 changes: 43 additions & 0 deletions
43
minecord-api/src/main/java/me/axieum/mcmod/minecord/impl/config/BotConfig.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,43 @@ | ||
package me.axieum.mcmod.minecord.impl.config; | ||
|
||
import me.shedaniel.autoconfig.ConfigData; | ||
import me.shedaniel.autoconfig.annotation.Config; | ||
import me.shedaniel.autoconfig.annotation.ConfigEntry.Category; | ||
import me.shedaniel.autoconfig.annotation.ConfigEntry.Gui.RequiresRestart; | ||
import me.shedaniel.cloth.clothconfig.shadowed.blue.endless.jankson.Comment; | ||
import net.dv8tion.jda.api.OnlineStatus; | ||
|
||
@Config(name = "bot") | ||
public class BotConfig implements ConfigData | ||
{ | ||
@Comment("Token used to authenticate against your Discord bot") | ||
@RequiresRestart | ||
public String token = ""; | ||
|
||
@Category("Bot Status") | ||
@Comment("Bot statuses relayed during the lifecycle of the server") | ||
public StatusSchema status = new StatusSchema(); | ||
|
||
/** | ||
* Bot status configuration schema. | ||
*/ | ||
public static class StatusSchema | ||
{ | ||
@Comment("Status while the server is starting") | ||
public OnlineStatus starting = OnlineStatus.IDLE; | ||
|
||
@Comment("Status after the server has started") | ||
public OnlineStatus started = OnlineStatus.ONLINE; | ||
|
||
@Comment("Status while the server is stopping") | ||
public OnlineStatus stopping = OnlineStatus.DO_NOT_DISTURB; | ||
|
||
@Comment("Status after the server has stopped") | ||
public OnlineStatus stopped = OnlineStatus.OFFLINE; | ||
} | ||
|
||
@Comment("True if all guild members should be cached, in turn allowing @mentions\n" | ||
+ "NB: This requires the Privileged Gateway Intent 'Server Members' to be enabled on your Discord bot!") | ||
@RequiresRestart | ||
public boolean cacheMembers = false; | ||
} |
33 changes: 33 additions & 0 deletions
33
minecord-api/src/main/java/me/axieum/mcmod/minecord/impl/config/I18nConfig.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,33 @@ | ||
package me.axieum.mcmod.minecord.impl.config; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import me.shedaniel.autoconfig.ConfigData; | ||
import me.shedaniel.autoconfig.annotation.Config; | ||
import me.shedaniel.autoconfig.annotation.ConfigEntry.Gui.RequiresRestart; | ||
import me.shedaniel.cloth.clothconfig.shadowed.blue.endless.jankson.Comment; | ||
|
||
import net.minecraft.util.Language; | ||
|
||
@Config(name = "i18n") | ||
public class I18nConfig implements ConfigData | ||
{ | ||
@Comment("The language code used to load translations from") | ||
@RequiresRestart | ||
public String lang = Language.DEFAULT_LANGUAGE; | ||
|
||
@Comment("A mapping of Minecraft dimension IDs to their respective names") | ||
public Map<String, String> worlds = new HashMap<>(Map.ofEntries( | ||
Map.entry("minecraft:overworld", "Overworld"), | ||
Map.entry("minecraft:the_nether", "Nether"), | ||
Map.entry("minecraft:the_end", "The End") | ||
)); | ||
|
||
@Comment("A mapping of advancement types to their respective names") | ||
public Map<String, String> advancementTypes = new HashMap<>(Map.ofEntries( | ||
Map.entry("task", "task"), | ||
Map.entry("challenge", "challenge"), | ||
Map.entry("goal", "goal") | ||
)); | ||
} |
48 changes: 11 additions & 37 deletions
48
minecord-api/src/main/java/me/axieum/mcmod/minecord/impl/config/MinecordConfig.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
Oops, something went wrong.