Release 2.7
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
package me.lucko.luckperms;
|
||||
|
||||
import me.lucko.luckperms.api.Logger;
|
||||
import me.lucko.luckperms.api.PlatformType;
|
||||
import me.lucko.luckperms.api.implementation.ApiProvider;
|
||||
import me.lucko.luckperms.commands.ConsecutiveExecutor;
|
||||
import me.lucko.luckperms.commands.Sender;
|
||||
@@ -68,7 +69,7 @@ public interface LuckPermsPlugin {
|
||||
/**
|
||||
* @return the platform type
|
||||
*/
|
||||
Type getType();
|
||||
PlatformType getType();
|
||||
|
||||
/**
|
||||
* @return the main plugin directory
|
||||
@@ -166,8 +167,4 @@ public interface LuckPermsPlugin {
|
||||
*/
|
||||
void doSync(Runnable r);
|
||||
|
||||
|
||||
enum Type {
|
||||
BUKKIT, BUNGEE, SPONGE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ApiProvider implements LuckPermsApi {
|
||||
|
||||
@Override
|
||||
public double getApiVersion() {
|
||||
return 1.6;
|
||||
return 2.6;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,6 +75,11 @@ public class ApiProvider implements LuckPermsApi {
|
||||
return plugin.getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformType getPlatformType() {
|
||||
return plugin.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerListener(@NonNull LPListener listener) {
|
||||
eventBus.register(listener);
|
||||
|
||||
+28
@@ -27,6 +27,8 @@ import me.lucko.luckperms.api.LPConfiguration;
|
||||
import me.lucko.luckperms.api.data.DatastoreConfiguration;
|
||||
import me.lucko.luckperms.api.data.MySQLConfiguration;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Provides a link between {@link LPConfiguration} and {@link me.lucko.luckperms.core.LPConfiguration}
|
||||
*/
|
||||
@@ -79,6 +81,21 @@ public class LPConfigurationLink implements LPConfiguration {
|
||||
return master.getApplyShorthand();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getLogNotify() {
|
||||
return master.getLogNotify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVaultServer() {
|
||||
return master.getVaultServer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getVaultIncludeGlobal() {
|
||||
return master.getVaultIncludeGlobal();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public MySQLConfiguration getDatabaseValues() {
|
||||
@@ -94,4 +111,15 @@ public class LPConfigurationLink implements LPConfiguration {
|
||||
public String getStorageMethod() {
|
||||
return master.getStorageMethod();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSplitStorage() {
|
||||
return master.getSplitStorage();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Map<String, String> getSplitStorageOptions() {
|
||||
return master.getSplitStorageOptions();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,10 +110,11 @@ public abstract class SubCommand<T> {
|
||||
return permission.isAuthorized(sender);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
----------------------------------------------------------------------------------
|
||||
Utility methods used by #onTabComplete and #execute implementations in sub classes
|
||||
----------------------------------------------------------------------------------
|
||||
* ----------------------------------------------------------------------------------
|
||||
* Utility methods used by #onTabComplete and #execute implementations in sub classes
|
||||
* ----------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
protected static List<String> getGroupTabComplete(List<String> args, LuckPermsPlugin plugin) {
|
||||
|
||||
@@ -108,7 +108,7 @@ public class LogExport extends SubCommand<Log> {
|
||||
break track;
|
||||
}
|
||||
|
||||
b.append("track ").append(e.getActedName()).append(" ").append(e.getAction());;
|
||||
b.append("track ").append(e.getActedName()).append(" ").append(e.getAction());
|
||||
}
|
||||
|
||||
data.add(b.toString());
|
||||
|
||||
+2
-1
@@ -24,6 +24,7 @@ package me.lucko.luckperms.commands.migration.subcommands;
|
||||
|
||||
import me.lucko.luckperms.LuckPermsPlugin;
|
||||
import me.lucko.luckperms.api.Logger;
|
||||
import me.lucko.luckperms.api.PlatformType;
|
||||
import me.lucko.luckperms.commands.CommandResult;
|
||||
import me.lucko.luckperms.commands.Predicate;
|
||||
import me.lucko.luckperms.commands.Sender;
|
||||
@@ -62,7 +63,7 @@ public class MigrationPermissionsEx extends SubCommand<Object> {
|
||||
return CommandResult.STATE_ERROR;
|
||||
}
|
||||
|
||||
if (plugin.getType() != LuckPermsPlugin.Type.BUKKIT) {
|
||||
if (plugin.getType() != PlatformType.BUKKIT) {
|
||||
// Sponge uses a completely different version of PEX.
|
||||
log.severe("PEX import is not supported on this platform.");
|
||||
return CommandResult.STATE_ERROR;
|
||||
|
||||
@@ -70,17 +70,19 @@ public abstract class LPConfiguration<T extends LuckPermsPlugin> {
|
||||
}
|
||||
|
||||
/**
|
||||
* As of 1.6, this value is a constant
|
||||
* As of 2.6, this value is a constant
|
||||
* @return the default group node
|
||||
*/
|
||||
@SuppressWarnings("SameReturnValue")
|
||||
public String getDefaultGroupNode() {
|
||||
return "group.default";
|
||||
}
|
||||
|
||||
/**
|
||||
* As of 1.6, this value is a constant
|
||||
* As of 2.6, this value is a constant
|
||||
* @return the name of the default group
|
||||
*/
|
||||
@SuppressWarnings("SameReturnValue")
|
||||
public String getDefaultGroupName() {
|
||||
return "default";
|
||||
}
|
||||
@@ -109,6 +111,14 @@ public abstract class LPConfiguration<T extends LuckPermsPlugin> {
|
||||
return getBoolean("log-notify", true);
|
||||
}
|
||||
|
||||
public String getVaultServer() {
|
||||
return getString("vault-server", "global");
|
||||
}
|
||||
|
||||
public boolean getVaultIncludeGlobal() {
|
||||
return getBoolean("vault-include-global", true);
|
||||
}
|
||||
|
||||
public DatastoreConfiguration getDatabaseValues() {
|
||||
return new DatastoreConfiguration(
|
||||
getString("data.address", null),
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @see me.lucko.luckperms.api.UuidCache
|
||||
* @see me.lucko.luckperms.api.UuidCache for docs
|
||||
*/
|
||||
public class UuidCache {
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ public class Importer {
|
||||
|
||||
running = true;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public void start(Sender executor, List<String> commands) {
|
||||
|
||||
@@ -53,6 +53,6 @@ public class UpdateTask implements Runnable {
|
||||
// Refresh all online users.
|
||||
plugin.getUserManager().updateAllUsers();
|
||||
|
||||
plugin.getApiProvider().fireEvent(new PostSyncEvent());;
|
||||
plugin.getApiProvider().fireEvent(new PostSyncEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,14 +445,12 @@ public class MongoDBDatastore extends Datastore {
|
||||
The following two methods convert the node maps so they can be stored. */
|
||||
private static <V> Map<String, V> convert(Map<String, V> map) {
|
||||
return map.entrySet().stream()
|
||||
.map(e -> new AbstractMap.SimpleEntry<>(e.getKey().replace(".", "[**DOT**]").replace("$", "[**DOLLAR**]"), e.getValue()))
|
||||
.collect(Collectors.toMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue));
|
||||
.collect(Collectors.toMap(e -> e.getKey().replace(".", "[**DOT**]").replace("$", "[**DOLLAR**]"), Map.Entry::getValue));
|
||||
}
|
||||
|
||||
private static <V> Map<String, V> revert(Map<String, V> map) {
|
||||
return map.entrySet().stream()
|
||||
.map(e -> new AbstractMap.SimpleEntry<>(e.getKey().replace("[**DOT**]", ".").replace("[**DOLLAR**]", "$"), e.getValue()))
|
||||
.collect(Collectors.toMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue));
|
||||
.collect(Collectors.toMap(e -> e.getKey().replace("[**DOT**]", ".").replace("[**DOLLAR**]", "$"), Map.Entry::getValue));
|
||||
}
|
||||
|
||||
private static Document fromUser(User user) {
|
||||
|
||||
@@ -367,6 +367,6 @@ public class YAMLDatastore extends FlatfileDatastore {
|
||||
}
|
||||
|
||||
interface ReadOperation {
|
||||
boolean onRun(Map<String, Object> values) throws IOException;
|
||||
boolean onRun(Map<String, Object> values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public abstract class AbstractManager<I, T extends Identifiable<I>> {
|
||||
}
|
||||
}
|
||||
|
||||
public void preSet(T t) {
|
||||
protected void preSet(T t) {
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public abstract class AbstractManager<I, T extends Identifiable<I>> {
|
||||
}
|
||||
}
|
||||
|
||||
public void preUnload(T t) {
|
||||
protected void preUnload(T t) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user