Comply with checkstyle again
This commit is contained in:
parent
e67b20dee0
commit
af4c7ba214
36 changed files with 329 additions and 74 deletions
|
|
@ -2,11 +2,28 @@ package net.frankheijden.serverutils.common.providers;
|
|||
|
||||
import net.frankheijden.serverutils.common.entities.ServerCommandSender;
|
||||
|
||||
/**
|
||||
* A basic chat provider class.
|
||||
*/
|
||||
public abstract class ChatProvider {
|
||||
|
||||
/**
|
||||
* Retrieves the console sender of a server instance.
|
||||
* @return The console sender.
|
||||
*/
|
||||
public abstract ServerCommandSender getConsoleSender();
|
||||
|
||||
/**
|
||||
* Colorizes the given string.
|
||||
* @param str The string to color.
|
||||
* @return The colored string.
|
||||
*/
|
||||
public abstract String color(String str);
|
||||
|
||||
/**
|
||||
* Broadcasts a message over a server instance.
|
||||
* @param permission The permission the receivers need to have.
|
||||
* @param message The message to broadcast.
|
||||
*/
|
||||
public abstract void broadcast(String permission, String message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,12 +16,20 @@ public abstract class PluginProvider<T> {
|
|||
|
||||
public abstract File getPluginFile(T plugin);
|
||||
|
||||
/**
|
||||
* Retrieves a list of plugins, sorted by name.
|
||||
* @return The list of plugins.
|
||||
*/
|
||||
public List<T> getPluginsSorted() {
|
||||
List<T> plugins = getPlugins();
|
||||
plugins.sort(Comparator.comparing(this::getPluginName));
|
||||
return plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of plugin names.
|
||||
* @return The plugin names.
|
||||
*/
|
||||
public List<String> getPluginNames() {
|
||||
return getPlugins().stream()
|
||||
.map(this::getPluginName)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package net.frankheijden.serverutils.common.providers;
|
||||
|
||||
import net.frankheijden.serverutils.common.config.YamlConfig;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
||||
import net.frankheijden.serverutils.common.config.YamlConfig;
|
||||
|
||||
public interface ResourceProvider {
|
||||
|
||||
InputStream getResource(String resource);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue