@@ -76,7 +76,6 @@ public static void load(CommandSource src)
76
76
Utils .ensurePositiveNumber (config .getNode ("others" , "maxZoneNameLength" ), 13 );
77
77
Utils .ensureBoolean (config .getNode ("others" , "enableNationRanks" ), true );
78
78
Utils .ensureBoolean (config .getNode ("others" , "enableNationTag" ), true );
79
- Utils .ensureString (config .getNode ("others" , "gravestoneBlock" ), "gravestone:gravestone" );
80
79
Utils .ensureBoolean (config .getNode ("others" , "enableGoldenAxe" ), true );
81
80
Utils .ensureString (config .getNode ("others" , "publicChatFormat" ), " &r[&3{NATION}&r] &5{TITLE} &r" );
82
81
Utils .ensureString (config .getNode ("others" , "nationChatFormat" ), " &r{&eNC&r} " );
@@ -118,6 +117,22 @@ public static void load(CommandSource src)
118
117
Utils .ensureBoolean (config .getNode ("zones" , "perms" ).getNode (Nation .TYPE_COOWNER ).getNode (Nation .PERM_BUILD ), true );
119
118
Utils .ensureBoolean (config .getNode ("zones" , "perms" ).getNode (Nation .TYPE_COOWNER ).getNode (Nation .PERM_INTERACT ), true );
120
119
120
+ if (!config .getNode ("whitelist" , "build" ).hasListChildren () || config .getNode ("whitelist" , "build" ).getChildrenList ().isEmpty ())
121
+ {
122
+ Utils .ensureString (config .getNode ("whitelist" , "build" ).getAppendedNode (), "gravestone:gravestone" );
123
+ Utils .ensureString (config .getNode ("whitelist" , "build" ).getAppendedNode (), "modname:blockname" );
124
+ }
125
+
126
+ if (!config .getNode ("whitelist" , "break" ).hasListChildren () || config .getNode ("whitelist" , "break" ).getChildrenList ().isEmpty ())
127
+ {
128
+ Utils .ensureString (config .getNode ("whitelist" , "break" ).getAppendedNode (), "modname:blockname" );
129
+ }
130
+
131
+ if (!config .getNode ("whitelist" , "use" ).hasListChildren () || config .getNode ("whitelist" , "use" ).getChildrenList ().isEmpty ())
132
+ {
133
+ Utils .ensureString (config .getNode ("whitelist" , "use" ).getAppendedNode (), "modname:blockname" );
134
+ }
135
+
121
136
if (config .getNode ("others" , "enableNationRanks" ).getBoolean ())
122
137
{
123
138
if (!config .getNode ("nationRanks" ).hasListChildren () || config .getNode ("nationRanks" ).getChildrenList ().isEmpty ())
@@ -223,6 +238,23 @@ public static CommentedConfigurationNode getNationRank(int numCitizens)
223
238
return rank ;
224
239
}
225
240
241
+ public static boolean isWhitelisted (String type , String id ) {
242
+ if (id .equals ("minecraft:air" ))
243
+ return true ;
244
+ System .out .println ("isWhitelisted " + type + " for " + id );
245
+ if (!config .getNode ("whitelist" , type ).hasListChildren ())
246
+ return false ;
247
+ System .out .println ("whitelist has childs " + type + " for " + id );
248
+ for (CommentedConfigurationNode item : config .getNode ("whitelist" , type ).getChildrenList ()) {
249
+ System .out .println ("item? " + item .getString ());
250
+ if (id .startsWith (item .getString ())) {
251
+ System .out .println ("ALLOWED" );
252
+ return true ;
253
+ }
254
+ }
255
+ return false ;
256
+ }
257
+
226
258
public static class Utils
227
259
{
228
260
public static void ensureString (CommentedConfigurationNode node , String def )
0 commit comments