14.1 | API changes

- Methods with objects have been added to T2Csend
- Methods with objects have been added to T2Creplace
- Methods with objects have been added to T2Cconfig
This commit is contained in:
2022-12-28 13:42:55 +01:00
parent 1b12c2728b
commit b64c1e7c59
6 changed files with 81 additions and 10 deletions

View File

@@ -17,6 +17,11 @@ public class T2Cconfig {
YamlConfiguration.set(path, value);
}
}
public static void set(String path, Object value, YamlConfiguration YamlConfiguration) {
if (!YamlConfiguration.contains(path)) {
YamlConfiguration.set(path, value);
}
}
public static void set(String path, YamlConfiguration YamlConfiguration) {
YamlConfiguration.set(path, null);
@@ -119,6 +124,10 @@ public class T2Cconfig {
return T2Creplace.replace(prefix, yamlConfiguration.getString(path));
}
public static Object selectObject(String prefix, String path, YamlConfiguration yamlConfiguration) {
return T2Creplace.replaceObject(prefix, yamlConfiguration.get(path));
}
public static Integer selectInt(String path, YamlConfiguration yamlConfiguration) {
return (yamlConfiguration.getInt(path));