Slow down on generic usage

This commit is contained in:
Frank van der Heijden 2021-07-24 14:31:08 +02:00
parent 6545d7ffac
commit 779f4785e0
No known key found for this signature in database
GPG key ID: B808721C2DD5B5B8
9 changed files with 14 additions and 80 deletions

View file

@ -6,18 +6,10 @@ import cloud.commandframework.context.CommandContext;
import net.frankheijden.serverutils.bukkit.entities.BukkitCommandSender;
import net.frankheijden.serverutils.bukkit.entities.BukkitPlugin;
import net.frankheijden.serverutils.common.commands.CommandPlugins;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.scheduler.BukkitTask;
public class BukkitCommandPlugins extends CommandPlugins<
BukkitPlugin,
Plugin,
BukkitTask,
BukkitCommandSender,
CommandSender
> {
public class BukkitCommandPlugins extends CommandPlugins<BukkitPlugin, Plugin, BukkitCommandSender> {
public BukkitCommandPlugins(BukkitPlugin plugin) {
super(plugin);

View file

@ -24,19 +24,11 @@ import net.frankheijden.serverutils.common.utils.ForwardFilter;
import net.frankheijden.serverutils.common.utils.ListBuilder;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginIdentifiableCommand;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.scheduler.BukkitTask;
public class BukkitCommandServerUtils extends CommandServerUtils<
BukkitPlugin,
Plugin,
BukkitTask,
BukkitCommandSender,
CommandSender
> {
public class BukkitCommandServerUtils extends CommandServerUtils<BukkitPlugin, Plugin, BukkitCommandSender> {
private static final Map<String, ReloadHandler> supportedConfigs;

View file

@ -6,18 +6,10 @@ import cloud.commandframework.context.CommandContext;
import net.frankheijden.serverutils.bungee.entities.BungeeCommandSender;
import net.frankheijden.serverutils.bungee.entities.BungeePlugin;
import net.frankheijden.serverutils.common.commands.CommandPlugins;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.api.plugin.PluginDescription;
import net.md_5.bungee.api.scheduler.ScheduledTask;
public class BungeeCommandPlugins extends CommandPlugins<
BungeePlugin,
Plugin,
ScheduledTask,
BungeeCommandSender,
CommandSender
> {
public class BungeeCommandPlugins extends CommandPlugins<BungeePlugin, Plugin, BungeeCommandSender> {
public BungeeCommandPlugins(BungeePlugin plugin) {
super(plugin);

View file

@ -11,20 +11,12 @@ import net.frankheijden.serverutils.bungee.reflection.RPluginManager;
import net.frankheijden.serverutils.common.commands.CommandServerUtils;
import net.frankheijden.serverutils.common.utils.FormatBuilder;
import net.frankheijden.serverutils.common.utils.ListBuilder;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.plugin.Command;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.api.plugin.PluginDescription;
import net.md_5.bungee.api.plugin.PluginManager;
import net.md_5.bungee.api.scheduler.ScheduledTask;
public class BungeeCommandServerUtils extends CommandServerUtils<
BungeePlugin,
Plugin,
ScheduledTask,
BungeeCommandSender,
CommandSender
> {
public class BungeeCommandServerUtils extends CommandServerUtils<BungeePlugin, Plugin, BungeeCommandSender> {
public BungeeCommandServerUtils(BungeePlugin plugin) {
super(plugin);

View file

@ -7,13 +7,8 @@ import net.frankheijden.serverutils.common.entities.ServerUtilsPlugin;
import net.frankheijden.serverutils.common.utils.ListBuilder;
import net.frankheijden.serverutils.common.utils.ListFormat;
public abstract class CommandPlugins<
U extends ServerUtilsPlugin<P, T, C, S>,
P,
T,
C extends ServerCommandSender<S>,
S
> extends ServerUtilsCommand<U, P, T, C, S> {
public abstract class CommandPlugins<U extends ServerUtilsPlugin<P, ?, C, ?>, P, C extends ServerCommandSender<?>>
extends ServerUtilsCommand<U, C> {
protected CommandPlugins(U plugin) {
super(plugin, "plugins");

View file

@ -19,17 +19,10 @@ import net.frankheijden.serverutils.common.utils.FormatBuilder;
import net.frankheijden.serverutils.common.utils.ListBuilder;
import net.frankheijden.serverutils.common.utils.ListFormat;
public abstract class CommandServerUtils<
U extends ServerUtilsPlugin<P, T, C, S>,
P,
T,
C extends ServerCommandSender<S>,
S
> extends ServerUtilsCommand<U, P, T, C, S> {
public abstract class CommandServerUtils<U extends ServerUtilsPlugin<P, ?, C, ?>, P, C extends ServerCommandSender<?>>
extends ServerUtilsCommand<U, C> {
protected CommandServerUtils(
U plugin
) {
protected CommandServerUtils(U plugin) {
super(plugin, "serverutils");
}

View file

@ -12,22 +12,14 @@ import net.frankheijden.serverutils.common.config.ServerUtilsConfig;
import net.frankheijden.serverutils.common.entities.ServerCommandSender;
import net.frankheijden.serverutils.common.entities.ServerUtilsPlugin;
public abstract class ServerUtilsCommand<U extends ServerUtilsPlugin<P, T, C, S>,
P,
T,
C extends ServerCommandSender<S>,
S
> {
public abstract class ServerUtilsCommand<U extends ServerUtilsPlugin<?, ?, C, ?>, C extends ServerCommandSender<?>> {
protected final U plugin;
protected final String commandName;
protected final ServerUtilsConfig commandConfig;
protected final Map<String, CommandArgument<C, ?>> arguments;
protected ServerUtilsCommand(
U plugin,
String commandName
) {
protected ServerUtilsCommand(U plugin, String commandName) {
this.plugin = plugin;
this.commandName = commandName;
this.commandConfig = (ServerUtilsConfig) plugin.getCommandsResource().getConfig().get(commandName);

View file

@ -3,21 +3,13 @@ package net.frankheijden.serverutils.velocity.commands;
import cloud.commandframework.Command;
import cloud.commandframework.CommandManager;
import cloud.commandframework.context.CommandContext;
import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.plugin.PluginContainer;
import com.velocitypowered.api.plugin.PluginDescription;
import com.velocitypowered.api.scheduler.ScheduledTask;
import net.frankheijden.serverutils.common.commands.CommandPlugins;
import net.frankheijden.serverutils.velocity.entities.VelocityCommandSender;
import net.frankheijden.serverutils.velocity.entities.VelocityPlugin;
public class VelocityCommandPlugins extends CommandPlugins<
VelocityPlugin,
PluginContainer,
ScheduledTask,
VelocityCommandSender,
CommandSource
> {
public class VelocityCommandPlugins extends CommandPlugins<VelocityPlugin, PluginContainer, VelocityCommandSender> {
public VelocityCommandPlugins(VelocityPlugin plugin) {
super(plugin);

View file

@ -5,7 +5,6 @@ import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.plugin.PluginContainer;
import com.velocitypowered.api.plugin.PluginDescription;
import com.velocitypowered.api.plugin.meta.PluginDependency;
import com.velocitypowered.api.scheduler.ScheduledTask;
import java.nio.file.Path;
import java.util.function.Consumer;
import java.util.function.Function;
@ -18,13 +17,8 @@ import net.frankheijden.serverutils.velocity.entities.VelocityCommandSender;
import net.frankheijden.serverutils.velocity.entities.VelocityPlugin;
import net.frankheijden.serverutils.velocity.reflection.RVelocityCommandManager;
public class VelocityCommandServerUtils extends CommandServerUtils<
VelocityPlugin,
PluginContainer,
ScheduledTask,
VelocityCommandSender,
CommandSource
> {
public class VelocityCommandServerUtils
extends CommandServerUtils<VelocityPlugin, PluginContainer, VelocityCommandSender> {
public VelocityCommandServerUtils(VelocityPlugin plugin) {
super(plugin);