Create folders for action-files, if they don't exist yet

This commit is contained in:
Evenprime 2011-09-03 01:33:45 +02:00
parent 0283ded357
commit c0a124ac61
2 changed files with 20 additions and 9 deletions

View File

@ -3,7 +3,7 @@ name: NoCheat
author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheat
version: 2.01
version: 2.01a
permissions:

View File

@ -171,7 +171,7 @@ public class DefaultConfiguration {
actions.add(0, "directionLog blockbreakCancel");
}
}
/****** BLOCKPLACE ******/
{
ParentOption blockPlaceNode = new ParentOption("blockplace");
@ -193,7 +193,7 @@ public class DefaultConfiguration {
actions.add(0, "reachLog blockplaceCancel");
}
/**** BLOCKPLACE.ONLIQUID ****/
{
ParentOption onliquidNode = new ParentOption("onliquid");
@ -207,10 +207,9 @@ public class DefaultConfiguration {
actions.add(0, "onliquidLog blockplaceCancel");
}
}
/****** INTERACT ******/
{
ParentOption interactNode = new ParentOption("interact");
@ -239,8 +238,14 @@ public class DefaultConfiguration {
BufferedWriter w;
try {
if(!file.exists())
file.createNewFile();
if(!file.exists()) {
try {
file.getParentFile().mkdirs();
file.createNewFile();
} catch(Exception e) {
e.printStackTrace();
}
}
w = new BufferedWriter(new FileWriter(file));
@ -262,8 +267,14 @@ public class DefaultConfiguration {
BufferedWriter w;
try {
if(!file.exists())
file.createNewFile();
if(!file.exists()) {
try {
file.getParentFile().mkdirs();
file.createNewFile();
} catch(Exception e) {
e.printStackTrace();
}
}
w = new BufferedWriter(new FileWriter(file));