Update dependencies
- Updated checkstyle - Fixed new checkstyle issues - Added staged feature: reloading server.properties partially
This commit is contained in:
parent
d52e834f11
commit
466e2659e8
51 changed files with 228 additions and 93 deletions
|
|
@ -5,9 +5,9 @@ archivesBaseName = rootProject.name + '-Bukkit'
|
|||
|
||||
dependencies {
|
||||
implementation 'co.aikar:acf-paper:0.5.0-SNAPSHOT'
|
||||
implementation 'org.bstats:bstats-bukkit:1.7'
|
||||
implementation 'org.bstats:bstats-bukkit:1.8'
|
||||
implementation project(":Common")
|
||||
compileOnly 'com.destroystokyo.paper:paper-api:1.16.1-R0.1-SNAPSHOT'
|
||||
compileOnly 'com.destroystokyo.paper:paper-api:1.16.4-R0.1-SNAPSHOT'
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@ package net.frankheijden.serverutils.bukkit;
|
|||
import co.aikar.commands.BukkitCommandCompletionContext;
|
||||
import co.aikar.commands.CommandCompletions;
|
||||
import co.aikar.commands.PaperCommandManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.commands.CommandPlugins;
|
||||
import net.frankheijden.serverutils.bukkit.commands.CommandServerUtils;
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitPlugin;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import co.aikar.commands.annotation.CommandPermission;
|
|||
import co.aikar.commands.annotation.Default;
|
||||
import co.aikar.commands.annotation.Description;
|
||||
import co.aikar.commands.annotation.Subcommand;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.managers.BukkitPluginManager;
|
||||
import net.frankheijden.serverutils.bukkit.utils.BukkitUtils;
|
||||
import net.frankheijden.serverutils.common.commands.Plugins;
|
||||
|
|
|
|||
|
|
@ -13,16 +13,15 @@ import co.aikar.commands.annotation.Default;
|
|||
import co.aikar.commands.annotation.Dependency;
|
||||
import co.aikar.commands.annotation.Description;
|
||||
import co.aikar.commands.annotation.Subcommand;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.ServerUtils;
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitLoadResult;
|
||||
import net.frankheijden.serverutils.bukkit.managers.BukkitPluginManager;
|
||||
import net.frankheijden.serverutils.bukkit.reflection.RCraftServer;
|
||||
import net.frankheijden.serverutils.bukkit.reflection.RDedicatedServer;
|
||||
import net.frankheijden.serverutils.bukkit.utils.BukkitUtils;
|
||||
import net.frankheijden.serverutils.bukkit.utils.ReloadHandler;
|
||||
import net.frankheijden.serverutils.common.config.Messenger;
|
||||
|
|
@ -55,6 +54,7 @@ public class CommandServerUtils extends BaseCommand {
|
|||
supportedConfigs.put("server-icon.png", RCraftServer::loadIcon);
|
||||
supportedConfigs.put("banned-ips.json", RCraftServer::reloadIpBans);
|
||||
supportedConfigs.put("banned-players.json", RCraftServer::reloadProfileBans);
|
||||
supportedConfigs.put("server.properties", RDedicatedServer::reloadServerProperties);
|
||||
}
|
||||
|
||||
@Dependency
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package net.frankheijden.serverutils.bukkit.entities;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.ServerUtils;
|
||||
import net.frankheijden.serverutils.bukkit.managers.BukkitPluginManager;
|
||||
import net.frankheijden.serverutils.bukkit.managers.BukkitTaskManager;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package net.frankheijden.serverutils.bukkit.entities;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.ServerUtils;
|
||||
import net.frankheijden.serverutils.common.config.YamlConfig;
|
||||
import net.frankheijden.serverutils.common.providers.ResourceProvider;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import java.util.Collection;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.common.config.YamlConfig;
|
||||
import org.bukkit.configuration.MemorySection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.ServerUtils;
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitLoadResult;
|
||||
import net.frankheijden.serverutils.bukkit.reflection.RCommandMap;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import java.lang.reflect.Field;
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import java.lang.reflect.Field;
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Warning;
|
||||
|
|
@ -67,7 +66,8 @@ public class RCraftServer {
|
|||
fieldOf("playerList"));
|
||||
methods = getAllMethods(craftServerClass,
|
||||
methodOf("loadIcon"),
|
||||
methodOf("syncCommands", min(13)));
|
||||
methodOf("syncCommands", min(13)),
|
||||
methodOf("getHandle"));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ public class RCraftServer {
|
|||
* @throws IllegalAccessException When prohibited access to the method.
|
||||
*/
|
||||
public static File getOptionsFile(String option) throws IllegalAccessException, InvocationTargetException {
|
||||
Object console = get(fields, craftServer, "console");
|
||||
Object console = getConsole();
|
||||
Object options = get(RDedicatedServer.getFields(), console, "options");
|
||||
return (File) invoke(ROptionSet.getMethods(), options, "valueOf", option);
|
||||
}
|
||||
|
|
@ -106,6 +106,10 @@ public class RCraftServer {
|
|||
invoke(methods, craftServer, "syncCommands");
|
||||
}
|
||||
|
||||
public static Object getConsole() throws IllegalAccessException {
|
||||
return get(fields, craftServer, "console");
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the bukkit configuration.
|
||||
* @throws ReflectiveOperationException Iff exception thrown regarding reflection.
|
||||
|
|
@ -114,7 +118,7 @@ public class RCraftServer {
|
|||
YamlConfiguration bukkit = YamlConfiguration.loadConfiguration(getConfigFile());
|
||||
set(fields, craftServer, "configuration", bukkit);
|
||||
|
||||
Object console = get(fields, craftServer, "console");
|
||||
Object console = getConsole();
|
||||
RDedicatedServer.reload(console);
|
||||
|
||||
set(fields, craftServer, "monsterSpawn", bukkit.getInt("spawn-limits.monsters"));
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import java.util.Collection;
|
|||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
import net.frankheijden.serverutils.common.utils.MapUtils;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
|
|
|||
|
|
@ -14,11 +14,15 @@ import static net.frankheijden.serverutils.common.reflection.VersionParam.exact;
|
|||
import static net.frankheijden.serverutils.common.reflection.VersionParam.max;
|
||||
import static net.frankheijden.serverutils.common.reflection.VersionParam.min;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.Properties;
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
import net.frankheijden.serverutils.common.reflection.VersionParam;
|
||||
|
||||
|
|
@ -62,6 +66,14 @@ public class RDedicatedServer {
|
|||
}
|
||||
}
|
||||
|
||||
public static Class<?> getClazz() {
|
||||
return dedicatedServerClass;
|
||||
}
|
||||
|
||||
public static Object getCustomRegistry(Object dedicatedServer) throws ReflectiveOperationException {
|
||||
return invoke(methods, dedicatedServer, "getCustomRegistry");
|
||||
}
|
||||
|
||||
public static Map<String, Field> getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
|
@ -115,6 +127,30 @@ public class RDedicatedServer {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads server.properties.
|
||||
* @throws ReflectiveOperationException Iff exception thrown regarding reflection.
|
||||
*/
|
||||
public static void reloadServerProperties() throws ReflectiveOperationException {
|
||||
Object console = RCraftServer.getConsole();
|
||||
Object playerList = get(RMinecraftServer.getFields(), console, "playerList");
|
||||
Object propertyManager = get(fields, console, "propertyManager");
|
||||
Path path = RDedicatedServerSettings.getServerPropertiesPath(propertyManager);
|
||||
|
||||
Properties properties = new Properties();
|
||||
try (InputStream in = new FileInputStream(path.toFile())) {
|
||||
properties.load(in);
|
||||
} catch (IOException ex) {
|
||||
throw new ReflectiveOperationException("Unable to load server.properties", ex);
|
||||
}
|
||||
|
||||
int maxPlayers = Integer.parseInt(properties.getProperty("max-players"));
|
||||
set(RPlayerList.getFields(), playerList, "maxPlayers", maxPlayers);
|
||||
|
||||
int viewDistance = Integer.parseInt(properties.getProperty("view-distance"));
|
||||
RPlayerList.setViewDistance(playerList, viewDistance);
|
||||
}
|
||||
|
||||
public static Object getConfigValue(Object config, String key) throws IllegalAccessException {
|
||||
return get(RDedicatedServerProperties.getFields(), config, key);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.get
|
|||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
|
||||
public class RDedicatedServerProperties {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,26 @@
|
|||
package net.frankheijden.serverutils.bukkit.reflection;
|
||||
|
||||
import static net.frankheijden.serverutils.common.reflection.ConstructorParam.constructorOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.FieldParam.fieldOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.MethodParam.methodOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.get;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllConstructors;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllFields;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllMethods;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
|
||||
public class RDedicatedServerSettings {
|
||||
|
||||
private static Class<?> serverSettingsClass;
|
||||
private static Map<String, Method> methods;
|
||||
private static Map<String, Field> fields;
|
||||
private static List<Constructor<?>> constructors;
|
||||
|
||||
static {
|
||||
|
|
@ -24,6 +29,8 @@ public class RDedicatedServerSettings {
|
|||
BukkitReflection.NMS));
|
||||
methods = getAllMethods(serverSettingsClass,
|
||||
methodOf("getProperties"));
|
||||
fields = getAllFields(serverSettingsClass,
|
||||
fieldOf("path"));
|
||||
constructors = getAllConstructors(serverSettingsClass,
|
||||
constructorOf(Class.forName("joptsimple.OptionSet")),
|
||||
constructorOf(Class.forName(String.format("net.minecraft.server.%s.IRegistryCustom",
|
||||
|
|
@ -52,6 +59,10 @@ public class RDedicatedServerSettings {
|
|||
return getConstructor().newInstance(registry, options);
|
||||
}
|
||||
|
||||
public static Path getServerPropertiesPath(Object instance) throws ReflectiveOperationException {
|
||||
return (Path) get(fields, instance, "path");
|
||||
}
|
||||
|
||||
public static Map<String, Method> getMethods() {
|
||||
return methods;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import java.lang.reflect.Field;
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class RJavaPlugin {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.get
|
|||
import java.lang.reflect.Field;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
||||
|
||||
public class RJavaPluginLoader {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.inv
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
|
||||
public class RJsonList {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import java.util.Locale;
|
|||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
package net.frankheijden.serverutils.bukkit.reflection;
|
||||
|
||||
import static net.frankheijden.serverutils.common.reflection.FieldParam.fieldOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.MethodParam.methodOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllFields;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllMethods;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
|
||||
public class RMinecraftServer {
|
||||
|
||||
private static Class<?> minecraftServerClass;
|
||||
private static Map<String, Method> methods;
|
||||
private static Map<String, Field> fields;
|
||||
|
||||
static {
|
||||
try {
|
||||
|
|
@ -20,6 +23,8 @@ public class RMinecraftServer {
|
|||
methods = getAllMethods(minecraftServerClass,
|
||||
methodOf("getServer"),
|
||||
methodOf("getCraftingManager"));
|
||||
fields = getAllFields(minecraftServerClass,
|
||||
fieldOf("playerList"));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
|
@ -28,4 +33,8 @@ public class RMinecraftServer {
|
|||
public static Map<String, Method> getMethods() {
|
||||
return methods;
|
||||
}
|
||||
|
||||
public static Map<String, Field> getFields() {
|
||||
return fields;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,33 @@
|
|||
package net.frankheijden.serverutils.bukkit.reflection;
|
||||
|
||||
import static net.frankheijden.serverutils.common.reflection.FieldParam.fieldOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.MethodParam.methodOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllFields;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllMethods;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.invoke;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.set;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
|
||||
public class RPlayerList {
|
||||
|
||||
private static Class<?> playerListClass;
|
||||
private static Map<String, Method> methods;
|
||||
private static Map<String, Field> fields;
|
||||
|
||||
static {
|
||||
try {
|
||||
playerListClass = Class.forName(String.format("net.minecraft.server.%s.PlayerList", BukkitReflection.NMS));
|
||||
methods = getAllMethods(playerListClass,
|
||||
methodOf("getIPBans"),
|
||||
methodOf("getProfileBans"));
|
||||
methodOf("getProfileBans"),
|
||||
methodOf("a", int.class));
|
||||
fields = getAllFields(playerListClass,
|
||||
fieldOf("maxPlayers"),
|
||||
fieldOf("viewDistance"));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
|
@ -27,4 +36,13 @@ public class RPlayerList {
|
|||
public static Map<String, Method> getMethods() {
|
||||
return methods;
|
||||
}
|
||||
|
||||
public static Map<String, Field> getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
public static void setViewDistance(Object instance, int viewDistance) throws ReflectiveOperationException {
|
||||
set(fields, instance, "viewDistance", viewDistance);
|
||||
invoke(methods, instance, "a", viewDistance);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.get
|
|||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
|
||||
public class RPropertyManager {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.get
|
|||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
import net.frankheijden.serverutils.common.utils.MapUtils;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.get
|
|||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import net.frankheijden.serverutils.bukkit.entities.BukkitReflection;
|
||||
import net.frankheijden.serverutils.common.utils.MapUtils;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginLoader;
|
||||
import org.bukkit.plugin.SimplePluginManager;
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
implementation 'co.aikar:acf-bungee:0.5.0-SNAPSHOT'
|
||||
implementation 'org.bstats:bstats-bungeecord:1.7'
|
||||
implementation 'org.bstats:bstats-bungeecord:1.8'
|
||||
implementation project(":Common")
|
||||
compileOnly 'net.md-5:bungeecord-api:1.16-R0.2-SNAPSHOT'
|
||||
compileOnly 'net.md-5:bungeecord-api:1.16-R0.4-SNAPSHOT'
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,9 @@ import co.aikar.commands.annotation.CommandPermission;
|
|||
import co.aikar.commands.annotation.Default;
|
||||
import co.aikar.commands.annotation.Description;
|
||||
import co.aikar.commands.annotation.Subcommand;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.frankheijden.serverutils.bungee.ServerUtils;
|
||||
import net.frankheijden.serverutils.bungee.entities.BungeeLoadResult;
|
||||
import net.frankheijden.serverutils.bungee.managers.BungeePluginManager;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package net.frankheijden.serverutils.bungee.entities;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.frankheijden.serverutils.bungee.ServerUtils;
|
||||
import net.frankheijden.serverutils.bungee.managers.BungeePluginManager;
|
||||
import net.frankheijden.serverutils.bungee.managers.BungeeTaskManager;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.frankheijden.serverutils.bungee.entities;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import net.frankheijden.serverutils.bungee.ServerUtils;
|
||||
import net.frankheijden.serverutils.common.config.YamlConfig;
|
||||
import net.frankheijden.serverutils.common.providers.ResourceProvider;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import java.util.Collection;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.common.config.YamlConfig;
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
import net.md_5.bungee.config.ConfigurationProvider;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package net.frankheijden.serverutils.bungee.managers;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
|
@ -17,7 +16,6 @@ import java.util.jar.JarEntry;
|
|||
import java.util.jar.JarFile;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.frankheijden.serverutils.bungee.ServerUtils;
|
||||
import net.frankheijden.serverutils.bungee.entities.BungeeLoadResult;
|
||||
import net.frankheijden.serverutils.bungee.reflection.RPluginClassLoader;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import java.lang.reflect.Field;
|
|||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.md_5.bungee.api.plugin.PluginDescription;
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.get
|
|||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllFields;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
import net.frankheijden.serverutils.common.utils.MapUtils;
|
||||
import net.md_5.bungee.api.plugin.Command;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
compileOnly 'com.github.FrankHeijden:ServerUtilsUpdater:v1.0.0'
|
||||
compileOnly 'com.google.code.gson:gson:2.8.0'
|
||||
compileOnly 'com.google.code.gson:gson:2.8.6'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package net.frankheijden.serverutils.common.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.frankheijden.serverutils.common.config.Messenger;
|
||||
import net.frankheijden.serverutils.common.entities.ServerCommandSender;
|
||||
import net.frankheijden.serverutils.common.utils.ListBuilder;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package net.frankheijden.serverutils.common.config;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
||||
import net.frankheijden.serverutils.common.ServerUtilsApp;
|
||||
import net.frankheijden.serverutils.common.entities.ServerUtilsPlugin;
|
||||
import net.frankheijden.serverutils.common.providers.ResourceProvider;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.frankheijden.serverutils.common.entities;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.frankheijden.serverutils.common.managers.AbstractPluginManager;
|
||||
import net.frankheijden.serverutils.common.managers.AbstractTaskManager;
|
||||
import net.frankheijden.serverutils.common.managers.AbstractVersionManager;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package net.frankheijden.serverutils.common.managers;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.frankheijden.serverutils.common.ServerUtilsApp;
|
||||
import net.frankheijden.serverutils.common.entities.AbstractResult;
|
||||
import net.frankheijden.serverutils.common.entities.CloseableResult;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.frankheijden.serverutils.common.entities.AbstractTask;
|
||||
|
||||
public abstract class AbstractTaskManager<T> {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package net.frankheijden.serverutils.common.providers;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
||||
import net.frankheijden.serverutils.common.config.YamlConfig;
|
||||
|
||||
public interface ResourceProvider {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package net.frankheijden.serverutils.common.tasks;
|
||||
|
||||
import com.sun.nio.file.SensitivityWatchEventModifier;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.ClosedWatchServiceException;
|
||||
|
|
@ -11,7 +10,6 @@ import java.nio.file.WatchEvent;
|
|||
import java.nio.file.WatchKey;
|
||||
import java.nio.file.WatchService;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import net.frankheijden.serverutils.common.ServerUtilsApp;
|
||||
import net.frankheijden.serverutils.common.entities.AbstractTask;
|
||||
import net.frankheijden.serverutils.common.entities.ServerCommandSender;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.frankheijden.serverutils.common.tasks;
|
|||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
|
@ -11,7 +10,6 @@ import java.net.ConnectException;
|
|||
import java.net.SocketTimeoutException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.frankheijden.serverutils.common.ServerUtilsApp;
|
||||
import net.frankheijden.serverutils.common.config.Config;
|
||||
import net.frankheijden.serverutils.common.config.Messenger;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package net.frankheijden.serverutils.common.utils;
|
|||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package net.frankheijden.serverutils.common.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.frankheijden.serverutils.common.config.Messenger;
|
||||
import net.frankheijden.serverutils.common.entities.ServerCommandSender;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package net.frankheijden.serverutils.common.utils;
|
|||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
import net.frankheijden.serverutils.common.entities.ServerCommandSender;
|
||||
|
||||
public class ForwardFilter extends PredicateFilter {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
import static org.junit.jupiter.params.provider.Arguments.of;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.CsvSource;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
import static org.junit.jupiter.params.provider.Arguments.of;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
|
|
|||
14
build.gradle
14
build.gradle
|
|
@ -1,6 +1,6 @@
|
|||
plugins {
|
||||
id 'java'
|
||||
id 'com.github.johnrengelman.shadow' version '5.2.0'
|
||||
id 'com.github.johnrengelman.shadow' version '6.1.0'
|
||||
}
|
||||
|
||||
group = 'net.frankheijden.serverutils'
|
||||
|
|
@ -22,10 +22,10 @@ subprojects {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
testCompile 'org.assertj:assertj-core:3.15.0'
|
||||
testCompile 'org.junit.jupiter:junit-jupiter-api:5.6.2'
|
||||
testCompile 'org.junit.jupiter:junit-jupiter-params:5.6.2'
|
||||
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
|
||||
testCompile 'org.assertj:assertj-core:3.18.1'
|
||||
testCompile 'org.junit.jupiter:junit-jupiter-api:5.7.0'
|
||||
testCompile 'org.junit.jupiter:junit-jupiter-params:5.7.0'
|
||||
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
|
||||
}
|
||||
|
||||
compileJava {
|
||||
|
|
@ -39,8 +39,8 @@ subprojects {
|
|||
}
|
||||
|
||||
checkstyle {
|
||||
toolVersion "8.25"
|
||||
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
|
||||
toolVersion "8.38"
|
||||
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
|
||||
|
||||
ignoreFailures = false
|
||||
maxErrors = 0
|
||||
|
|
|
|||
|
|
@ -7,12 +7,16 @@
|
|||
Checkstyle configuration that checks the Google coding conventions from Google Java Style
|
||||
that can be found at https://google.github.io/styleguide/javaguide.html
|
||||
Checkstyle is very configurable. Be sure to read the documentation at
|
||||
http://checkstyle.sf.net (or in your downloaded distribution).
|
||||
http://checkstyle.org (or in your downloaded distribution).
|
||||
To completely disable a check, just comment it out or delete it from the file.
|
||||
To suppress certain violations please review suppression filters.
|
||||
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
|
||||
-->
|
||||
|
||||
<module name = "Checker">
|
||||
|
||||
<module name="SuppressWarningsFilter"/>
|
||||
|
||||
<property name="charset" value="UTF-8"/>
|
||||
|
||||
<property name="severity" value="warning"/>
|
||||
|
|
@ -23,12 +27,14 @@
|
|||
<module name="BeforeExecutionExclusionFileFilter">
|
||||
<property name="fileNamePattern" value="module\-info\.java$"/>
|
||||
</module>
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
|
||||
<module name="SuppressionFilter">
|
||||
<property name="file" value="${config_loc}/suppressions.xml" />
|
||||
</module>
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.org/config_whitespace.html -->
|
||||
|
||||
<module name="LineLength">
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<!-- changed from 100 to 120, loosen a bit -->
|
||||
|
|
@ -37,6 +43,17 @@
|
|||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="SuppressWarningsHolder"/>
|
||||
<module name="SuppressWarnings">
|
||||
<property name="id" value="checkstyle:suppresswarnings"/>
|
||||
</module>
|
||||
<module name="SuppressWithNearbyCommentFilter"/>
|
||||
<module name="SuppressionCommentFilter">
|
||||
<metadata name="net.sf.eclipsecs.core.comment" value="Single warning"/>
|
||||
<property name="offCommentFormat" value="CHECKSTYLE\:OFF\: ([\w\|]+)"/>
|
||||
<property name="onCommentFormat" value="CHECKSTYLE\:ON\: ([\w\|]+)"/>
|
||||
<property name="checkFormat" value="$1"/>
|
||||
</module>
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="IllegalTokenText">
|
||||
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
|
||||
|
|
@ -52,16 +69,26 @@
|
|||
</module>
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="OneTopLevelClass"/>
|
||||
<module name="NoLineWrap"/>
|
||||
<module name="NoLineWrap">
|
||||
<property name="tokens" value="PACKAGE_DEF, IMPORT, STATIC_IMPORT"/>
|
||||
</module>
|
||||
<module name="EmptyBlock">
|
||||
<property name="option" value="TEXT"/>
|
||||
<property name="tokens"
|
||||
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
|
||||
</module>
|
||||
<!-- Disabled because it makes certain code pieces neater.
|
||||
<module name="NeedBraces"/>
|
||||
-->
|
||||
<module name="LeftCurly"/>
|
||||
<module name="NeedBraces">
|
||||
<property name="tokens"
|
||||
value="LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE"/>
|
||||
</module>
|
||||
<module name="LeftCurly">
|
||||
<property name="tokens"
|
||||
value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
|
||||
INTERFACE_DEF, LAMBDA, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT,
|
||||
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
|
||||
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF,
|
||||
OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="RightCurly">
|
||||
<property name="id" value="RightCurlySame"/>
|
||||
<property name="tokens"
|
||||
|
|
@ -73,7 +100,19 @@
|
|||
<property name="option" value="alone"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
|
||||
INSTANCE_INIT"/>
|
||||
INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, INTERFACE_DEF, RECORD_DEF,
|
||||
COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<!-- suppresion is required till https://github.com/checkstyle/checkstyle/issues/7541 -->
|
||||
<property name="id" value="RightCurlyAlone"/>
|
||||
<property name="query" value="//RCURLY[parent::SLIST[count(./*)=1]
|
||||
or preceding-sibling::*[last()][self::LCURLY]]"/>
|
||||
</module>
|
||||
<module name="WhitespaceAfter">
|
||||
<property name="tokens"
|
||||
value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE,
|
||||
LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/>
|
||||
</module>
|
||||
<module name="WhitespaceAround">
|
||||
<property name="allowEmptyConstructors" value="true"/>
|
||||
|
|
@ -81,6 +120,15 @@
|
|||
<property name="allowEmptyMethods" value="true"/>
|
||||
<property name="allowEmptyTypes" value="true"/>
|
||||
<property name="allowEmptyLoops" value="true"/>
|
||||
<property name="ignoreEnhancedForColon" value="false"/>
|
||||
<property name="tokens"
|
||||
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
|
||||
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND,
|
||||
LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
|
||||
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
|
||||
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
|
||||
NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
|
||||
SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
|
||||
<message key="ws.notFollowed"
|
||||
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
|
||||
<message key="ws.notPreceded"
|
||||
|
|
@ -90,10 +138,13 @@
|
|||
<module name="MultipleVariableDeclarations"/>
|
||||
<module name="ArrayTypeStyle"/>
|
||||
<module name="MissingSwitchDefault"/>
|
||||
<module name="FallThrough"/>
|
||||
<module name="UpperEll"/>
|
||||
<module name="ModifierOrder"/>
|
||||
<module name="EmptyLineSeparator">
|
||||
<property name="tokens"
|
||||
value="PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
|
||||
STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF,
|
||||
COMPACT_CTOR_DEF"/>
|
||||
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
|
|
@ -129,6 +180,8 @@
|
|||
value="Package name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="TypeName">
|
||||
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
|
||||
ANNOTATION_DEF, RECORD_DEF"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
|
|
@ -153,16 +206,25 @@
|
|||
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="LocalVariableName">
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="PatternVariableName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Pattern variable name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ClassTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Class type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="RecordTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Record type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="MethodTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
|
|
@ -194,22 +256,40 @@
|
|||
</module>
|
||||
<module name="AbbreviationAsWordInName">
|
||||
<property name="ignoreFinal" value="false"/>
|
||||
<property name="allowedAbbreviationLength" value="1"/>
|
||||
<property name="allowedAbbreviationLength" value="0"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF,
|
||||
PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF,
|
||||
RECORD_COMPONENT_DEF"/>
|
||||
</module>
|
||||
<module name="OverloadMethodsDeclarationOrder"/>
|
||||
<module name="VariableDeclarationUsageDistance"/>
|
||||
<module name="CustomImportOrder">
|
||||
<property name="sortImportsInGroupAlphabetically" value="true"/>
|
||||
<property name="sortImportsInGroupAlphabetically" value="false"/>
|
||||
<property name="separateLineBetweenGroups" value="true"/>
|
||||
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
|
||||
<property name="tokens" value="IMPORT, STATIC_IMPORT, PACKAGE_DEF"/>
|
||||
</module>
|
||||
<module name="UnusedImports"/>
|
||||
<module name="MethodParamPad">
|
||||
<property name="tokens"
|
||||
value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF,
|
||||
SUPER_CTOR_CALL, ENUM_CONSTANT_DEF, RECORD_DEF"/>
|
||||
</module>
|
||||
<module name="MethodParamPad"/>
|
||||
<module name="NoWhitespaceBefore">
|
||||
<property name="tokens"
|
||||
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
|
||||
value="COMMA, SEMI, POST_INC, POST_DEC, DOT,
|
||||
LABELED_STAT, METHOD_REF"/>
|
||||
<property name="allowLineBreaks" value="true"/>
|
||||
</module>
|
||||
<module name="ParenPad"/>
|
||||
<module name="ParenPad">
|
||||
<property name="tokens"
|
||||
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
|
||||
EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
|
||||
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL,
|
||||
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA,
|
||||
RECORD_DEF"/>
|
||||
</module>
|
||||
<module name="OperatorWrap">
|
||||
<property name="option" value="NL"/>
|
||||
<property name="tokens"
|
||||
|
|
@ -219,7 +299,8 @@
|
|||
<module name="AnnotationLocation">
|
||||
<property name="id" value="AnnotationLocationMostCases"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF,
|
||||
RECORD_DEF, COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="AnnotationLocation">
|
||||
<property name="id" value="AnnotationLocationVariables"/>
|
||||
|
|
@ -234,6 +315,7 @@
|
|||
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
|
||||
</module>
|
||||
<module name="JavadocParagraph"/>
|
||||
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
|
||||
<module name="AtclauseOrder">
|
||||
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
|
||||
<property name="target"
|
||||
|
|
@ -242,15 +324,16 @@
|
|||
<module name="JavadocMethod">
|
||||
<property name="scope" value="public"/>
|
||||
<property name="allowMissingParamTags" value="true"/>
|
||||
<property name="allowMissingThrowsTags" value="true"/>
|
||||
<property name="allowMissingReturnTag" value="true"/>
|
||||
<property name="allowedAnnotations" value="Override, Test"/>
|
||||
<property name="allowThrowsTagsForSubclasses" value="true"/>
|
||||
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="MissingJavadocMethod">
|
||||
<property name="scope" value="public"/>
|
||||
<property name="minLineCount" value="2"/>
|
||||
<property name="allowedAnnotations" value="Override, Test"/>
|
||||
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF,
|
||||
COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="MethodName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
|
||||
|
|
@ -263,6 +346,14 @@
|
|||
<module name="EmptyCatchBlock">
|
||||
<property name="exceptionVariableName" value="expected"/>
|
||||
</module>
|
||||
<module name="CommentsIndentation"/>
|
||||
<module name="CommentsIndentation">
|
||||
<property name="tokens" value="SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN"/>
|
||||
</module>
|
||||
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
|
||||
<module name="SuppressionXpathFilter">
|
||||
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
|
||||
default="checkstyle-xpath-suppressions.xml" />
|
||||
<property name="optional" value="true"/>
|
||||
</module>
|
||||
</module>
|
||||
</module>
|
||||
8
config/checkstyle/suppressions.xml
Normal file
8
config/checkstyle/suppressions.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
|
||||
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
|
||||
<suppressions>
|
||||
<suppress files="." checks="RequireEmptyLineBeforeBlockTagGroup" />
|
||||
<suppress files="." checks="AbbreviationAsWordInName" />
|
||||
</suppressions>
|
||||
|
|
@ -1,2 +1,4 @@
|
|||
rootProject.name = 'ServerUtils'
|
||||
include 'Common', 'Bukkit', 'Bungee'
|
||||
include 'Common'
|
||||
include 'Bukkit'
|
||||
include 'Bungee'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue