mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-06 19:09:31 +01:00
Some readability
This commit is contained in:
parent
9dbef6acc2
commit
20de713716
@ -27,11 +27,7 @@ import lombok.experimental.UtilityClass;
|
|||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
import me.lucko.luckperms.common.LuckPermsPlugin;
|
import me.lucko.luckperms.common.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.storage.backing.AbstractBacking;
|
import me.lucko.luckperms.common.storage.backing.*;
|
||||||
import me.lucko.luckperms.common.storage.backing.JSONBacking;
|
|
||||||
import me.lucko.luckperms.common.storage.backing.MongoDBBacking;
|
|
||||||
import me.lucko.luckperms.common.storage.backing.SQLLegacyBacking;
|
|
||||||
import me.lucko.luckperms.common.storage.backing.YAMLBacking;
|
|
||||||
import me.lucko.luckperms.common.storage.backing.sqlprovider.H2Provider;
|
import me.lucko.luckperms.common.storage.backing.sqlprovider.H2Provider;
|
||||||
import me.lucko.luckperms.common.storage.backing.sqlprovider.MySQLProvider;
|
import me.lucko.luckperms.common.storage.backing.sqlprovider.MySQLProvider;
|
||||||
import me.lucko.luckperms.common.storage.backing.sqlprovider.SQLiteProvider;
|
import me.lucko.luckperms.common.storage.backing.sqlprovider.SQLiteProvider;
|
||||||
@ -121,6 +117,8 @@ public class StorageFactory {
|
|||||||
switch (method) {
|
switch (method) {
|
||||||
case MYSQL:
|
case MYSQL:
|
||||||
return new SQLLegacyBacking(plugin, new MySQLProvider(plugin.getConfiguration().getDatabaseValues()));
|
return new SQLLegacyBacking(plugin, new MySQLProvider(plugin.getConfiguration().getDatabaseValues()));
|
||||||
|
case CIRNOCRAFT:
|
||||||
|
return new CirnocraftBacking(plugin, plugin.getConfiguration().getDatabaseValues());
|
||||||
case SQLITE:
|
case SQLITE:
|
||||||
return new SQLLegacyBacking(plugin, new SQLiteProvider(new File(plugin.getDataFolder(), "luckperms.sqlite")));
|
return new SQLLegacyBacking(plugin, new SQLiteProvider(new File(plugin.getDataFolder(), "luckperms.sqlite")));
|
||||||
case H2:
|
case H2:
|
||||||
|
@ -41,10 +41,14 @@ import java.util.Map;
|
|||||||
@AllArgsConstructor(staticName = "of")
|
@AllArgsConstructor(staticName = "of")
|
||||||
public class NodeDataHolder {
|
public class NodeDataHolder {
|
||||||
public static NodeDataHolder fromNode(Node node) {
|
public static NodeDataHolder fromNode(Node node) {
|
||||||
long expiry = node.isTemporary() ? node.getExpiryUnixTime() : 0L;
|
return NodeDataHolder.of(
|
||||||
return NodeDataHolder.of(node.getPermission(), node.getValue(),
|
node.getPermission(),
|
||||||
node.getServer().orElse(null), node.getWorld().orElse(null),
|
node.getValue(),
|
||||||
expiry, new Gson().toJson(node.getContexts().toMap()));
|
node.getServer().orElse(null),
|
||||||
|
node.getWorld().orElse(null),
|
||||||
|
node.isTemporary() ? node.getExpiryUnixTime() : 0L,
|
||||||
|
new Gson().toJson(node.getContexts().toMap())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String permission;
|
private final String permission;
|
||||||
|
Loading…
Reference in New Issue
Block a user