Problem with creating the Config.yml

Discussion in 'Plugin Development' started by PreFiXAUT, Aug 1, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    PreFiXAUT

    Hey Guys, I'm working on a new Plugin again, but somehow it doesn't want to create the File. I used the same Pattern for all my other Plugins too and they worked fine, but now...idk it's just preety weird.

    Source-Code: http://pastebin.com/SxdCrfT0
    StackTrace:
    Show Spoiler

    Code:
    [20:32:29] [Server thread/INFO]: [InstantMining] Enabling InstantMining v0.1
    [20:32:29] [Server thread/INFO]: DEBUG: Config-Loc: F:\Daten\Minecraft\Bukkit\Server\plugins\InstantMining\config.yml
    [20:32:29] [Server thread/INFO]: DEBUG: Config-Parent: F:\Daten\Minecraft\Bukkit\Server\plugins\InstantMining
    [20:32:29] [Server thread/WARN]: java.io.IOException: Das System kann den angegebenen Pfad nicht finden
    [20:32:29] [Server thread/WARN]:    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    [20:32:29] [Server thread/WARN]:    at java.io.File.createNewFile(Unknown Source)
    [20:32:29] [Server thread/WARN]:    at net.prefixaut.instantmining.InstantMining.checkConfig(InstantMining.java:183)
    [20:32:29] [Server thread/WARN]:    at net.prefixaut.instantmining.InstantMining.onEnable(InstantMining.java:39)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:324)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404)
    [20:32:29] [Server thread/WARN]:    at net.prefixaut.instantmining.InstantMining.enable(InstantMining.java:64)
    [20:32:29] [Server thread/WARN]:    at net.prefixaut.instantmining.InstantMining.onEnable(InstantMining.java:50)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:324)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugin(CraftServer.java:446)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.enablePlugins(CraftServer.java:380)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.reload(CraftServer.java:799)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.Bukkit.reload(Bukkit.java:288)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:701)
    [20:32:29] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchServerCommand(CraftServer.java:688)
    [20:32:29] [Server thread/WARN]:    at net.minecraft.server.v1_7_R3.DedicatedServer.aB(DedicatedServer.java:296)
    [20:32:29] [Server thread/WARN]:    at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:261)
    [20:32:29] [Server thread/WARN]:    at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558)
    [20:32:29] [Server thread/WARN]:    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469)
    [20:32:29] [Server thread/WARN]:    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628)
    [
    Show Spoiler
     
  2. Offline

    mythbusterma

    PreFiXAUT

    A stack trace in German does not help us. This is an English-language forum.

    Second, why not just use the built in Bukkit API for config and save yourself all the trouble? Rather than creating another field that doesn't need to exist.
     
  3. Offline

    PreFiXAUT

    1. One sentence...it's not like the entire Stacktrace would be in German. And yea thanks I know that this is a English Forum.
    2. Cuz I like it that way more. It's not the matter anyway.
     
  4. Offline

    mythbusterma

    PreFiXAUT

    Das System kann den angegebenen Pfad nicht finden
    Is not very helpful.

    Also, the Bukkit way WORKS, yours doesn't. The API is there, use it.
     
  5. Offline

    Necrodoom

    mythbusterma Google translate.
    "The system cannot find the path specified".
     
  6. Offline

    SpaceManiac

    "The system cannot find the file specified," and I didn't need to know German or look it up.

    The problematic line of code (or the first one I saw, anyways) is this:
    Code:
    if (this.getDataFolder().exists()) this.getDataFolder().mkdirs();
    This is probably the wrong check. Fixing it might help fix your problem. I still agree, though, that using Bukkit's built-in API for this stuff will be massively simpler, easier to maintain, and help prevent problems like this from even occurring.
     
    mythbusterma likes this.
  7. Offline

    mythbusterma

    SpaceManiac Necrodoom

    I was hesitant to use Translate because sometimes it doesn't work well (such as technical documentation in Japanese, my experience with it), but that makes sense.

    PreFiXAUT
    Google Translate:
    Die Bukkit API arbeitet, gibt es keinen Grund, die in API gebaut, nicht zu verwenden
     
  8. Offline

    PreFiXAUT

    You're really just here to be kidding me right?
     
Thread Status:
Not open for further replies.

Share This Page