mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-19 23:57:43 +01:00
Improved compatibility with versions of CommandBook without GodComponent and updated pom dep for 2.0
This commit is contained in:
parent
f45464b0d9
commit
16da53ae4e
7
pom.xml
7
pom.xml
@ -18,6 +18,11 @@
|
||||
</scm>
|
||||
|
||||
<repositories>
|
||||
<!-- Repository for zml's stuff -->
|
||||
<repository>
|
||||
<id>zml-repo</id>
|
||||
<url>http://files.zachsthings.com/repo</url>
|
||||
</repository>
|
||||
<!-- Repository for other dependencies of SK's -->
|
||||
<repository>
|
||||
<id>sk89q-mvn2</id>
|
||||
@ -49,7 +54,7 @@
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>commandbook</artifactId>
|
||||
<version>1.8-SNAPSHOT</version>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Additional libraries -->
|
||||
|
@ -89,7 +89,7 @@ public void run() {
|
||||
.getApplicableRegions(playerLocation);
|
||||
|
||||
if (!RegionQueryUtil.isInvincible(plugin, player, applicable)
|
||||
&& !RegionQueryUtil.hasGodMode(player, plugin)
|
||||
&& !plugin.getGlobalStateManager().hasGodMode(player)
|
||||
&& !(player.getGameMode() == GameMode.CREATIVE)) {
|
||||
processHeal(applicable, player, state);
|
||||
processFeed(applicable, player, state);
|
||||
|
@ -82,18 +82,4 @@ public static Boolean isAllowedInvinciblity(WorldGuardPlugin plugin, Player play
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasGodMode(Player player, WorldGuardPlugin plugin) {
|
||||
try {
|
||||
if (plugin.getServer().getPluginManager().isPluginEnabled("CommandBook")) {
|
||||
GodComponent god = CommandBook.inst().getComponentManager().getComponent(GodComponent.class);
|
||||
if (god != null) {
|
||||
return god.hasGodMode(player);
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user