mirror of
https://github.com/CarmJos/UltraDepository.git
synced 2024-09-19 19:55:45 +00:00
[v1.2.4] 添加韩语
This commit is contained in:
parent
7153661f86
commit
23161a48bd
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
## 使用须知
|
## 使用须知
|
||||||
|
|
||||||
预设配置基于 MineCraft 1.16 实现,更低版本可能无法使用。
|
预设配置基于 MineCraft 1.16 实现,理论上支持更高版本使用。
|
||||||
|
|
||||||
## 如何使用?
|
## 如何使用?
|
||||||
|
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
[![License](https://img.shields.io/github/license/CarmJos/UltraDepository)](https://opensource.org/licenses/GPL-3.0)
|
[![License](https://img.shields.io/github/license/CarmJos/UltraDepository)](https://opensource.org/licenses/GPL-3.0)
|
||||||
[![workflow](https://github.com/CarmJos/UltraDepository/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/CarmJos/UltraDepository/actions/workflows/maven.yml)
|
[![workflow](https://github.com/CarmJos/UltraDepository/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/CarmJos/UltraDepository/actions/workflows/maven.yml)
|
||||||
![CodeSize](https://img.shields.io/github/languages/code-size/CarmJos/UltraDepository)
|
![CodeSize](https://img.shields.io/github/languages/code-size/CarmJos/UltraDepository)
|
||||||
![Support](https://img.shields.io/badge/Minecraft-Java%201.13--Latest-green)
|
![Support](https://img.shields.io/badge/Minecraft-Java%201.16--Latest-green)
|
||||||
![](https://visitor-badge.glitch.me/badge?page_id=UltraDepository.readme)
|
![](https://visitor-badge.glitch.me/badge?page_id=UltraDepository.readme)
|
||||||
|
|
||||||
超级仓库插件,支持设定不同物品的存储仓库。
|
超级仓库插件,支持设定不同物品的存储仓库。
|
||||||
|
|
||||||
本插件基于Spigot实现,**理论上支持全版本**。
|
本插件基于 Spigot(1.16.3) 实现,**理论上支持1.16后的全部版本**。
|
||||||
|
|
||||||
本插件由 [墨豆Mordo](https://www.mordo.cn)、[子墨Zimrs](https://www.zimrs.cn) 资助本人开发,经过授权后开源。
|
本插件由 [墨豆Mordo](https://www.mordo.cn)、[子墨Zimrs](https://www.zimrs.cn) 资助本人开发,经过授权后开源。
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -119,7 +119,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.17-R0.1-SNAPSHOT</version>
|
<version>1.16.3-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -7,52 +7,63 @@ import cc.carm.lib.easyplugin.configuration.language.MessagesInitializer;
|
|||||||
import cc.carm.plugin.ultradepository.UltraDepository;
|
import cc.carm.plugin.ultradepository.UltraDepository;
|
||||||
import cc.carm.plugin.ultradepository.configuration.PluginMessages;
|
import cc.carm.plugin.ultradepository.configuration.PluginMessages;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class ConfigManager {
|
public class ConfigManager {
|
||||||
|
|
||||||
private static FileConfig pluginConfiguration;
|
private static FileConfig pluginConfiguration;
|
||||||
private static MessagesConfig messageConfiguration;
|
private static MessagesConfig messageConfiguration;
|
||||||
|
|
||||||
public static boolean initialize() {
|
public static boolean initialize() {
|
||||||
try {
|
UltraDepository udPlugin = UltraDepository.getInstance();
|
||||||
pluginConfiguration = new FileConfig(UltraDepository.getInstance(), "config.yml");
|
File configFile = new File(udPlugin.getDataFolder(), "config.yml");
|
||||||
messageConfiguration = new MessagesConfig(UltraDepository.getInstance(), "messages.yml");
|
if (!configFile.exists()) {
|
||||||
|
//没找到配置文件,可能是第一次加载此插件
|
||||||
|
//把一些英文版的东西复制出来,方便英文用户使用。
|
||||||
|
udPlugin.saveResource("i18n/en_US/config.yml", false);
|
||||||
|
udPlugin.saveResource("i18n/ko_KR/config.yml", false);
|
||||||
|
}
|
||||||
|
|
||||||
FileConfig.pluginConfiguration = () -> pluginConfiguration;
|
try {
|
||||||
FileConfig.messageConfiguration = () -> messageConfiguration;
|
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;
|
MessagesInitializer.initialize(messageConfiguration, PluginMessages.class);
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static FileConfig getPluginConfig() {
|
return true;
|
||||||
return pluginConfiguration;
|
} catch (Exception ex) {
|
||||||
}
|
ex.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static MessagesConfig getMessageConfig() {
|
public static FileConfig getPluginConfig() {
|
||||||
return messageConfiguration;
|
return pluginConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void reload() {
|
public static MessagesConfig getMessageConfig() {
|
||||||
try {
|
return messageConfiguration;
|
||||||
getPluginConfig().reload();
|
}
|
||||||
getMessageConfig().reload();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveConfig() {
|
public static void reload() {
|
||||||
try {
|
try {
|
||||||
getPluginConfig().save();
|
getPluginConfig().reload();
|
||||||
getMessageConfig().save();
|
getMessageConfig().reload();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void saveConfig() {
|
||||||
|
try {
|
||||||
|
getPluginConfig().save();
|
||||||
|
getMessageConfig().save();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ version: ${project.version}
|
|||||||
debug: false
|
debug: false
|
||||||
|
|
||||||
# 统计数据设定
|
# 统计数据设定
|
||||||
# 改选项用于帮助开发者统计插件版本与使用情况,且绝不会影响性能与使用体验。
|
# 该选项用于帮助开发者统计插件版本与使用情况,且绝不会影响性能与使用体验。
|
||||||
# 当然,您也可以选择在这里关闭,或在plugins/bStats下的配置文件中关闭。
|
# 当然,您也可以选择在这里关闭,或在plugins/bStats下的配置文件中关闭。
|
||||||
metrics: true
|
metrics: true
|
||||||
|
|
||||||
|
91
src/main/resources/i18n/en_US/config.yml
Normal file
91
src/main/resources/i18n/en_US/config.yml
Normal 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
src/main/resources/i18n/ko_KR/config.yml
Normal file
91
src/main/resources/i18n/ko_KR/config.yml
Normal 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"
|
@ -9,7 +9,7 @@ authors:
|
|||||||
- CarmJos
|
- CarmJos
|
||||||
- Zimrs
|
- Zimrs
|
||||||
|
|
||||||
api-version: 1.13
|
api-version: 1.16
|
||||||
|
|
||||||
softdepend:
|
softdepend:
|
||||||
- PlaceholderAPI
|
- PlaceholderAPI
|
||||||
|
Loading…
Reference in New Issue
Block a user