27
27
import com .wasteofplastic .askyblock .Island ;
28
28
29
29
import net .milkbowl .vault .permission .Permission ;
30
+ import net .sacredlabyrinth .phaed .simpleclans .Clan ;
31
+ import net .sacredlabyrinth .phaed .simpleclans .ClanPlayer ;
32
+ import net .sacredlabyrinth .phaed .simpleclans .SimpleClans ;
33
+ import net .sacredlabyrinth .phaed .simpleclans .managers .ClanManager ;
30
34
31
35
public class Dependency {
32
36
@@ -39,6 +43,8 @@ public class Dependency {
39
43
protected static Plugin askyblock = null ;
40
44
protected static Plugin plotsquared = null ;
41
45
protected static PlotAPI plotapi ;
46
+ protected static Plugin simpleclans = null ;
47
+ protected static ClanManager clanmanager = null ;
42
48
43
49
public Dependency (Plugin plugin ){
44
50
// WorldGuard
@@ -67,6 +73,9 @@ public Dependency(Plugin plugin){
67
73
if (plotsquared != null ){
68
74
plotapi = new PlotAPI ();
69
75
}
76
+ // SimpleClans
77
+ simpleclans = plugin .getServer ().getPluginManager ().getPlugin ("SimpleClans" );
78
+ clanmanager = ((SimpleClans )simpleclans ).getClanManager ();
70
79
}
71
80
72
81
@ SuppressWarnings ("deprecation" )
@@ -137,6 +146,9 @@ public static boolean isProtectedFrom(Block block, Player player){
137
146
}
138
147
} catch (Exception e ){}
139
148
}
149
+ if (simpleclans != null ){
150
+ // TODO or not todo
151
+ }
140
152
return false ;
141
153
}
142
154
@@ -184,5 +196,18 @@ public static boolean isScoreboardTeamOf(String line, Player player){
184
196
}
185
197
return false ;
186
198
}
199
+
200
+ public static boolean isSimpleClanOf (String line , Player player ){
201
+ try {
202
+ ClanPlayer clanplayer = clanmanager .getClanPlayer (player );
203
+ if (clanplayer != null ){
204
+ Clan clan = clanplayer .getClan ();
205
+ if (clan != null ){
206
+ if (line .equals ("[" + clan .getName () + "]" )) return true ;
207
+ }
208
+ }
209
+ } catch (Exception e ){}
210
+ return false ;
211
+ }
187
212
188
213
}
0 commit comments