Feature: unload bukkit commands per config.yml
This commit is contained in:
parent
b260d9c341
commit
4a374c5f43
7 changed files with 104 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ package net.frankheijden.serverutils.common.config;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -16,6 +17,13 @@ public interface YamlConfig {
|
|||
*/
|
||||
Object get(String path);
|
||||
|
||||
/**
|
||||
* Retrieves a list of strings at a given path.
|
||||
* @param path The path.
|
||||
* @return The string list.
|
||||
*/
|
||||
List<String> getStringList(String path);
|
||||
|
||||
/**
|
||||
* Retrieves a map with key/values for the path specified.
|
||||
* @param path The path.
|
||||
|
|
|
|||
|
|
@ -17,4 +17,31 @@ public class StringUtils {
|
|||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Joins strings from an array starting from begin index (including).
|
||||
* @param delimiter The delimiter to join the strings on.
|
||||
* @param strings The string array.
|
||||
* @param begin Begin index (including)
|
||||
* @return The joined string.
|
||||
*/
|
||||
public static String join(String delimiter, String[] strings, int begin) {
|
||||
return join(delimiter, strings, begin, strings.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Joins strings from an array from begin index (including) until end index (excluding).
|
||||
* @param delimiter The delimiter to join the strings on.
|
||||
* @param strings The string array.
|
||||
* @param begin Begin index (including)
|
||||
* @param end End index (excluding)
|
||||
* @return The joined string.
|
||||
*/
|
||||
public static String join(String delimiter, String[] strings, int begin, int end) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = begin; i < end; i++) {
|
||||
sb.append(delimiter).append(strings[i]);
|
||||
}
|
||||
return sb.substring(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue