From 31739c647b8d813392a916610bea18ce3bff4b73 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Fri, 7 Jun 2013 14:10:22 +0200 Subject: [PATCH 1/5] Dissolved a .* import. Rationale: grepping for qualified class names --- .../java/com/sk89q/worldguard/bukkit/BukkitUtil.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/BukkitUtil.java b/src/main/java/com/sk89q/worldguard/bukkit/BukkitUtil.java index 528f2f53..20a823d9 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/BukkitUtil.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/BukkitUtil.java @@ -29,7 +29,14 @@ import org.bukkit.Server; import org.bukkit.World; import org.bukkit.block.Block; -import org.bukkit.entity.*; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Tameable; +import org.bukkit.entity.ExperienceOrb; +import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.Item; +import org.bukkit.entity.TNTPrimed; +import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import java.util.List; From 23766f20dd94d579dcfbad6fc57f250c4fa2caa8 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Fri, 7 Jun 2013 14:33:58 +0200 Subject: [PATCH 2/5] Transformed the BlockFadeEvent handler into a switch. --- .../worldguard/bukkit/WorldGuardBlockListener.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java index 69f4c7d8..6958b367 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java @@ -816,30 +816,32 @@ public void onBlockFade(BlockFadeEvent event) { ConfigurationManager cfg = plugin.getGlobalStateManager(); WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld()); - int type = event.getBlock().getTypeId(); - - if (type == BlockID.ICE) { + switch (event.getBlock().getTypeId()) { + case BlockID.ICE: if (wcfg.disableIceMelting) { event.setCancelled(true); return; } + if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows( DefaultFlag.ICE_MELT, event.getBlock().getLocation())) { event.setCancelled(true); return; } - } + break; - if (type == BlockID.SNOW) { + case BlockID.SNOW: if (wcfg.disableSnowMelting) { event.setCancelled(true); return; } + if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows( DefaultFlag.SNOW_MELT, event.getBlock().getLocation())) { event.setCancelled(true); return; } + break; } if (type == BlockID.SOIL) { From 071fdaabd3e9ab45ce5490ce51a5b722a9e63c4d Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Sun, 17 Nov 2013 23:36:10 +0100 Subject: [PATCH 3/5] Added *.iml and .idea to .gitignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9f214a79..e74e7520 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ target .DS_Store +*.iml +.idea From ec4143d3dc52b2604249a286d804f298bdc898d3 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Sun, 17 Nov 2013 23:33:11 +0100 Subject: [PATCH 4/5] Bumped WE dependency to 5.5.9-SNAPSHOT. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5b1d3695..d85fbd9a 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.sk89q worldedit - 5.5.8-SNAPSHOT + 5.5.9-SNAPSHOT compile jar From d024ed7b813105669017672a988c50fd86eb6d0d Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Thu, 27 Jun 2013 14:31:49 +0200 Subject: [PATCH 5/5] typos, unused imports --- .../sk89q/worldguard/bukkit/WorldGuardEntityListener.java | 3 +-- .../sk89q/worldguard/bukkit/WorldGuardVehicleListener.java | 2 -- .../sk89q/worldguard/protection/ApplicableRegionSet.java | 2 +- .../com/sk89q/worldguard/protection/flags/DefaultFlag.java | 6 +++--- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java index ece7c417..a107e751 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java @@ -382,7 +382,6 @@ private void onEntityDamageByEntity(EntityDamageByEntityEvent event) { } } } - } } } @@ -526,7 +525,7 @@ public void onEntityDamage(EntityDamageEvent event) { return; } - if (wcfg.teleportOnSuffocation && type == DamageCause.SUFFOCATION) { + if (wcfg.teleportOnSuffocation && type == DamageCause.SUFFOCATION) { BukkitUtil.findFreePosition(player); event.setCancelled(true); return; diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardVehicleListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardVehicleListener.java index 7fa61549..073ecf1e 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardVehicleListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardVehicleListener.java @@ -18,11 +18,9 @@ import org.bukkit.event.vehicle.VehicleMoveEvent; import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.LocalPlayer; -import com.sk89q.worldguard.bukkit.FlagStateManager.PlayerFlagState; import com.sk89q.worldguard.protection.ApplicableRegionSet; import com.sk89q.worldguard.protection.flags.DefaultFlag; import com.sk89q.worldguard.protection.managers.RegionManager; -import com.sk89q.worldguard.protection.regions.ProtectedRegion; public class WorldGuardVehicleListener implements Listener { diff --git a/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java b/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java index 21e6c11b..748cbfae 100644 --- a/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java +++ b/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java @@ -55,7 +55,7 @@ public ApplicableRegionSet(Collection applicable, /** * Checks if a player can build in an area. * - * @param player The player to chec + * @param player The player to check * @return build ability */ public boolean canBuild(LocalPlayer player) { diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java index 0e518657..d83166e1 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java @@ -120,10 +120,10 @@ private DefaultFlag() { public static Flag[] getFlags() { return flagsList; } - + /** * Try to match the flag with the given ID using a fuzzy name match. - * + * * @param id the flag ID * @return a flag, or null */ @@ -133,7 +133,7 @@ public static Flag fuzzyMatchFlag(String id) { return flag; } } - + return null; } }