Skip to content

Commit

Permalink
Fixing shield loading from "/shields" directory
Browse files Browse the repository at this point in the history
  • Loading branch information
RedstoneFuture committed Apr 10, 2023
1 parent d801e36 commit 0448aec
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,18 @@ public static void safeFile(File file, YamlConfiguration cfg) {
}

public static void checkShields() {
File shieldFolder = new File(MissileWars.getInstance().getDataFolder(), "shields");
if (!shieldFolder.exists()) {
shieldFolder.mkdir();
}

for (Arena arena : Arenas.getArenas()) {
File file = new File(MissileWars.getInstance().getDataFolder(), arena.getShieldConfiguration().getSchematic());
if (!file.isFile()) {
File shield = new File(shieldFolder, arena.getShieldConfiguration().getSchematic());
if (!shield.isFile()) {
String resource = "shield.schematic";

Logger.BOOT.log("Copying default shield schematic (" + resource + ")");
copyFile(resource, file.getPath());
copyFile(resource, shield.getPath());

}
}
Expand Down

0 comments on commit 0448aec

Please sign in to comment.