mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-24 10:11:25 +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>
|
</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 -->
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user