small cleanup
This commit is contained in:
@@ -105,7 +105,7 @@ public class CommandManager {
|
||||
|
||||
}
|
||||
|
||||
public void registerMainCommand(MainCommand command) {
|
||||
private void registerMainCommand(MainCommand command) {
|
||||
plugin.getLogger().log(Level.INFO, "[CommandManager] Registered main command '" + command.getName() + "'");
|
||||
mainCommands.add(command);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public abstract class MainCommand {
|
||||
@Getter
|
||||
private final int requiredArgsLength;
|
||||
|
||||
public MainCommand(String name, String usage, int requiredArgsLength) {
|
||||
protected MainCommand(String name, String usage, int requiredArgsLength) {
|
||||
this.name = name;
|
||||
this.usage = usage;
|
||||
this.requiredArgsLength = requiredArgsLength;
|
||||
|
||||
@@ -16,7 +16,7 @@ public abstract class SubCommand {
|
||||
@Getter
|
||||
private final String permission;
|
||||
|
||||
public SubCommand(String name, String description, String usage, String permission) {
|
||||
protected SubCommand(String name, String description, String usage, String permission) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.usage = usage;
|
||||
|
||||
@@ -9,7 +9,7 @@ import me.lucko.luckperms.groups.Group;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class GroupSubCommand extends SubCommand {
|
||||
public GroupSubCommand(String name, String description, String usage, String permission) {
|
||||
protected GroupSubCommand(String name, String description, String usage, String permission) {
|
||||
super(name, description, usage, permission);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import me.lucko.luckperms.users.User;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class UserSubCommand extends SubCommand {
|
||||
public UserSubCommand(String name, String description, String usage, String permission) {
|
||||
protected UserSubCommand(String name, String description, String usage, String permission) {
|
||||
super(name, description, usage, permission);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ public abstract class Datastore {
|
||||
protected final LuckPermsPlugin plugin;
|
||||
|
||||
@Getter
|
||||
public String name;
|
||||
public final String name;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean acceptingLogins;
|
||||
|
||||
public Datastore(LuckPermsPlugin plugin, String name) {
|
||||
protected Datastore(LuckPermsPlugin plugin, String name) {
|
||||
this.plugin = plugin;
|
||||
this.name = name;
|
||||
this.acceptingLogins = true;
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MySQLDatastore extends SQLDatastore {
|
||||
private static final String CREATETABLE_USERS = "CREATE TABLE IF NOT EXISTS `lp_users` (`uuid` VARCHAR(36) NOT NULL, `name` VARCHAR(16) NOT NULL, `perms` TEXT NOT NULL, PRIMARY KEY (`uuid`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
|
||||
private static final String CREATETABLE_GROUPS = "CREATE TABLE IF NOT EXISTS `lp_groups` (`name` VARCHAR(36) NOT NULL, `perms` TEXT NULL, PRIMARY KEY (`name`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
|
||||
|
||||
private MySQLConfiguration configuration;
|
||||
private final MySQLConfiguration configuration;
|
||||
private HikariDataSource hikari;
|
||||
|
||||
public MySQLDatastore(LuckPermsPlugin plugin, MySQLConfiguration configuration) {
|
||||
|
||||
@@ -39,9 +39,9 @@ public abstract class SQLDatastore extends Datastore {
|
||||
private static final String UUIDCACHE_SELECT = "SELECT uuid FROM lp_uuid WHERE name=?";
|
||||
private static final String UUIDCACHE_UPDATE = "UPDATE lp_uuid SET uuid=? WHERE name=?";
|
||||
|
||||
private Gson gson;
|
||||
private final Gson gson;
|
||||
|
||||
public SQLDatastore(LuckPermsPlugin plugin, String name) {
|
||||
SQLDatastore(LuckPermsPlugin plugin, String name) {
|
||||
super(plugin, name);
|
||||
gson = new Gson();
|
||||
}
|
||||
@@ -317,7 +317,7 @@ public abstract class SQLDatastore extends Datastore {
|
||||
}
|
||||
|
||||
private class Closer {
|
||||
private List<AutoCloseable> objects = new ArrayList<>();
|
||||
private final List<AutoCloseable> objects = new ArrayList<>();
|
||||
|
||||
public void add(AutoCloseable a) {
|
||||
objects.add(a);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class SQLiteDatastore extends SQLDatastore {
|
||||
private static final String CREATETABLE_USERS = "CREATE TABLE IF NOT EXISTS `lp_users` (`uuid` VARCHAR(36) NOT NULL, `name` VARCHAR(16) NOT NULL, `perms` TEXT NOT NULL, PRIMARY KEY (`uuid`));";
|
||||
private static final String CREATETABLE_GROUPS = "CREATE TABLE IF NOT EXISTS `lp_groups` (`name` VARCHAR(36) NOT NULL, `perms` TEXT NULL, PRIMARY KEY (`name`));";
|
||||
|
||||
private File file;
|
||||
private final File file;
|
||||
private Connection connection = null;
|
||||
|
||||
public SQLiteDatastore(LuckPermsPlugin plugin, File file) {
|
||||
|
||||
@@ -12,7 +12,7 @@ public class Group extends PermissionObject {
|
||||
@Getter
|
||||
private final String name;
|
||||
|
||||
public Group(String name, LuckPermsPlugin plugin) {
|
||||
Group(String name, LuckPermsPlugin plugin) {
|
||||
super(plugin, name);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@@ -26,13 +26,13 @@ public abstract class User extends PermissionObject {
|
||||
@Setter
|
||||
private String name;
|
||||
|
||||
public User(UUID uuid, LuckPermsPlugin plugin) {
|
||||
User(UUID uuid, LuckPermsPlugin plugin) {
|
||||
super(plugin, uuid.toString());
|
||||
this.uuid = uuid;
|
||||
this.name = null;
|
||||
}
|
||||
|
||||
public User(UUID uuid, String name, LuckPermsPlugin plugin) {
|
||||
User(UUID uuid, String name, LuckPermsPlugin plugin) {
|
||||
super(plugin, uuid.toString());
|
||||
this.uuid = uuid;
|
||||
this.name = name;
|
||||
|
||||
@@ -2,9 +2,6 @@ package me.lucko.luckperms.users;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.lucko.luckperms.LuckPermsPlugin;
|
||||
import me.lucko.luckperms.commands.Sender;
|
||||
import me.lucko.luckperms.commands.Util;
|
||||
import me.lucko.luckperms.data.Datastore;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -42,7 +42,7 @@ public abstract class PermissionObject {
|
||||
@Setter
|
||||
private Map<String, Boolean> nodes = new HashMap<>();
|
||||
|
||||
public PermissionObject(LuckPermsPlugin plugin, String objectName) {
|
||||
protected PermissionObject(LuckPermsPlugin plugin, String objectName) {
|
||||
this.objectName = objectName;
|
||||
this.plugin = plugin;
|
||||
this.includeGlobalPermissions = plugin.getConfiguration().getIncludeGlobalPerms();
|
||||
|
||||
Reference in New Issue
Block a user