diff --git a/.idea/dictionaries/csh20.xml b/.idea/dictionaries/csh20.xml
index e6ef750..47c7813 100644
--- a/.idea/dictionaries/csh20.xml
+++ b/.idea/dictionaries/csh20.xml
@@ -6,6 +6,7 @@
sendable
unserialize
unserializer
+ yaml
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 0f1df49..d5b4402 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -32,5 +32,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..6b8114c
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/ilummc/tlib/TLib.java b/src/main/java/com/ilummc/tlib/TLib.java
index ac89b55..eed40c6 100644
--- a/src/main/java/com/ilummc/tlib/TLib.java
+++ b/src/main/java/com/ilummc/tlib/TLib.java
@@ -1,6 +1,7 @@
package com.ilummc.tlib;
import java.io.File;
+import java.io.InputStreamReader;
import java.lang.reflect.Field;
import org.bukkit.Bukkit;
@@ -17,6 +18,7 @@ import com.ilummc.tlib.resources.TLocaleLoader;
import lombok.Getter;
import me.skymc.taboolib.Main;
+import org.bukkit.configuration.file.YamlConfiguration;
@Dependency(type = Dependency.Type.LIBRARY, maven = "org.ow2.asm:asm:6.1.1")
@Dependency(type = Dependency.Type.LIBRARY, maven = "com.zaxxer:HikariCP:3.1.0")
@@ -38,11 +40,15 @@ public class TLib {
@Getter
private File libsFolder;
+ @Getter
+ private YamlConfiguration internalLang;
+
private TLib() {
libsFolder = new File(Main.getInst().getDataFolder(), "/libs");
if (!libsFolder.exists()) {
libsFolder.mkdirs();
}
+ internalLang = YamlConfiguration.loadConfiguration(new InputStreamReader(TLib.class.getResourceAsStream("/internalLang.yml")));
}
public static void init() {
diff --git a/src/main/java/com/ilummc/tlib/inject/TConfigWatcher.java b/src/main/java/com/ilummc/tlib/inject/TConfigWatcher.java
index bfb013c..faab770 100644
--- a/src/main/java/com/ilummc/tlib/inject/TConfigWatcher.java
+++ b/src/main/java/com/ilummc/tlib/inject/TConfigWatcher.java
@@ -1,12 +1,10 @@
package com.ilummc.tlib.inject;
+import org.apache.commons.lang3.tuple.Triple;
+
import java.io.File;
import java.io.IOException;
-import java.nio.file.FileSystems;
-import java.nio.file.StandardWatchEventKinds;
-import java.nio.file.WatchEvent;
-import java.nio.file.WatchKey;
-import java.nio.file.WatchService;
+import java.nio.file.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -15,39 +13,46 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
-import org.apache.commons.lang3.tuple.Triple;
-
public class TConfigWatcher {
- private ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
+ private final ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
- private Map>> map = new HashMap<>();
+ private final Map>> map = new HashMap<>();
public TConfigWatcher() {
- service.scheduleAtFixedRate(() -> {
- map.forEach((service, triple) -> {
- WatchKey key;
- while ((key = service.poll()) != null) {
- for (WatchEvent> watchEvent : key.pollEvents()) {
- if (triple.getLeft().getName().equals(Objects.toString(watchEvent.context())))
- triple.getRight().accept(triple.getMiddle());
- }
- key.reset();
+ service.scheduleAtFixedRate(() -> map.forEach((service, triple) -> {
+ WatchKey key;
+ while ((key = service.poll()) != null) {
+ for (WatchEvent> watchEvent : key.pollEvents()) {
+ if (triple.getLeft().getName().equals(Objects.toString(watchEvent.context())))
+ triple.getRight().accept(triple.getMiddle());
}
- });
- }, 1000, 100, TimeUnit.MILLISECONDS);
+ key.reset();
+ }
+ }), 1000, 100, TimeUnit.MILLISECONDS);
}
public void addOnListen(File file, Object obj, Consumer