mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-27 21:29:47 +01:00
General cleanup
This commit is contained in:
parent
42322ef932
commit
33fc4f537a
@ -44,7 +44,7 @@ public class Util {
|
||||
if (strings.isEmpty()) return "&6None";
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
strings.stream().forEach(s -> sb.append("&6").append(s).append("&7, "));
|
||||
strings.forEach(s -> sb.append("&6").append(s).append("&7, "));
|
||||
return sb.delete(sb.length() - 2, sb.length()).toString();
|
||||
}
|
||||
|
||||
|
@ -319,9 +319,9 @@ public class FlatfileDatastore extends Datastore {
|
||||
|
||||
@Override
|
||||
public boolean loadAllGroups() {
|
||||
List<String> groups = Arrays.asList(groupsDir.list((dir, name1) -> name1.endsWith(".json")))
|
||||
.stream().map(s -> s.substring(0, s.length() - 5))
|
||||
.collect(Collectors.toList());
|
||||
String[] fileNames = groupsDir.list((dir, name) -> name.endsWith(".json"));
|
||||
if (fileNames == null) return false;
|
||||
List<String> groups = Arrays.stream(fileNames).map(s -> s.substring(0, s.length() - 5)).collect(Collectors.toList());
|
||||
|
||||
plugin.getGroupManager().unloadAll();
|
||||
groups.forEach(this::loadGroup);
|
||||
|
@ -50,7 +50,7 @@ public class MySQLDatastore extends SQLDatastore {
|
||||
@Override
|
||||
public void shutdown() {
|
||||
if (hikari != null) {
|
||||
hikari.shutdown();
|
||||
hikari.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@SuppressWarnings("UnnecessaryLocalVariable")
|
||||
abstract class SQLDatastore extends Datastore {
|
||||
|
@ -96,7 +96,7 @@ public abstract class User extends PermissionObject {
|
||||
/**
|
||||
* Remove the user from a group
|
||||
* @param group the group to remove the user from
|
||||
* @throws ObjectLacksPermissionException
|
||||
* @throws ObjectLacksPermissionException if the user isn't a member of the group
|
||||
*/
|
||||
public void removeGroup(Group group) throws ObjectLacksPermissionException {
|
||||
removeGroup(group, "global");
|
||||
|
Loading…
Reference in New Issue
Block a user