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>
<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 -->

View File

@ -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);

View File

@ -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;
}
}