File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
src/main/java/net/jeqo/bloons/balloon Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 8
8
import net .jeqo .bloons .configuration .ConfigConfiguration ;
9
9
import org .bukkit .plugin .java .JavaPlugin ;
10
10
11
+ import java .io .File ;
11
12
import java .util .ArrayList ;
12
13
13
14
/**
@@ -65,10 +66,20 @@ public void initialize() {
65
66
* Copies the example balloons folder to the plugin's data folder if it doesn't exist
66
67
*/
67
68
public void copyExampleBalloons () {
69
+ // List of example balloon files
70
+ String [] exampleBalloons = new String [] {
71
+ "/color_pack_example.yml" ,
72
+ "/dyeable_example.yml" ,
73
+ "/multipart_example.yml"
74
+ };
75
+
68
76
// Save all example files in the balloons folder in /resources
69
- Bloons .getInstance ().saveResource (ConfigConfiguration .BALLOON_CONFIGURATION_FOLDER + "/color_pack_example.yml" , false );
70
- Bloons .getInstance ().saveResource (ConfigConfiguration .BALLOON_CONFIGURATION_FOLDER + "/dyeable_example.yml" , false );
71
- Bloons .getInstance ().saveResource (ConfigConfiguration .BALLOON_CONFIGURATION_FOLDER + "/multipart_example.yml" , false );
77
+ for (String example : exampleBalloons ) {
78
+ File file = new File (Bloons .getInstance ().getDataFolder () + File .separator + ConfigConfiguration .BALLOON_CONFIGURATION_FOLDER + example );
79
+ if (file .exists ()) continue ;
80
+
81
+ Bloons .getInstance ().saveResource (ConfigConfiguration .BALLOON_CONFIGURATION_FOLDER + example , false );
82
+ }
72
83
}
73
84
74
85
/**
You can’t perform that action at this time.
0 commit comments