0

I cannot figure out why line 22 wont make a directory in the datafolder

package com.yahoo.nathancat49;

import java.io.File;
import java.util.logging.Logger;

import net.md_5.bungee.api.ChatColor;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin implements Listener {

    Logger myPluginLogger = Bukkit.getLogger();

     public void onEnable() {
     File f = new File("World");
     if(!f.exists()) {
     f.mkdir();  //this is line 22

    myPluginLogger.info("no world folder found. Creating... ");
}
T3KBAU5
  • 1,861
  • 20
  • 26

1 Answers1

0

I think you would need to use f.mkdirs(). To be honest, I got often problems with these methods too, but if one of them does not work, try the other one, that should fix it ;).

An other suggestion: Are you sure that the path can be found ?

Lehks
  • 1