Pass closable around instead of closing it straight away.
- Ensures ServerUtils can reload itself :)
This commit is contained in:
parent
75545ac156
commit
c2049503a7
5 changed files with 92 additions and 29 deletions
|
|
@ -130,7 +130,11 @@ public class ServerUtils extends JavaPlugin implements CommandExecutor {
|
|||
return commandManager;
|
||||
}
|
||||
|
||||
private File[] getJars() {
|
||||
/**
|
||||
* Retrieves all files with a jar extension in the plugins/ folder.
|
||||
* @return An array of jar files.
|
||||
*/
|
||||
public File[] getJars() {
|
||||
File parent = getDataFolder().getParentFile();
|
||||
if (parent == null) return new File[0];
|
||||
return parent.listFiles(f -> f.getName().endsWith(".jar"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue