Improved compatibility with versions of CommandBook without GodComponent and updated pom dep for 2.0

This commit is contained in:
zml2008 2012-02-06 20:41:39 -08:00
parent f45464b0d9
commit 16da53ae4e
3 changed files with 7 additions and 16 deletions

View File

@ -18,6 +18,11 @@
</scm> </scm>
<repositories> <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 for other dependencies of SK's -->
<repository> <repository>
<id>sk89q-mvn2</id> <id>sk89q-mvn2</id>
@ -49,7 +54,7 @@
<dependency> <dependency>
<groupId>com.sk89q</groupId> <groupId>com.sk89q</groupId>
<artifactId>commandbook</artifactId> <artifactId>commandbook</artifactId>
<version>1.8-SNAPSHOT</version> <version>2.0</version>
</dependency> </dependency>
<!-- Additional libraries --> <!-- Additional libraries -->

View File

@ -89,7 +89,7 @@ public void run() {
.getApplicableRegions(playerLocation); .getApplicableRegions(playerLocation);
if (!RegionQueryUtil.isInvincible(plugin, player, applicable) if (!RegionQueryUtil.isInvincible(plugin, player, applicable)
&& !RegionQueryUtil.hasGodMode(player, plugin) && !plugin.getGlobalStateManager().hasGodMode(player)
&& !(player.getGameMode() == GameMode.CREATIVE)) { && !(player.getGameMode() == GameMode.CREATIVE)) {
processHeal(applicable, player, state); processHeal(applicable, player, state);
processFeed(applicable, player, state); processFeed(applicable, player, state);

View File

@ -82,18 +82,4 @@ public static Boolean isAllowedInvinciblity(WorldGuardPlugin plugin, Player play
return null; 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;
}
} }