1
mirror of https://github.com/CarmJos/UltraDepository.git synced 2026-06-04 08:38:25 +08:00

[v1.2.4] 添加韩语

This commit is contained in:
2022-01-14 13:26:52 +08:00
parent 7153661f86
commit 23161a48bd
8 changed files with 236 additions and 43 deletions
@@ -7,52 +7,63 @@ import cc.carm.lib.easyplugin.configuration.language.MessagesInitializer;
import cc.carm.plugin.ultradepository.UltraDepository;
import cc.carm.plugin.ultradepository.configuration.PluginMessages;
import java.io.File;
public class ConfigManager {
private static FileConfig pluginConfiguration;
private static MessagesConfig messageConfiguration;
private static FileConfig pluginConfiguration;
private static MessagesConfig messageConfiguration;
public static boolean initialize() {
try {
pluginConfiguration = new FileConfig(UltraDepository.getInstance(), "config.yml");
messageConfiguration = new MessagesConfig(UltraDepository.getInstance(), "messages.yml");
public static boolean initialize() {
UltraDepository udPlugin = UltraDepository.getInstance();
File configFile = new File(udPlugin.getDataFolder(), "config.yml");
if (!configFile.exists()) {
//没找到配置文件,可能是第一次加载此插件
//把一些英文版的东西复制出来,方便英文用户使用。
udPlugin.saveResource("i18n/en_US/config.yml", false);
udPlugin.saveResource("i18n/ko_KR/config.yml", false);
}
FileConfig.pluginConfiguration = () -> pluginConfiguration;
FileConfig.messageConfiguration = () -> messageConfiguration;
try {
pluginConfiguration = new FileConfig(udPlugin, "config.yml");
messageConfiguration = new MessagesConfig(udPlugin, "messages.yml");
MessagesInitializer.initialize(messageConfiguration, PluginMessages.class);
FileConfig.pluginConfiguration = () -> pluginConfiguration;
FileConfig.messageConfiguration = () -> messageConfiguration;
return true;
} catch (Exception ex) {
ex.printStackTrace();
return false;
}
}
MessagesInitializer.initialize(messageConfiguration, PluginMessages.class);
public static FileConfig getPluginConfig() {
return pluginConfiguration;
}
return true;
} catch (Exception ex) {
ex.printStackTrace();
return false;
}
}
public static MessagesConfig getMessageConfig() {
return messageConfiguration;
}
public static FileConfig getPluginConfig() {
return pluginConfiguration;
}
public static void reload() {
try {
getPluginConfig().reload();
getMessageConfig().reload();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static MessagesConfig getMessageConfig() {
return messageConfiguration;
}
public static void saveConfig() {
try {
getPluginConfig().save();
getMessageConfig().save();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static void reload() {
try {
getPluginConfig().reload();
getMessageConfig().reload();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static void saveConfig() {
try {
getPluginConfig().save();
getMessageConfig().save();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ version: ${project.version}
debug: false
# 统计数据设定
# 选项用于帮助开发者统计插件版本与使用情况,且绝不会影响性能与使用体验。
# 选项用于帮助开发者统计插件版本与使用情况,且绝不会影响性能与使用体验。
# 当然,您也可以选择在这里关闭,或在plugins/bStats下的配置文件中关闭。
metrics: true
+91
View File
@@ -0,0 +1,91 @@
# ${project.name} - ${project.description}
# Source url: ${project.url}
# Download URL: ${project.distributionManagement.downloadUrl}
version: ${project.version}
debug: false
# bStats Metrics
# This option is used to help developers analysis plugin stats,
# and will never affect performance and user experience.
# You can choose to turn it off here.
metrics: true
# Storage Configuration
storage:
# Storage method
# You can choose [ yaml | json | mysql ]
method: yaml
# The storage file path when choosing "yaml"/"json" method.
# Support absolute paths, e.g. “/var/data/ub/"(linux) or "D:\data\ub\"(windows)
# **Be aware of permission issues when using absolute paths!**
file-path: data
# The Database configuration when choosing "mysql" method.
mysql:
driver: "com.mysql.jdbc.Driver"
url: "jdbc:mysql://127.0.0.1:3306/<db-name>"
table: "ud_data" # Plugin data table name, allowing customization
username: "username"
password: "password"
# Player Collect Configuration
# Used to determine when put the player's item into the backpack automatically
collect:
pickup: true # Pickup Items
kill: true # Kill Entities (Animals/Monsters)
break: true # Break Blocks
sounds:
collect: "ENTITY_EXPERIENCE_ORB_PICKUP:0.5"
sell-success: "ENTITY_VILLAGER_CELEBRATE"
sell-fail: "ENTITY_VILLAGER_NO"
gui-click: "UI_BUTTON_CLICK"
# General Configuration
general:
# Hints lore for the item's information
# Will add to items in BackpackGUI and SellGUI.
additional-lore:
- " "
- "&fAmount &a%(amount)"
- "&fPrice &a%(price)"
- "&fSold &a%(remain)&8/%(limit)"
# Hints lore for the player's click
# Will add to items in BackpackGUI.
click-lore:
- " "
- "&a&lLEFT-CLICK &8| &fSell items"
- "&a&lRIGHT-CLICK &8| &fTake one Stack"
# Configuration of the SellGUI
sell-gui:
title: "&8Selling %(item_name)"
items:
add:
type: GREEN_STAINED_GLASS_PANE
name: "&aAdd %(amount)"
remove:
type: RED_STAINED_GLASS_PANE
name: "&cReduce %(amount)"
confirm:
type: EMERALD
name: "&a&lConfirm"
lore:
- " "
- "&7You will sell &r%(item_name) &8x &f%(amount)"
- "&7and will get $&e%(money) &7."
- " "
- "&a&lClick to confirm"
cancel:
type: REDSTONE
name: "&c&lCancel"
lore:
- " "
- "&cClick to cancel"
+91
View File
@@ -0,0 +1,91 @@
# ${project.name} - ${project.description}
# Source url: ${project.url}
# Download URL: ${project.distributionManagement.downloadUrl}
version: ${project.version}
debug: false
# bStats Metrics
# This option is used to help developers analysis plugin stats,
# and will never affect performance and user experience.
# You can choose to turn it off here.
metrics: true
# Storage Configuration
storage:
# Storage method
# You can choose [ yaml | json | mysql ]
method: yaml
# The storage file path when choosing "yaml"/"json" method.
# Support absolute paths, e.g. “/var/data/ub/"(linux) or "D:\data\ub\"(windows)
# **Be aware of permission issues when using absolute paths!**
file-path: data
# The Database configuration when choosing "mysql" method.
mysql:
driver: "com.mysql.jdbc.Driver"
url: "jdbc:mysql://127.0.0.1:3306/<db-name>"
table: "ud_data" # Plugin data table name, allowing customization
username: "username"
password: "password"
# Player Collect Configuration
# Used to determine when put the player's item into the backpack automatically
collect:
pickup: true # Pickup Items
kill: true # Kill Entities (Animals/Monsters)
break: true # Break Blocks
sounds:
collect: "ENTITY_EXPERIENCE_ORB_PICKUP:0.5"
sell-success: "ENTITY_VILLAGER_CELEBRATE"
sell-fail: "ENTITY_VILLAGER_NO"
gui-click: "UI_BUTTON_CLICK"
# General Configuration
general:
# Hints lore for the item's information
# Will add to items in BackpackGUI and SellGUI.
additional-lore:
- " "
- "&fAmount &a%(amount)"
- "&fPrice &a%(price)"
- "&fSold &a%(remain)&8/%(limit)"
# Hints lore for the player's click
# Will add to items in BackpackGUI.
click-lore:
- " "
- "&a&lLEFT-CLICK &8| &fSell items"
- "&a&lRIGHT-CLICK &8| &fTake one Stack"
# Configuration of the SellGUI
sell-gui:
title: "&8Selling %(item_name)"
items:
add:
type: GREEN_STAINED_GLASS_PANE
name: "&aAdd %(amount)"
remove:
type: RED_STAINED_GLASS_PANE
name: "&cReduce %(amount)"
confirm:
type: EMERALD
name: "&a&lConfirm"
lore:
- " "
- "&7You will sell &r%(item_name) &8x &f%(amount)"
- "&7and will get $&e%(money) &7."
- " "
- "&a&lClick to confirm"
cancel:
type: REDSTONE
name: "&c&lCancel"
lore:
- " "
- "&cClick to cancel"
+1 -1
View File
@@ -9,7 +9,7 @@ authors:
- CarmJos
- Zimrs
api-version: 1.13
api-version: 1.16
softdepend:
- PlaceholderAPI