Use Path.of

This commit is contained in:
tastybento 2024-01-08 19:42:51 +09:00
parent 3d3bd42505
commit 2d2972c3e6
1 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package world.bentobox.bentobox;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
@ -466,10 +467,13 @@ public class BentoBox extends JavaPlugin implements Listener {
}
log("Saving default panels...");
if (!new File(getDataFolder() + File.separator + "panels", "island_creation_panel.yml").exists()) {
if (!Files.exists(Path.of(this.getDataFolder().getPath(), "panels", "island_creation_panel.yml"))) {
log("Saving default island_creation_panel...");
this.saveResource("panels/island_creation_panel.yml", false);
}
if (!new File(getDataFolder() + File.separator + "panels", "language_panel.yml").exists()) {
if (!Files.exists(Path.of(this.getDataFolder().getPath(), "panels", "language_panel.yml"))) {
log("Saving default language_panel...");
this.saveResource("panels/language_panel.yml", false);
}
return true;