Critical Bugfix

Fixed an issue where plugin was loading player configurations from ./plugins/FeelingLucky instead of ./plugins/FeelingLucky/players
This commit is contained in:
Paldiu 2022-05-16 20:59:49 -05:00
parent 07c4e5d50c
commit 73e5be91eb
2 changed files with 7 additions and 2 deletions

View File

@ -3,7 +3,7 @@ plugins {
} }
group = 'io.github.simplex' group = 'io.github.simplex'
version = 'Beta-1.0' version = 'Beta-1.0.1'
repositories { repositories {
mavenCentral() mavenCentral()

View File

@ -18,6 +18,7 @@ import java.util.UUID;
public final class FeelingLucky extends JavaPlugin { public final class FeelingLucky extends JavaPlugin {
private final Map<UUID, PlayerConfig> configMap = new HashMap<>(); private final Map<UUID, PlayerConfig> configMap = new HashMap<>();
private final File playerDirectory = new File(getDataFolder(), "players");
private PlayerHandler handler; private PlayerHandler handler;
private Config config; private Config config;
@ -55,7 +56,11 @@ public final class FeelingLucky extends JavaPlugin {
} }
private void loadPlayerConfigurations() { private void loadPlayerConfigurations() {
File[] files = getDataFolder().listFiles(); if (!playerDirectory.exists()) {
playerDirectory.mkdirs();
}
File[] files = playerDirectory.listFiles();
if (files != null) { if (files != null) {
Arrays.stream(files).forEach(file -> { Arrays.stream(files).forEach(file -> {
UUID uuid = UUID.fromString(file.getName().split("\\.")[0]); UUID uuid = UUID.fromString(file.getName().split("\\.")[0]);