船新 I18n 系统
修了一个配置文件小bug
This commit is contained in:
@@ -3,9 +3,12 @@ package com.ilummc.tlib;
|
||||
import com.ilummc.tlib.annotations.Config;
|
||||
import com.ilummc.tlib.annotations.Dependency;
|
||||
import com.ilummc.tlib.annotations.Logger;
|
||||
import com.ilummc.tlib.compat.PlaceholderApiHook;
|
||||
import com.ilummc.tlib.inject.DependencyInjector;
|
||||
import com.ilummc.tlib.inject.TConfigWatcher;
|
||||
import com.ilummc.tlib.inject.TLibPluginManager;
|
||||
import com.ilummc.tlib.resources.LocaleLoader;
|
||||
import com.ilummc.tlib.resources.TLocale;
|
||||
import com.ilummc.tlib.util.TLogger;
|
||||
import me.skymc.taboolib.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -21,7 +24,7 @@ public class TLib {
|
||||
private static TLib tLib;
|
||||
|
||||
@Logger("§8[§3§lTabooLib§8][§r{1}§8] §f{2}")
|
||||
private TLogger tLogger;
|
||||
private TLogger tLogger = new TLogger("§8[§3§lTabooLib§8][§r{1}§8] §f{2}", Main.getInst(), TLogger.FINE);
|
||||
|
||||
private TLibConfig config;
|
||||
|
||||
@@ -60,11 +63,17 @@ public class TLib {
|
||||
public static void init() {
|
||||
new File(Main.getInst().getDataFolder(), "/libs").mkdirs();
|
||||
tLib = new TLib();
|
||||
LocaleLoader.init();
|
||||
PlaceholderApiHook.init();
|
||||
DependencyInjector.inject(Main.getInst(), tLib);
|
||||
if (Bukkit.getPluginManager() instanceof TLibPluginManager)
|
||||
tLib.getLogger().info("注入成功");
|
||||
else
|
||||
tLib.getLogger().fatal("注入失败");
|
||||
TLocale.sendToConsole("test1");
|
||||
TLocale.sendToConsole("test2");
|
||||
TLocale.sendToConsole("test3");
|
||||
TLocale.sendToConsole("test4.node1", "Hello", "world");
|
||||
}
|
||||
|
||||
public static void unload() {
|
||||
@@ -72,7 +81,7 @@ public class TLib {
|
||||
DependencyInjector.eject(Main.getInst(), tLib);
|
||||
}
|
||||
|
||||
@Config(name = "tlib.yml", listenChanges = true)
|
||||
@Config(name = "tlib.yml", listenChanges = true, readOnly = false)
|
||||
public static class TLibConfig {
|
||||
|
||||
private int downloadPoolSize = 4;
|
||||
@@ -80,5 +89,17 @@ public class TLib {
|
||||
public int getDownloadPoolSize() {
|
||||
return downloadPoolSize;
|
||||
}
|
||||
|
||||
private String[] locale = {"zh_CN", "en_US"};
|
||||
|
||||
public String[] getLocale() {
|
||||
return locale;
|
||||
}
|
||||
|
||||
private boolean enablePapiByDefault = false;
|
||||
|
||||
public boolean isEnablePapiByDefault() {
|
||||
return enablePapiByDefault;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user