From cc6ac93b7a9c8be642144e222009e2ef04018d19 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 2 Apr 2011 15:58:52 -0700 Subject: [PATCH] Fixed auto-god mode and auto-amphibious mode. --- .../worldguard/bukkit/WorldGuardEntityListener.java | 5 +++++ .../worldguard/bukkit/WorldGuardPlayerListener.java | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java b/src/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java index 279f91c6..37a11eb2 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java @@ -224,6 +224,11 @@ public void onEntityDamage(EntityDamageEvent event) { event.setCancelled(true); return; } + + if (type == DamageCause.DROWNING && cfg.hasAmphibiousMode(player)) { + event.setCancelled(true); + return; + } if (wcfg.disableFallDamage && type == DamageCause.FALL) { event.setCancelled(true); diff --git a/src/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java b/src/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java index 2f086fd3..12f902b8 100644 --- a/src/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java +++ b/src/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java @@ -295,7 +295,15 @@ public void onPlayerJoin(PlayerJoinEvent event) { if (wcfg.fireSpreadDisableToggle) { player.sendMessage(ChatColor.YELLOW - + "Fire spread is currently globally disabled."); + + "Fire spread is currently globally disabled for this world."); + } + + if (plugin.inGroup(player, "wg-invincible")) { + cfg.enableGodMode(player); + } + + if (plugin.inGroup(player, "wg-amphibious")) { + cfg.enableAmphibiousMode(player); } }