5
5
6
6
import org .bukkit .Bukkit ;
7
7
import org .bukkit .Location ;
8
+ import org .bukkit .Material ;
8
9
import org .bukkit .block .Block ;
9
10
import org .bukkit .entity .Player ;
10
11
import org .bukkit .plugin .Plugin ;
29
30
import com .wasteofplastic .askyblock .ASkyBlockAPI ;
30
31
import com .wasteofplastic .askyblock .Island ;
31
32
33
+ import me .ryanhamshire .GriefPrevention .Claim ;
34
+ import me .ryanhamshire .GriefPrevention .GriefPrevention ;
32
35
import net .milkbowl .vault .permission .Permission ;
33
36
import net .sacredlabyrinth .phaed .simpleclans .Clan ;
34
37
import net .sacredlabyrinth .phaed .simpleclans .ClanPlayer ;
@@ -48,6 +51,7 @@ public class Dependency {
48
51
protected static PlotAPI plotapi ;
49
52
protected static Plugin simpleclans = null ;
50
53
protected static ClanManager clanmanager = null ;
54
+ protected static Plugin griefprevention = null ;
51
55
52
56
public Dependency (Plugin plugin ){
53
57
// WorldGuard
@@ -81,6 +85,8 @@ public Dependency(Plugin plugin){
81
85
if (simpleclans != null ){
82
86
clanmanager = ((SimpleClans )simpleclans ).getClanManager ();
83
87
}
88
+ // GreifPrevention
89
+ griefprevention = plugin .getServer ().getPluginManager ().getPlugin ("GriefPrevention" );
84
90
}
85
91
86
92
@ SuppressWarnings ("deprecation" )
@@ -160,6 +166,12 @@ public static boolean isProtectedFrom(Block block, Player player){
160
166
if (simpleclans != null ){
161
167
// TODO or not todo
162
168
}
169
+ if (griefprevention != null ){
170
+ Claim claim = GriefPrevention .instance .dataStore .getClaimAt (block .getLocation (), false , null );
171
+ if (claim != null ){
172
+ if (claim .allowBuild (player , Material .WALL_SIGN ) != null ) return true ;
173
+ }
174
+ }
163
175
return false ;
164
176
}
165
177
0 commit comments