mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +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 me.lucko.luckperms.common.LuckPermsPlugin;
|
||||
import me.lucko.luckperms.common.storage.backing.AbstractBacking;
|
||||
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.*;
|
||||
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.SQLiteProvider;
|
||||
@ -121,6 +117,8 @@ public class StorageFactory {
|
||||
switch (method) {
|
||||
case MYSQL:
|
||||
return new SQLLegacyBacking(plugin, new MySQLProvider(plugin.getConfiguration().getDatabaseValues()));
|
||||
case CIRNOCRAFT:
|
||||
return new CirnocraftBacking(plugin, plugin.getConfiguration().getDatabaseValues());
|
||||
case SQLITE:
|
||||
return new SQLLegacyBacking(plugin, new SQLiteProvider(new File(plugin.getDataFolder(), "luckperms.sqlite")));
|
||||
case H2:
|
||||
|
@ -41,10 +41,14 @@ import java.util.Map;
|
||||
@AllArgsConstructor(staticName = "of")
|
||||
public class NodeDataHolder {
|
||||
public static NodeDataHolder fromNode(Node node) {
|
||||
long expiry = node.isTemporary() ? node.getExpiryUnixTime() : 0L;
|
||||
return NodeDataHolder.of(node.getPermission(), node.getValue(),
|
||||
node.getServer().orElse(null), node.getWorld().orElse(null),
|
||||
expiry, new Gson().toJson(node.getContexts().toMap()));
|
||||
return NodeDataHolder.of(
|
||||
node.getPermission(),
|
||||
node.getValue(),
|
||||
node.getServer().orElse(null),
|
||||
node.getWorld().orElse(null),
|
||||
node.isTemporary() ? node.getExpiryUnixTime() : 0L,
|
||||
new Gson().toJson(node.getContexts().toMap())
|
||||
);
|
||||
}
|
||||
|
||||
private final String permission;
|
||||
|
Loading…
Reference in New Issue
Block a user