Skip to content

Commit

Permalink
Merge pull request #72 from RedstoneFuture/Fix/Hotfix/shieldSchematic…
Browse files Browse the repository at this point in the history
…Loading

Hot-Fixing shield loading from "/shields" directory
  • Loading branch information
daniel-naegele authored Apr 10, 2023
2 parents d801e36 + 0448aec commit b19fc9c
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 b19fc9c

Please sign in to comment.