diff --git a/bukkit/pom.xml b/bukkit/pom.xml
index 39a1f5d9..f6e5afd3 100644
--- a/bukkit/pom.xml
+++ b/bukkit/pom.xml
@@ -92,22 +92,10 @@
redis.clients.jedis
me.lucko.luckperms.lib.jedis
-
- redis.clients.util
- me.lucko.luckperms.lib.jedisutil
-
-
- org.apache.commons.pool2
- me.lucko.luckperms.lib.commonspool2
-
ninja.leaping.configurate
me.lucko.luckperms.lib.configurate
-
- com.typesafe.config
- me.lucko.luckperms.lib.hocon
-
diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java
index 416cba9f..bc12a743 100644
--- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java
+++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java
@@ -49,6 +49,7 @@ import me.lucko.luckperms.common.command.access.CommandPermission;
import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.config.adapter.ConfigurationAdapter;
import me.lucko.luckperms.common.contexts.ContextManager;
+import me.lucko.luckperms.common.dependencies.Dependency;
import me.lucko.luckperms.common.event.AbstractEventBus;
import me.lucko.luckperms.common.listener.ConnectionListener;
import me.lucko.luckperms.common.managers.group.StandardGroupManager;
@@ -70,8 +71,10 @@ import org.bukkit.plugin.ServicePriority;
import java.io.File;
import java.util.Arrays;
+import java.util.EnumSet;
import java.util.Map;
import java.util.Optional;
+import java.util.Set;
import java.util.stream.Stream;
/**
@@ -106,6 +109,11 @@ public class LPBukkitPlugin extends AbstractLuckPermsPlugin {
this.senderFactory = new BukkitSenderFactory(this);
}
+ @Override
+ protected Set getGlobalDependencies() {
+ return EnumSet.of(Dependency.CAFFEINE, Dependency.OKIO, Dependency.OKHTTP);
+ }
+
@Override
protected ConfigurationAdapter provideConfigurationAdapter() {
return new BukkitConfigAdapter(this, resolveConfig());
diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml
index 3a25fc1a..be490e07 100644
--- a/bukkit/src/main/resources/config.yml
+++ b/bukkit/src/main/resources/config.yml
@@ -74,6 +74,11 @@ use-server-uuid-cache: false
# |=> YAML (.yml files)
# |=> JSON (.json files)
# |=> HOCON (.conf files)
+# |=> TOML (.toml files)
+# |
+# | By default, user, group and track data is separated into different files. Data can be combined
+# | and all stored in the same file by switching to a combined storage variant.
+# | Just add '-combined' to the end of the storage-method, e.g. 'yaml-combined'
#
# - A H2 database is the default option.
# - If you want to edit data manually in "traditional" storage files, we suggest using YAML.
diff --git a/bungee/pom.xml b/bungee/pom.xml
index 2ceac3df..53fdc253 100644
--- a/bungee/pom.xml
+++ b/bungee/pom.xml
@@ -92,22 +92,10 @@
redis.clients.jedis
me.lucko.luckperms.lib.jedis
-
- redis.clients.util
- me.lucko.luckperms.lib.jedisutil
-
-
- org.apache.commons.pool2
- me.lucko.luckperms.lib.commonspool2
-
ninja.leaping.configurate
me.lucko.luckperms.lib.configurate
-
- com.typesafe.config
- me.lucko.luckperms.lib.hocon
-
diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java
index 0061d6b6..f1d42c74 100644
--- a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java
+++ b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java
@@ -39,6 +39,7 @@ import me.lucko.luckperms.common.calculators.PlatformCalculatorFactory;
import me.lucko.luckperms.common.command.CommandManager;
import me.lucko.luckperms.common.config.adapter.ConfigurationAdapter;
import me.lucko.luckperms.common.contexts.ContextManager;
+import me.lucko.luckperms.common.dependencies.Dependency;
import me.lucko.luckperms.common.event.AbstractEventBus;
import me.lucko.luckperms.common.listener.ConnectionListener;
import me.lucko.luckperms.common.managers.group.StandardGroupManager;
@@ -57,7 +58,9 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
+import java.util.EnumSet;
import java.util.Optional;
+import java.util.Set;
import java.util.stream.Stream;
/**
@@ -88,6 +91,11 @@ public class LPBungeePlugin extends AbstractLuckPermsPlugin {
this.senderFactory = new BungeeSenderFactory(this);
}
+ @Override
+ protected Set getGlobalDependencies() {
+ return EnumSet.of(Dependency.CAFFEINE, Dependency.OKIO, Dependency.OKHTTP);
+ }
+
@Override
protected ConfigurationAdapter provideConfigurationAdapter() {
return new BungeeConfigAdapter(this, resolveConfig());
diff --git a/bungee/src/main/resources/config.yml b/bungee/src/main/resources/config.yml
index d907fc09..c270c049 100644
--- a/bungee/src/main/resources/config.yml
+++ b/bungee/src/main/resources/config.yml
@@ -71,6 +71,11 @@ use-server-uuid-cache: false
# |=> YAML (.yml files)
# |=> JSON (.json files)
# |=> HOCON (.conf files)
+# |=> TOML (.toml files)
+# |
+# | By default, user, group and track data is separated into different files. Data can be combined
+# | and all stored in the same file by switching to a combined storage variant.
+# | Just add '-combined' to the end of the storage-method, e.g. 'yaml-combined'
#
# - A H2 database is the default option.
# - If you want to edit data manually in "traditional" storage files, we suggest using YAML.
diff --git a/common/pom.xml b/common/pom.xml
index f47b53c9..cf4aacb6 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -83,7 +83,7 @@
com.google.guava
guava
19.0
- provided
+ compile
@@ -109,9 +109,9 @@
- ninja.leaping.configurate
+ me.lucko.configurate
configurate-core
- 3.3
+ 3.4
provided
@@ -122,9 +122,9 @@
- ninja.leaping.configurate
+ me.lucko.configurate
configurate-yaml
- 3.3
+ 3.4
provided
@@ -135,9 +135,9 @@
- ninja.leaping.configurate
+ me.lucko.configurate
configurate-gson
- 3.3
+ 3.4
provided
@@ -148,11 +148,24 @@
- ninja.leaping.configurate
+ me.lucko.configurate
configurate-hocon
- 3.3
+ 3.4
provided
+
+
+ me.lucko.configurate
+ configurate-toml
+ 3.4
+ provided
+
+
+ com.moandjiezana.toml
+ toml4j
+
+
+
com.zaxxer
diff --git a/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java b/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java
index f8027b73..22c47970 100644
--- a/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java
+++ b/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java
@@ -168,31 +168,31 @@ public enum Dependency {
Relocation.of("commonspool2", "org{}apache{}commons{}pool2")
),
CONFIGURATE_CORE(
- "ninja{}leaping{}configurate",
+ "me{}lucko{}configurate",
"configurate-core",
- "3.3",
- "4leBJEqj1kVszaifZeKNl4hgHxG5M+Nk5TJKkPW2s4Y=",
+ "3.4",
+ "XetsTkFaqO7NS7wpGyTK68P29AUl+NsbLZIldvvXUAg=",
Relocation.of("configurate", "ninja{}leaping{}configurate")
),
CONFIGURATE_GSON(
- "ninja{}leaping{}configurate",
+ "me{}lucko{}configurate",
"configurate-gson",
- "3.3",
- "4HxrW3/ZKdn095x/W4gylQMNskdmteXYVxVv0UKGJA4=",
+ "3.4",
+ "1Glt4ijo6xQ8MatviUO+36AbZH5qR+f3tWx466iYZug=",
Relocation.of("configurate", "ninja{}leaping{}configurate")
),
CONFIGURATE_YAML(
- "ninja{}leaping{}configurate",
+ "me{}lucko{}configurate",
"configurate-yaml",
- "3.3",
- "hgADp3g+xHHPD34bAuxMWtB+OQ718Tlw69jVp2KPJNk=",
+ "3.4",
+ "icv/JayTYDOSCpbm60qU7EccSxUYVVXQOU7CFZqUK2Y=",
Relocation.of("configurate", "ninja{}leaping{}configurate")
),
CONFIGURATE_HOCON(
- "ninja{}leaping{}configurate",
+ "me{}lucko{}configurate",
"configurate-hocon",
- "3.3",
- "UIy5FVmsBUG6+Z1mpIEE2EXgtOI1ZL0p/eEW+BbtGLU=",
+ "3.4",
+ "A27PLuPnh/rlpcHIABCwjo4QPvjUXaKRUh7sMvbp+Y0=",
Relocation.allOf(
Relocation.of("configurate", "ninja{}leaping{}configurate"),
Relocation.of("hocon", "com{}typesafe{}config")
@@ -204,6 +204,23 @@ public enum Dependency {
"1.3.1",
"5vrfxhCCINOmuGqn5OFsnnu4V7pYlViGMIuxOXImSvA=",
Relocation.of("hocon", "com{}typesafe{}config")
+ ),
+ CONFIGURATE_TOML(
+ "me{}lucko{}configurate",
+ "configurate-toml",
+ "3.4",
+ "skbgSFsBg6wVeudWyCYIzJpz+Ia3CSTVLCGlnF4XD+A=",
+ Relocation.allOf(
+ Relocation.of("configurate", "ninja{}leaping{}configurate"),
+ Relocation.of("toml4j", "com{}moandjiezana{}toml")
+ )
+ ),
+ TOML4J(
+ "com{}moandjiezana{}toml",
+ "toml4j",
+ "0.7.2",
+ "9UdeY+fonl22IiNImux6Vr0wNUN3IHehfCy1TBnKOiA=",
+ Relocation.of("toml4j", "com{}moandjiezana{}toml")
);
private final String url;
diff --git a/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyRegistry.java b/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyRegistry.java
index ec8d45f1..312764de 100644
--- a/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyRegistry.java
+++ b/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyRegistry.java
@@ -27,14 +27,11 @@ package me.lucko.luckperms.common.dependencies;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import me.lucko.luckperms.api.platform.PlatformType;
import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
import me.lucko.luckperms.common.storage.StorageType;
-import java.util.EnumSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -42,17 +39,15 @@ import java.util.Set;
public class DependencyRegistry {
- public static final Set GLOBAL_DEPENDENCIES = ImmutableSet.copyOf(EnumSet.of(
- Dependency.CAFFEINE, Dependency.OKIO, Dependency.OKHTTP
- ));
-
private static final Map> STORAGE_DEPENDENCIES = ImmutableMap.>builder()
.put(StorageType.YAML, ImmutableList.of(Dependency.CONFIGURATE_CORE, Dependency.CONFIGURATE_YAML))
.put(StorageType.JSON, ImmutableList.of(Dependency.CONFIGURATE_CORE, Dependency.CONFIGURATE_GSON))
.put(StorageType.HOCON, ImmutableList.of(Dependency.HOCON_CONFIG, Dependency.CONFIGURATE_CORE, Dependency.CONFIGURATE_HOCON))
+ .put(StorageType.TOML, ImmutableList.of(Dependency.TOML4J, Dependency.CONFIGURATE_CORE, Dependency.CONFIGURATE_TOML))
.put(StorageType.YAML_COMBINED, ImmutableList.of(Dependency.CONFIGURATE_CORE, Dependency.CONFIGURATE_YAML))
.put(StorageType.JSON_COMBINED, ImmutableList.of(Dependency.CONFIGURATE_CORE, Dependency.CONFIGURATE_GSON))
.put(StorageType.HOCON_COMBINED, ImmutableList.of(Dependency.HOCON_CONFIG, Dependency.CONFIGURATE_CORE, Dependency.CONFIGURATE_HOCON))
+ .put(StorageType.TOML_COMBINED, ImmutableList.of(Dependency.TOML4J, Dependency.CONFIGURATE_CORE, Dependency.CONFIGURATE_TOML))
.put(StorageType.MONGODB, ImmutableList.of(Dependency.MONGODB_DRIVER))
.put(StorageType.MARIADB, ImmutableList.of(Dependency.MARIADB_DRIVER, Dependency.SLF4J_API, Dependency.SLF4J_SIMPLE, Dependency.HIKARI))
.put(StorageType.MYSQL, ImmutableList.of(Dependency.MYSQL_DRIVER, Dependency.SLF4J_API, Dependency.SLF4J_SIMPLE, Dependency.HIKARI))
@@ -85,15 +80,6 @@ public class DependencyRegistry {
dependencies.remove(Dependency.SLF4J_SIMPLE);
}
- // don't load configurate dependencies on sponge
- if (this.plugin.getBootstrap().getType() == PlatformType.SPONGE) {
- dependencies.remove(Dependency.CONFIGURATE_CORE);
- dependencies.remove(Dependency.CONFIGURATE_GSON);
- dependencies.remove(Dependency.CONFIGURATE_YAML);
- dependencies.remove(Dependency.CONFIGURATE_HOCON);
- dependencies.remove(Dependency.HOCON_CONFIG);
- }
-
return dependencies;
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/plugin/AbstractLuckPermsPlugin.java b/common/src/main/java/me/lucko/luckperms/common/plugin/AbstractLuckPermsPlugin.java
index a931b185..7e2d1d99 100644
--- a/common/src/main/java/me/lucko/luckperms/common/plugin/AbstractLuckPermsPlugin.java
+++ b/common/src/main/java/me/lucko/luckperms/common/plugin/AbstractLuckPermsPlugin.java
@@ -39,8 +39,8 @@ import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.config.LuckPermsConfiguration;
import me.lucko.luckperms.common.config.adapter.ConfigurationAdapter;
import me.lucko.luckperms.common.contexts.LuckPermsCalculator;
+import me.lucko.luckperms.common.dependencies.Dependency;
import me.lucko.luckperms.common.dependencies.DependencyManager;
-import me.lucko.luckperms.common.dependencies.DependencyRegistry;
import me.lucko.luckperms.common.event.AbstractEventBus;
import me.lucko.luckperms.common.event.EventFactory;
import me.lucko.luckperms.common.inheritance.InheritanceHandler;
@@ -95,7 +95,7 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
// load dependencies
this.dependencyManager = new DependencyManager(this);
- this.dependencyManager.loadDependencies(DependencyRegistry.GLOBAL_DEPENDENCIES);
+ this.dependencyManager.loadDependencies(getGlobalDependencies());
}
public final void enable() {
@@ -230,6 +230,7 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
}
protected abstract void setupSenderFactory();
+ protected abstract Set getGlobalDependencies();
protected abstract ConfigurationAdapter provideConfigurationAdapter();
protected abstract void registerPlatformListeners();
protected abstract MessagingFactory> provideMessagingFactory();
diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java b/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java
index a1ae76aa..6a6302ae 100644
--- a/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java
+++ b/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java
@@ -36,6 +36,7 @@ import me.lucko.luckperms.common.storage.dao.file.CombinedConfigurateDao;
import me.lucko.luckperms.common.storage.dao.file.SeparatedConfigurateDao;
import me.lucko.luckperms.common.storage.dao.file.loader.HoconLoader;
import me.lucko.luckperms.common.storage.dao.file.loader.JsonLoader;
+import me.lucko.luckperms.common.storage.dao.file.loader.TomlLoader;
import me.lucko.luckperms.common.storage.dao.file.loader.YamlLoader;
import me.lucko.luckperms.common.storage.dao.mongodb.MongoDao;
import me.lucko.luckperms.common.storage.dao.sql.SqlDao;
@@ -168,12 +169,16 @@ public class StorageFactory {
return new SeparatedConfigurateDao(this.plugin, new JsonLoader(), "JSON", ".json", "json-storage");
case HOCON:
return new SeparatedConfigurateDao(this.plugin, new HoconLoader(), "HOCON", ".conf", "hocon-storage");
+ case TOML:
+ return new SeparatedConfigurateDao(this.plugin, new TomlLoader(), "TOML", ".toml", "toml-storage");
case YAML_COMBINED:
return new CombinedConfigurateDao(this.plugin, new YamlLoader(), "YAML Combined", ".yml", "yaml-storage");
case JSON_COMBINED:
return new CombinedConfigurateDao(this.plugin, new JsonLoader(), "JSON Combined", ".json", "json-storage");
case HOCON_COMBINED:
return new CombinedConfigurateDao(this.plugin, new HoconLoader(), "HOCON Combined", ".conf", "hocon-storage");
+ case TOML_COMBINED:
+ return new CombinedConfigurateDao(this.plugin, new TomlLoader(), "TOML Combined", ".toml", "toml-storage");
default:
throw new RuntimeException("Unknown method: " + method);
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/StorageType.java b/common/src/main/java/me/lucko/luckperms/common/storage/StorageType.java
index 47582323..2d794b4e 100644
--- a/common/src/main/java/me/lucko/luckperms/common/storage/StorageType.java
+++ b/common/src/main/java/me/lucko/luckperms/common/storage/StorageType.java
@@ -35,9 +35,11 @@ public enum StorageType {
YAML("YAML", "yaml", "yml"),
JSON("JSON", "json", "flatfile"),
HOCON("HOCON", "hocon"),
+ TOML("TOML", "toml"),
YAML_COMBINED("YAML Combined", "yaml-combined"),
JSON_COMBINED("JSON Combined", "json-combined"),
HOCON_COMBINED("HOCON Combined", "hocon-combined"),
+ TOML_COMBINED("TOML Combined", "toml-combined"),
// Remote databases
MONGODB("MongoDB", "mongodb"),
diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/dao/file/AbstractConfigurateDao.java b/common/src/main/java/me/lucko/luckperms/common/storage/dao/file/AbstractConfigurateDao.java
index b25f70e7..63cd743f 100644
--- a/common/src/main/java/me/lucko/luckperms/common/storage/dao/file/AbstractConfigurateDao.java
+++ b/common/src/main/java/me/lucko/luckperms/common/storage/dao/file/AbstractConfigurateDao.java
@@ -48,6 +48,7 @@ import me.lucko.luckperms.common.storage.PlayerSaveResult;
import me.lucko.luckperms.common.storage.dao.AbstractDao;
import me.lucko.luckperms.common.storage.dao.file.loader.ConfigurateLoader;
import me.lucko.luckperms.common.storage.dao.file.loader.JsonLoader;
+import me.lucko.luckperms.common.storage.dao.file.loader.YamlLoader;
import me.lucko.luckperms.common.utils.ImmutableCollectors;
import me.lucko.luckperms.common.utils.MoreFiles;
@@ -480,16 +481,37 @@ public abstract class AbstractConfigurateDao extends AbstractDao {
}
}
- private static Map.Entry parseEntry(ConfigurationNode appended) {
+ private static Map.Entry parseEntry(ConfigurationNode appended, String keyFieldName) {
if (!appended.hasMapChildren()) {
return null;
}
- Map.Entry