diff --git a/src/main/java/com/sk89q/worldguard/blacklist/Blacklist.java b/src/main/java/com/sk89q/worldguard/blacklist/Blacklist.java index 8b8eb0ad..11aa5814 100644 --- a/src/main/java/com/sk89q/worldguard/blacklist/Blacklist.java +++ b/src/main/java/com/sk89q/worldguard/blacklist/Blacklist.java @@ -19,14 +19,19 @@ package com.sk89q.worldguard.blacklist; -import java.util.Map; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.ArrayList; -import java.util.logging.Logger; +import java.util.Map; import java.util.logging.Level; -import java.io.*; +import java.util.logging.Logger; + import org.bukkit.ChatColor; + import com.sk89q.worldedit.blocks.ItemType; import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.blacklist.events.BlacklistEvent; @@ -60,11 +65,9 @@ public abstract class Blacklist { Map lastAffected = new HashMap(); - private boolean useAsWhitelist; - public Blacklist(Boolean useAsWhitelist) - { + public Blacklist(Boolean useAsWhitelist) { this.useAsWhitelist = useAsWhitelist; } diff --git a/src/main/java/com/sk89q/worldguard/blacklist/BlacklistEntry.java b/src/main/java/com/sk89q/worldguard/blacklist/BlacklistEntry.java index 4ea3575c..cc2fda7f 100644 --- a/src/main/java/com/sk89q/worldguard/blacklist/BlacklistEntry.java +++ b/src/main/java/com/sk89q/worldguard/blacklist/BlacklistEntry.java @@ -19,9 +19,11 @@ package com.sk89q.worldguard.blacklist; -import java.util.Set; import java.util.HashSet; +import java.util.Set; + import org.bukkit.ChatColor; + import com.sk89q.worldedit.blocks.ItemType; import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.blacklist.events.BlacklistEvent; diff --git a/src/main/java/com/sk89q/worldguard/blacklist/BlacklistLogger.java b/src/main/java/com/sk89q/worldguard/blacklist/BlacklistLogger.java index 58f06ccb..9c330e9b 100644 --- a/src/main/java/com/sk89q/worldguard/blacklist/BlacklistLogger.java +++ b/src/main/java/com/sk89q/worldguard/blacklist/BlacklistLogger.java @@ -19,8 +19,9 @@ package com.sk89q.worldguard.blacklist; -import java.util.Set; import java.util.HashSet; +import java.util.Set; + import com.sk89q.worldguard.blacklist.events.BlacklistEvent; import com.sk89q.worldguard.blacklist.loggers.BlacklistLoggerHandler; diff --git a/src/main/java/com/sk89q/worldguard/blacklist/loggers/ConsoleLoggerHandler.java b/src/main/java/com/sk89q/worldguard/blacklist/loggers/ConsoleLoggerHandler.java index 106e3cb6..5212dfb4 100644 --- a/src/main/java/com/sk89q/worldguard/blacklist/loggers/ConsoleLoggerHandler.java +++ b/src/main/java/com/sk89q/worldguard/blacklist/loggers/ConsoleLoggerHandler.java @@ -19,10 +19,18 @@ package com.sk89q.worldguard.blacklist.loggers; -import java.util.logging.Logger; import java.util.logging.Level; +import java.util.logging.Logger; + import com.sk89q.worldedit.blocks.ItemType; -import com.sk89q.worldguard.blacklist.events.*; +import com.sk89q.worldguard.blacklist.events.BlacklistEvent; +import com.sk89q.worldguard.blacklist.events.BlockBreakBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.BlockInteractBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.BlockPlaceBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.DestroyWithBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.ItemAcquireBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.ItemDropBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.ItemUseBlacklistEvent; /** * diff --git a/src/main/java/com/sk89q/worldguard/blacklist/loggers/DatabaseLoggerHandler.java b/src/main/java/com/sk89q/worldguard/blacklist/loggers/DatabaseLoggerHandler.java index 68007afe..1018de79 100644 --- a/src/main/java/com/sk89q/worldguard/blacklist/loggers/DatabaseLoggerHandler.java +++ b/src/main/java/com/sk89q/worldguard/blacklist/loggers/DatabaseLoggerHandler.java @@ -19,12 +19,13 @@ package com.sk89q.worldguard.blacklist.loggers; -import java.util.logging.Logger; -import java.util.logging.Level; import java.sql.Connection; import java.sql.DriverManager; -import java.sql.SQLException; import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; + import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.blacklist.events.BlacklistEvent; diff --git a/src/main/java/com/sk89q/worldguard/blacklist/loggers/FileLoggerHandler.java b/src/main/java/com/sk89q/worldguard/blacklist/loggers/FileLoggerHandler.java index 2d601bc3..ed1eced7 100644 --- a/src/main/java/com/sk89q/worldguard/blacklist/loggers/FileLoggerHandler.java +++ b/src/main/java/com/sk89q/worldguard/blacklist/loggers/FileLoggerHandler.java @@ -19,16 +19,33 @@ package com.sk89q.worldguard.blacklist.loggers; -import java.util.logging.Logger; -import java.util.logging.Level; -import java.io.*; -import java.util.regex.*; -import java.util.*; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.Iterator; +import java.util.Map; +import java.util.TreeMap; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.ItemType; import com.sk89q.worldguard.LocalPlayer; -import com.sk89q.worldguard.blacklist.events.*; +import com.sk89q.worldguard.blacklist.events.BlacklistEvent; +import com.sk89q.worldguard.blacklist.events.BlockBreakBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.BlockInteractBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.BlockPlaceBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.DestroyWithBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.ItemAcquireBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.ItemDropBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.ItemUseBlacklistEvent; /** * diff --git a/src/main/java/com/sk89q/worldguard/blacklist/loggers/FileLoggerWriter.java b/src/main/java/com/sk89q/worldguard/blacklist/loggers/FileLoggerWriter.java index 0b99421b..6d835903 100644 --- a/src/main/java/com/sk89q/worldguard/blacklist/loggers/FileLoggerWriter.java +++ b/src/main/java/com/sk89q/worldguard/blacklist/loggers/FileLoggerWriter.java @@ -19,7 +19,7 @@ package com.sk89q.worldguard.blacklist.loggers; -import java.io.*; +import java.io.BufferedWriter; /** * diff --git a/src/main/java/com/sk89q/worldguard/bukkit/BukkitBlacklist.java b/src/main/java/com/sk89q/worldguard/bukkit/BukkitBlacklist.java index 55bfefb9..8d0c7ded 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/BukkitBlacklist.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/BukkitBlacklist.java @@ -33,5 +33,4 @@ public BukkitBlacklist(Boolean useAsWhitelist, WorldGuardPlugin plugin) { public void broadcastNotification(String msg) { plugin.broadcastNotification(msg); } - } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/BukkitPlayer.java b/src/main/java/com/sk89q/worldguard/bukkit/BukkitPlayer.java index 3d7b0e15..f844abec 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/BukkitPlayer.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/BukkitPlayer.java @@ -21,6 +21,7 @@ import org.bukkit.Location; import org.bukkit.entity.Player; + import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.LocalPlayer; @@ -73,5 +74,4 @@ public void printRaw(String msg) { public boolean hasPermission(String perm) { return plugin.hasPermission(player, perm); } - } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/BukkitUtil.java b/src/main/java/com/sk89q/worldguard/bukkit/BukkitUtil.java index cce32d44..c8d80cd7 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/BukkitUtil.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/BukkitUtil.java @@ -21,18 +21,28 @@ import java.util.List; -import com.sk89q.worldedit.blocks.BlockType; -import org.bukkit.*; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +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.Item; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.TNTPrimed; +import org.bukkit.entity.Tameable; import org.bukkit.inventory.ItemStack; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.blocks.BlockType; public class BukkitUtil { - private BukkitUtil() { + } /** diff --git a/src/main/java/com/sk89q/worldguard/bukkit/ConfigurationManager.java b/src/main/java/com/sk89q/worldguard/bukkit/ConfigurationManager.java index b1070f07..48da4fb4 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/ConfigurationManager.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/ConfigurationManager.java @@ -18,17 +18,19 @@ */ package com.sk89q.worldguard.bukkit; -import com.sk89q.worldguard.LocalPlayer; -import com.sk89q.worldguard.blacklist.Blacklist; import java.io.File; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; + import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.util.config.Configuration; +import com.sk89q.worldguard.LocalPlayer; +import com.sk89q.worldguard.blacklist.Blacklist; + /** * Represents the global configuration and also delegates configuration * for individual worlds. diff --git a/src/main/java/com/sk89q/worldguard/bukkit/FlagStateManager.java b/src/main/java/com/sk89q/worldguard/bukkit/FlagStateManager.java index a868f43b..48c55db8 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/FlagStateManager.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/FlagStateManager.java @@ -19,15 +19,18 @@ package com.sk89q.worldguard.bukkit; +import static com.sk89q.worldguard.bukkit.BukkitUtil.toVector; + import java.util.HashMap; import java.util.Map; -import org.bukkit.entity.Player; + import org.bukkit.World; +import org.bukkit.entity.Player; + import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.protection.ApplicableRegionSet; import com.sk89q.worldguard.protection.flags.DefaultFlag; import com.sk89q.worldguard.protection.managers.RegionManager; -import static com.sk89q.worldguard.bukkit.BukkitUtil.*; /** * This processes per-player state information and is also meant to be used @@ -172,5 +175,4 @@ public static class PlayerFlagState { public int lastInvincibleZ; public boolean wasInvincible; } - } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/LegacyWorldGuardMigration.java b/src/main/java/com/sk89q/worldguard/bukkit/LegacyWorldGuardMigration.java index 3247f9bf..dcac8b1c 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/LegacyWorldGuardMigration.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/LegacyWorldGuardMigration.java @@ -19,9 +19,17 @@ package com.sk89q.worldguard.bukkit; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.util.logging.Logger; + import org.bukkit.World; + import com.sk89q.worldguard.protection.databases.CSVDatabase; import com.sk89q.worldguard.protection.managers.RegionManager; diff --git a/src/main/java/com/sk89q/worldguard/bukkit/LoggerToChatHandler.java b/src/main/java/com/sk89q/worldguard/bukkit/LoggerToChatHandler.java index 29eca0d2..0e29638c 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/LoggerToChatHandler.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/LoggerToChatHandler.java @@ -21,6 +21,7 @@ import java.util.logging.Handler; import java.util.logging.LogRecord; + import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/com/sk89q/worldguard/bukkit/RegionQueryUtil.java b/src/main/java/com/sk89q/worldguard/bukkit/RegionQueryUtil.java index 6f185744..73cb29ae 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/RegionQueryUtil.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/RegionQueryUtil.java @@ -19,15 +19,15 @@ package com.sk89q.worldguard.bukkit; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldguard.LocalPlayer; -import com.sk89q.worldguard.protection.ApplicableRegionSet; -import com.sk89q.worldguard.protection.flags.DefaultFlag; -import com.sk89q.worldguard.protection.managers.RegionManager; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Player; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldguard.protection.ApplicableRegionSet; +import com.sk89q.worldguard.protection.flags.DefaultFlag; +import com.sk89q.worldguard.protection.managers.RegionManager; + public class RegionQueryUtil { public static boolean isInvincible(WorldGuardPlugin plugin, Player player) { @@ -63,5 +63,4 @@ public static boolean isInvincible(WorldGuardPlugin plugin, Player player, return state.wasInvincible; } - } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/ReportWriter.java b/src/main/java/com/sk89q/worldguard/bukkit/ReportWriter.java index 7a7510aa..2d15fb36 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/ReportWriter.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/ReportWriter.java @@ -23,16 +23,18 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.lang.reflect.*; +import java.lang.reflect.Field; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; + import org.bukkit.Server; import org.bukkit.World; import org.bukkit.entity.Entity; import org.bukkit.plugin.Plugin; + import com.sk89q.worldguard.protection.GlobalRegionManager; import com.sk89q.worldguard.protection.flags.DefaultFlag; import com.sk89q.worldguard.protection.flags.Flag; @@ -331,5 +333,4 @@ public void write(File file) throws IOException { public String toString() { return output.toString(); } - } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/SpongeUtil.java b/src/main/java/com/sk89q/worldguard/bukkit/SpongeUtil.java index 98fd5999..cb4c13a3 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/SpongeUtil.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/SpongeUtil.java @@ -19,7 +19,9 @@ package com.sk89q.worldguard.bukkit; -import static com.sk89q.worldguard.bukkit.BukkitUtil.*; +import static com.sk89q.worldguard.bukkit.BukkitUtil.isBlockWater; +import static com.sk89q.worldguard.bukkit.BukkitUtil.setBlockToWater; + import org.bukkit.World; public class SpongeUtil { diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java index 6b9c35a3..ed333498 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java @@ -19,13 +19,6 @@ package com.sk89q.worldguard.bukkit; -import com.sk89q.worldguard.blacklist.Blacklist; -import com.sk89q.worldguard.blacklist.BlacklistLogger; -import com.sk89q.worldguard.blacklist.loggers.ConsoleLoggerHandler; -import com.sk89q.worldguard.blacklist.loggers.DatabaseLoggerHandler; -import com.sk89q.worldguard.blacklist.loggers.FileLoggerHandler; -import com.sk89q.worldguard.chest.ChestProtection; -import com.sk89q.worldguard.chest.SignChestProtection; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -35,11 +28,20 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; + import org.bukkit.block.Block; import org.bukkit.entity.CreatureType; import org.bukkit.entity.Player; import org.bukkit.util.config.Configuration; +import com.sk89q.worldguard.blacklist.Blacklist; +import com.sk89q.worldguard.blacklist.BlacklistLogger; +import com.sk89q.worldguard.blacklist.loggers.ConsoleLoggerHandler; +import com.sk89q.worldguard.blacklist.loggers.DatabaseLoggerHandler; +import com.sk89q.worldguard.blacklist.loggers.FileLoggerHandler; +import com.sk89q.worldguard.chest.ChestProtection; +import com.sk89q.worldguard.chest.SignChestProtection; + /** * Holds the configuration for individual worlds. * @@ -490,5 +492,4 @@ public boolean isAdjacentChestProtected(Block block, Player player) { public ChestProtection getChestProtection() { return chestProtection; } - } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java index 9dd9373d..f8486ab2 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java @@ -18,29 +18,47 @@ */ package com.sk89q.worldguard.bukkit; -import com.sk89q.worldguard.protection.flags.DefaultFlag; -import com.sk89q.worldguard.protection.managers.RegionManager; -import org.bukkit.event.Event.Priority; -import org.bukkit.event.Event; -import org.bukkit.plugin.PluginManager; -import org.bukkit.block.Block; +import static com.sk89q.worldguard.bukkit.BukkitUtil.dropSign; +import static com.sk89q.worldguard.bukkit.BukkitUtil.toVector; + +import java.util.logging.Logger; + import org.bukkit.ChatColor; import org.bukkit.Material; -import org.bukkit.entity.Player; import org.bukkit.World; -import org.bukkit.event.block.*; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.Event; +import org.bukkit.event.Event.Priority; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockBurnEvent; +import org.bukkit.event.block.BlockDamageEvent; +import org.bukkit.event.block.BlockFadeEvent; +import org.bukkit.event.block.BlockFormEvent; +import org.bukkit.event.block.BlockFromToEvent; +import org.bukkit.event.block.BlockIgniteEvent; +import org.bukkit.event.block.BlockListener; +import org.bukkit.event.block.BlockPhysicsEvent; +import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.block.BlockRedstoneEvent; +import org.bukkit.event.block.BlockSpreadEvent; +import org.bukkit.event.block.LeavesDecayEvent; +import org.bukkit.event.block.SignChangeEvent; +import org.bukkit.event.block.SnowFormEvent; import org.bukkit.event.block.BlockIgniteEvent.IgniteCause; import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.PluginManager; + import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.blocks.BlockType; import com.sk89q.worldedit.blocks.ItemType; import com.sk89q.worldguard.LocalPlayer; -import com.sk89q.worldguard.blacklist.events.*; +import com.sk89q.worldguard.blacklist.events.BlockBreakBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.BlockPlaceBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.DestroyWithBlacklistEvent; import com.sk89q.worldguard.protection.ApplicableRegionSet; - -import java.util.logging.Logger; - -import static com.sk89q.worldguard.bukkit.BukkitUtil.*; +import com.sk89q.worldguard.protection.flags.DefaultFlag; +import com.sk89q.worldguard.protection.managers.RegionManager; /** * The listener for block events. @@ -68,7 +86,7 @@ public WorldGuardBlockListener(WorldGuardPlugin plugin) { * Register events. */ public void registerEvents() { - PluginManager pm = plugin.getServer().getPluginManager(); +// PluginManager pm = plugin.getServer().getPluginManager(); registerEvent("BLOCK_DAMAGE", Priority.High); registerEvent("BLOCK_BREAK", Priority.High); diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java index 2fd83110..91466c68 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java @@ -20,31 +20,55 @@ import static com.sk89q.worldguard.bukkit.BukkitUtil.toVector; -import com.sk89q.worldguard.blacklist.events.BlockBreakBlacklistEvent; +import java.util.Set; +import java.util.logging.Logger; + import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; -import org.bukkit.entity.*; +import org.bukkit.entity.Creature; +import org.bukkit.entity.CreatureType; +import org.bukkit.entity.Creeper; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Fireball; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Painting; +import org.bukkit.entity.Player; +import org.bukkit.entity.Skeleton; +import org.bukkit.entity.TNTPrimed; +import org.bukkit.entity.Tameable; +import org.bukkit.entity.Wolf; import org.bukkit.event.Event; import org.bukkit.event.Event.Priority; -import org.bukkit.event.entity.*; +import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.CreeperPowerEvent; +import org.bukkit.event.entity.EntityCombustEvent; +import org.bukkit.event.entity.EntityDamageByBlockEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityDamageByProjectileEvent; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntityInteractEvent; +import org.bukkit.event.entity.EntityListener; +import org.bukkit.event.entity.EntityRegainHealthEvent; +import org.bukkit.event.entity.ExplosionPrimeEvent; +import org.bukkit.event.entity.PigZapEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.painting.PaintingBreakByEntityEvent; import org.bukkit.event.painting.PaintingBreakEvent; import org.bukkit.event.painting.PaintingPlaceEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.PluginManager; + import com.sk89q.worldedit.Vector; +import com.sk89q.worldguard.blacklist.events.BlockBreakBlacklistEvent; import com.sk89q.worldguard.blacklist.events.ItemUseBlacklistEvent; import com.sk89q.worldguard.protection.ApplicableRegionSet; import com.sk89q.worldguard.protection.flags.DefaultFlag; import com.sk89q.worldguard.protection.managers.RegionManager; -import java.util.Set; -import java.util.logging.Logger; - /** * Listener for entity related events. * @@ -71,7 +95,7 @@ public WorldGuardEntityListener(WorldGuardPlugin plugin) { * Register events. */ public void registerEvents() { - PluginManager pm = plugin.getServer().getPluginManager(); +// PluginManager pm = plugin.getServer().getPluginManager(); registerEvent("ENTITY_DAMAGE", Priority.High); registerEvent("ENTITY_COMBUST", Priority.High); diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java index de62d615..68d84ac5 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java @@ -19,30 +19,50 @@ package com.sk89q.worldguard.bukkit; import static com.sk89q.worldguard.bukkit.BukkitUtil.toVector; + import java.util.Iterator; import java.util.Set; import java.util.logging.Logger; -import com.sk89q.worldguard.protection.flags.RegionGroupFlag; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; -import org.bukkit.entity.*; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Item; +import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.Event.Priority; import org.bukkit.event.Event.Result; import org.bukkit.event.block.Action; -import org.bukkit.event.player.*; +import org.bukkit.event.player.PlayerBedEnterEvent; +import org.bukkit.event.player.PlayerBucketEmptyEvent; +import org.bukkit.event.player.PlayerBucketFillEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerDropItemEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerItemHeldEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerListener; +import org.bukkit.event.player.PlayerLoginEvent; +import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.PluginManager; + import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.LocalPlayer; -import com.sk89q.worldguard.blacklist.events.*; +import com.sk89q.worldguard.blacklist.events.BlockInteractBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.ItemAcquireBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.ItemDropBlacklistEvent; +import com.sk89q.worldguard.blacklist.events.ItemUseBlacklistEvent; 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.flags.RegionGroupFlag; import com.sk89q.worldguard.protection.flags.RegionGroupFlag.RegionGroup; import com.sk89q.worldguard.protection.managers.RegionManager; import com.sk89q.worldguard.protection.regions.ProtectedRegion; @@ -72,7 +92,7 @@ public WorldGuardPlayerListener(WorldGuardPlugin plugin) { * Register events. */ public void registerEvents() { - PluginManager pm = plugin.getServer().getPluginManager(); +// PluginManager pm = plugin.getServer().getPluginManager(); registerEvent("PLAYER_INTERACT", Priority.High); registerEvent("PLAYER_DROP_ITEM", Priority.High); @@ -135,7 +155,7 @@ public void onPlayerJoin(PlayerJoinEvent event) { World world = player.getWorld(); ConfigurationManager cfg = plugin.getGlobalStateManager(); - WorldConfiguration wcfg = cfg.get(player.getWorld()); + WorldConfiguration wcfg = cfg.get(world); if (cfg.activityHaltToggle) { player.sendMessage(ChatColor.YELLOW @@ -143,7 +163,7 @@ public void onPlayerJoin(PlayerJoinEvent event) { int removed = 0; - for (Entity entity : player.getWorld().getEntities()) { + for (Entity entity : world.getEntities()) { if (BukkitUtil.isIntensiveEntity(entity)) { entity.remove(); removed++; @@ -152,7 +172,7 @@ public void onPlayerJoin(PlayerJoinEvent event) { if (removed > 10) { logger.info("WG Halt-Act: " + removed + " entities (>10) auto-removed from " - + player.getWorld().toString()); + + player.getWorld().toString()); } } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java index bf34e245..9020efd5 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java @@ -19,7 +19,17 @@ package com.sk89q.worldguard.bukkit; -import com.sk89q.worldguard.protection.managers.RegionManager; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.logging.Filter; +import java.util.logging.Logger; + import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.World; @@ -31,19 +41,23 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; -import com.sk89q.bukkit.migration.*; -import com.sk89q.minecraft.util.commands.*; + +import com.sk89q.bukkit.migration.PermissionsResolverManager; +import com.sk89q.bukkit.migration.PermissionsResolverServerListener; +import com.sk89q.minecraft.util.commands.CommandException; +import com.sk89q.minecraft.util.commands.CommandPermissionsException; +import com.sk89q.minecraft.util.commands.CommandUsageException; +import com.sk89q.minecraft.util.commands.CommandsManager; +import com.sk89q.minecraft.util.commands.MissingNestedCommandException; +import com.sk89q.minecraft.util.commands.WrappedCommandException; import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.TickSyncDelayLoggerFilter; import com.sk89q.worldguard.bukkit.commands.GeneralCommands; import com.sk89q.worldguard.bukkit.commands.ProtectionCommands; import com.sk89q.worldguard.bukkit.commands.ToggleCommands; -import com.sk89q.worldguard.protection.*; -import java.io.*; -import java.util.*; -import java.util.logging.Filter; -import java.util.logging.Logger; +import com.sk89q.worldguard.protection.GlobalRegionManager; +import com.sk89q.worldguard.protection.managers.RegionManager; /** * The main class for WorldGuard as a Bukkit plugin. diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWeatherListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWeatherListener.java index 218aed1b..6c8b4bf1 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWeatherListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWeatherListener.java @@ -19,6 +19,9 @@ package com.sk89q.worldguard.bukkit; import static com.sk89q.worldguard.bukkit.BukkitUtil.toVector; + +import java.util.logging.Logger; + import org.bukkit.Location; import org.bukkit.event.Event; import org.bukkit.event.Event.Priority; @@ -27,13 +30,12 @@ import org.bukkit.event.weather.WeatherChangeEvent; import org.bukkit.event.weather.WeatherListener; import org.bukkit.plugin.PluginManager; + import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.protection.ApplicableRegionSet; import com.sk89q.worldguard.protection.flags.DefaultFlag; import com.sk89q.worldguard.protection.managers.RegionManager; -import java.util.logging.Logger; - public class WorldGuardWeatherListener extends WeatherListener { /** @@ -56,7 +58,7 @@ public WorldGuardWeatherListener(WorldGuardPlugin plugin) { } public void registerEvents() { - PluginManager pm = plugin.getServer().getPluginManager(); +// PluginManager pm = plugin.getServer().getPluginManager(); registerEvent("LIGHTNING_STRIKE", Priority.High); registerEvent("THUNDER_CHANGE", Priority.High); @@ -145,5 +147,4 @@ public void onLightningStrike(LightningStrikeEvent event) { } } } - } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWorldListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWorldListener.java index cf570b00..59a7d147 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWorldListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWorldListener.java @@ -5,14 +5,14 @@ */ package com.sk89q.worldguard.bukkit; -import org.bukkit.entity.*; +import java.util.logging.Logger; + +import org.bukkit.entity.Entity; import org.bukkit.event.Event; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.event.world.WorldListener; import org.bukkit.plugin.PluginManager; -import java.util.logging.Logger; - public class WorldGuardWorldListener extends WorldListener { /** @@ -35,7 +35,7 @@ public WorldGuardWorldListener(WorldGuardPlugin plugin) { * Register events. */ public void registerEvents() { - PluginManager pm = plugin.getServer().getPluginManager(); +// PluginManager pm = plugin.getServer().getPluginManager(); registerEvent("CHUNK_LOAD", Event.Priority.Normal); } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/commands/GeneralCommands.java b/src/main/java/com/sk89q/worldguard/bukkit/commands/GeneralCommands.java index bbffb6c2..8a199364 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/commands/GeneralCommands.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/commands/GeneralCommands.java @@ -23,13 +23,14 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandPermissions; +import com.sk89q.worldedit.blocks.ItemType; import com.sk89q.worldguard.bukkit.ConfigurationManager; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; -import com.sk89q.worldedit.blocks.ItemType; public class GeneralCommands { diff --git a/src/main/java/com/sk89q/worldguard/bukkit/commands/ProtectionCommands.java b/src/main/java/com/sk89q/worldguard/bukkit/commands/ProtectionCommands.java index ee3fe27e..b22928b7 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/commands/ProtectionCommands.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/commands/ProtectionCommands.java @@ -20,7 +20,11 @@ package com.sk89q.worldguard.bukkit.commands; import org.bukkit.command.CommandSender; -import com.sk89q.minecraft.util.commands.*; + +import com.sk89q.minecraft.util.commands.Command; +import com.sk89q.minecraft.util.commands.CommandContext; +import com.sk89q.minecraft.util.commands.CommandException; +import com.sk89q.minecraft.util.commands.NestedCommand; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; public class ProtectionCommands { diff --git a/src/main/java/com/sk89q/worldguard/bukkit/commands/RegionCommands.java b/src/main/java/com/sk89q/worldguard/bukkit/commands/RegionCommands.java index b0ab8c54..f8bc3c66 100755 --- a/src/main/java/com/sk89q/worldguard/bukkit/commands/RegionCommands.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/commands/RegionCommands.java @@ -22,15 +22,22 @@ import java.io.IOException; import java.util.Arrays; import java.util.Map; + import org.bukkit.ChatColor; import org.bukkit.World; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.sk89q.minecraft.util.commands.*; + +import com.sk89q.minecraft.util.commands.Command; +import com.sk89q.minecraft.util.commands.CommandContext; +import com.sk89q.minecraft.util.commands.CommandException; +import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.bukkit.WorldEditPlugin; -import com.sk89q.worldedit.bukkit.selections.*; +import com.sk89q.worldedit.bukkit.selections.CuboidSelection; +import com.sk89q.worldedit.bukkit.selections.Polygonal2DSelection; +import com.sk89q.worldedit.bukkit.selections.Selection; import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.bukkit.WorldConfiguration; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; @@ -40,7 +47,10 @@ import com.sk89q.worldguard.protection.flags.Flag; import com.sk89q.worldguard.protection.flags.InvalidFlagFormat; import com.sk89q.worldguard.protection.managers.RegionManager; -import com.sk89q.worldguard.protection.regions.*; +import com.sk89q.worldguard.protection.regions.GlobalProtectedRegion; +import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion; +import com.sk89q.worldguard.protection.regions.ProtectedPolygonalRegion; +import com.sk89q.worldguard.protection.regions.ProtectedRegion; import com.sk89q.worldguard.protection.regions.ProtectedRegion.CircularInheritanceException; import com.sk89q.worldguard.util.RegionUtil; @@ -256,6 +266,8 @@ public static void claim(CommandContext args, WorldGuardPlugin plugin, ApplicableRegionSet regions = mgr.getApplicableRegions(region); + + // Check if this region overlaps any other region if (regions.size() > 0) { if (!regions.isOwnerOfAll(localPlayer)) { @@ -264,7 +276,7 @@ public static void claim(CommandContext args, WorldGuardPlugin plugin, } else { if (wcfg.claimOnlyInsideExistingRegions) { throw new CommandException("You may only claim regions inside " + - "existing regions that you or your group own."); + "existing regions that you or your group own."); } } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/commands/RegionMemberCommands.java b/src/main/java/com/sk89q/worldguard/bukkit/commands/RegionMemberCommands.java index ad1c2410..01fd46ea 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/commands/RegionMemberCommands.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/commands/RegionMemberCommands.java @@ -20,10 +20,12 @@ package com.sk89q.worldguard.bukkit.commands; import java.io.IOException; + import org.bukkit.ChatColor; import org.bukkit.World; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandException; diff --git a/src/main/java/com/sk89q/worldguard/bukkit/commands/ToggleCommands.java b/src/main/java/com/sk89q/worldguard/bukkit/commands/ToggleCommands.java index cb888622..28217d7e 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/commands/ToggleCommands.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/commands/ToggleCommands.java @@ -19,15 +19,20 @@ package com.sk89q.worldguard.bukkit.commands; -import com.sk89q.worldguard.bukkit.BukkitUtil; -import com.sk89q.worldguard.bukkit.ConfigurationManager; import org.bukkit.ChatColor; import org.bukkit.World; import org.bukkit.command.CommandSender; -import com.sk89q.minecraft.util.commands.*; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; + +import com.sk89q.minecraft.util.commands.Command; +import com.sk89q.minecraft.util.commands.CommandContext; +import com.sk89q.minecraft.util.commands.CommandException; +import com.sk89q.minecraft.util.commands.CommandPermissions; +import com.sk89q.worldguard.bukkit.BukkitUtil; +import com.sk89q.worldguard.bukkit.ConfigurationManager; import com.sk89q.worldguard.bukkit.WorldConfiguration; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; -import org.bukkit.entity.*; public class ToggleCommands { diff --git a/src/main/java/com/sk89q/worldguard/bukkit/commands/WorldGuardCommands.java b/src/main/java/com/sk89q/worldguard/bukkit/commands/WorldGuardCommands.java index 5a03203f..a6e46f1f 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/commands/WorldGuardCommands.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/commands/WorldGuardCommands.java @@ -23,9 +23,11 @@ import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; + import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; + import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandException; diff --git a/src/main/java/com/sk89q/worldguard/domains/DefaultDomain.java b/src/main/java/com/sk89q/worldguard/domains/DefaultDomain.java index 605bbe6c..6cc44578 100644 --- a/src/main/java/com/sk89q/worldguard/domains/DefaultDomain.java +++ b/src/main/java/com/sk89q/worldguard/domains/DefaultDomain.java @@ -23,6 +23,7 @@ import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Set; + import com.sk89q.worldguard.LocalPlayer; public class DefaultDomain implements Domain { diff --git a/src/main/java/com/sk89q/worldguard/domains/DomainCollection.java b/src/main/java/com/sk89q/worldguard/domains/DomainCollection.java index d7b77ea6..87132e19 100644 --- a/src/main/java/com/sk89q/worldguard/domains/DomainCollection.java +++ b/src/main/java/com/sk89q/worldguard/domains/DomainCollection.java @@ -19,8 +19,9 @@ package com.sk89q.worldguard.domains; -import java.util.Set; import java.util.LinkedHashSet; +import java.util.Set; + import com.sk89q.worldguard.LocalPlayer; public class DomainCollection implements Domain { diff --git a/src/main/java/com/sk89q/worldguard/domains/GroupDomain.java b/src/main/java/com/sk89q/worldguard/domains/GroupDomain.java index 2f864998..1195063f 100644 --- a/src/main/java/com/sk89q/worldguard/domains/GroupDomain.java +++ b/src/main/java/com/sk89q/worldguard/domains/GroupDomain.java @@ -20,8 +20,9 @@ package com.sk89q.worldguard.domains; import java.util.Arrays; -import java.util.Set; import java.util.LinkedHashSet; +import java.util.Set; + import com.sk89q.worldguard.LocalPlayer; public class GroupDomain implements Domain { diff --git a/src/main/java/com/sk89q/worldguard/domains/PlayerDomain.java b/src/main/java/com/sk89q/worldguard/domains/PlayerDomain.java index a6594994..b596bd97 100644 --- a/src/main/java/com/sk89q/worldguard/domains/PlayerDomain.java +++ b/src/main/java/com/sk89q/worldguard/domains/PlayerDomain.java @@ -19,8 +19,9 @@ package com.sk89q.worldguard.domains; -import java.util.Set; import java.util.HashSet; +import java.util.Set; + import com.sk89q.worldguard.LocalPlayer; public class PlayerDomain implements Domain { diff --git a/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java b/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java index a1639d50..42ae01fa 100644 --- a/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java +++ b/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java @@ -18,9 +18,6 @@ */ package com.sk89q.worldguard.protection; -import com.sk89q.worldguard.protection.flags.*; -import com.sk89q.worldguard.protection.flags.StateFlag.State; -import com.sk89q.worldguard.protection.regions.ProtectedRegion; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -28,7 +25,14 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; + import com.sk89q.worldguard.LocalPlayer; +import com.sk89q.worldguard.protection.flags.DefaultFlag; +import com.sk89q.worldguard.protection.flags.Flag; +import com.sk89q.worldguard.protection.flags.RegionGroupFlag; +import com.sk89q.worldguard.protection.flags.StateFlag; +import com.sk89q.worldguard.protection.flags.StateFlag.State; +import com.sk89q.worldguard.protection.regions.ProtectedRegion; /** * Represents a set of regions for a particular point or area and the rules diff --git a/src/main/java/com/sk89q/worldguard/protection/GlobalRegionManager.java b/src/main/java/com/sk89q/worldguard/protection/GlobalRegionManager.java index d57512e8..e242eb96 100644 --- a/src/main/java/com/sk89q/worldguard/protection/GlobalRegionManager.java +++ b/src/main/java/com/sk89q/worldguard/protection/GlobalRegionManager.java @@ -19,6 +19,18 @@ package com.sk89q.worldguard.protection; import static com.sk89q.worldguard.bukkit.BukkitUtil.toVector; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.HashMap; +import java.util.logging.Logger; + +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; + import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.bukkit.BukkitUtil; import com.sk89q.worldguard.bukkit.ConfigurationManager; @@ -28,15 +40,6 @@ import com.sk89q.worldguard.protection.flags.StateFlag; import com.sk89q.worldguard.protection.managers.FlatRegionManager; import com.sk89q.worldguard.protection.managers.RegionManager; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.HashMap; -import java.util.logging.Logger; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; /** * This class keeps track of region information for every world. It loads diff --git a/src/main/java/com/sk89q/worldguard/protection/databases/AbstractProtectionDatabase.java b/src/main/java/com/sk89q/worldguard/protection/databases/AbstractProtectionDatabase.java index 1e54a4f9..376bee1b 100644 --- a/src/main/java/com/sk89q/worldguard/protection/databases/AbstractProtectionDatabase.java +++ b/src/main/java/com/sk89q/worldguard/protection/databases/AbstractProtectionDatabase.java @@ -20,6 +20,7 @@ package com.sk89q.worldguard.protection.databases; import java.io.IOException; + import com.sk89q.worldguard.protection.managers.RegionManager; public abstract class AbstractProtectionDatabase implements ProtectionDatabase { diff --git a/src/main/java/com/sk89q/worldguard/protection/databases/CSVDatabase.java b/src/main/java/com/sk89q/worldguard/protection/databases/CSVDatabase.java index 78054d41..35bbdccf 100644 --- a/src/main/java/com/sk89q/worldguard/protection/databases/CSVDatabase.java +++ b/src/main/java/com/sk89q/worldguard/protection/databases/CSVDatabase.java @@ -19,21 +19,25 @@ package com.sk89q.worldguard.protection.databases; -import com.sk89q.worldguard.protection.flags.DefaultFlag; -import com.sk89q.worldguard.protection.flags.StateFlag; -import com.sk89q.worldguard.protection.flags.StateFlag.State; -import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.io.*; + import au.com.bytecode.opencsv.CSVReader; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.domains.DefaultDomain; +import com.sk89q.worldguard.protection.flags.DefaultFlag; +import com.sk89q.worldguard.protection.flags.StateFlag; +import com.sk89q.worldguard.protection.flags.StateFlag.State; +import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion; import com.sk89q.worldguard.protection.regions.ProtectedRegion; import com.sk89q.worldguard.protection.regions.ProtectedRegion.CircularInheritanceException; import com.sk89q.worldguard.util.ArrayReader; diff --git a/src/main/java/com/sk89q/worldguard/protection/databases/ProtectionDatabase.java b/src/main/java/com/sk89q/worldguard/protection/databases/ProtectionDatabase.java index c9d3bedf..a026891c 100644 --- a/src/main/java/com/sk89q/worldguard/protection/databases/ProtectionDatabase.java +++ b/src/main/java/com/sk89q/worldguard/protection/databases/ProtectionDatabase.java @@ -19,11 +19,12 @@ package com.sk89q.worldguard.protection.databases; -import com.sk89q.worldguard.protection.managers.RegionManager; -import com.sk89q.worldguard.protection.regions.ProtectedRegion; import java.io.IOException; import java.util.Map; +import com.sk89q.worldguard.protection.managers.RegionManager; +import com.sk89q.worldguard.protection.regions.ProtectedRegion; + /** * Represents a database to read and write lists of regions from and to. * diff --git a/src/main/java/com/sk89q/worldguard/protection/databases/RegionDBUtil.java b/src/main/java/com/sk89q/worldguard/protection/databases/RegionDBUtil.java index 94f2e7a7..6038cbab 100644 --- a/src/main/java/com/sk89q/worldguard/protection/databases/RegionDBUtil.java +++ b/src/main/java/com/sk89q/worldguard/protection/databases/RegionDBUtil.java @@ -21,6 +21,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; + import com.sk89q.worldguard.domains.DefaultDomain; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/databases/YAMLDatabase.java b/src/main/java/com/sk89q/worldguard/protection/databases/YAMLDatabase.java index d013602b..42e0d474 100644 --- a/src/main/java/com/sk89q/worldguard/protection/databases/YAMLDatabase.java +++ b/src/main/java/com/sk89q/worldguard/protection/databases/YAMLDatabase.java @@ -28,6 +28,7 @@ import java.util.Map; import java.util.Set; import java.util.logging.Logger; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/BooleanFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/BooleanFlag.java index e5124bf6..905f5f38 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/BooleanFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/BooleanFlag.java @@ -19,6 +19,7 @@ package com.sk89q.worldguard.protection.flags; import org.bukkit.command.CommandSender; + import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/CommandStringFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/CommandStringFlag.java index 589a1a8c..205f5516 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/CommandStringFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/CommandStringFlag.java @@ -19,6 +19,7 @@ package com.sk89q.worldguard.protection.flags; import org.bukkit.command.CommandSender; + import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/CreatureTypeFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/CreatureTypeFlag.java index d9787ad4..1964e7c9 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/CreatureTypeFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/CreatureTypeFlag.java @@ -18,8 +18,6 @@ */ package com.sk89q.worldguard.protection.flags; -import org.bukkit.command.CommandSender; -import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import org.bukkit.entity.CreatureType; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/DoubleFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/DoubleFlag.java index 62f58e0d..ae392991 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/DoubleFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/DoubleFlag.java @@ -19,6 +19,7 @@ package com.sk89q.worldguard.protection.flags; import org.bukkit.command.CommandSender; + import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/EnumFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/EnumFlag.java index db9b85b0..e3144c13 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/EnumFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/EnumFlag.java @@ -19,6 +19,7 @@ package com.sk89q.worldguard.protection.flags; import org.bukkit.command.CommandSender; + import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/Flag.java b/src/main/java/com/sk89q/worldguard/protection/flags/Flag.java index 6be09e64..748bf76a 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/Flag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/Flag.java @@ -19,6 +19,7 @@ package com.sk89q.worldguard.protection.flags; import org.bukkit.command.CommandSender; + import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/IntegerFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/IntegerFlag.java index 599e2883..d18c4a78 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/IntegerFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/IntegerFlag.java @@ -19,6 +19,7 @@ package com.sk89q.worldguard.protection.flags; import org.bukkit.command.CommandSender; + import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/RegionGroupFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/RegionGroupFlag.java index d0f7b4d5..651cca3d 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/RegionGroupFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/RegionGroupFlag.java @@ -18,11 +18,12 @@ */ package com.sk89q.worldguard.protection.flags; +import org.bukkit.command.CommandSender; + import com.sk89q.worldguard.LocalPlayer; +import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import com.sk89q.worldguard.protection.ApplicableRegionSet; import com.sk89q.worldguard.protection.regions.ProtectedRegion; -import org.bukkit.command.CommandSender; -import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** * diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/SetFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/SetFlag.java index 3b3d3435..070bb2d0 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/SetFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/SetFlag.java @@ -18,10 +18,15 @@ */ package com.sk89q.worldguard.protection.flags; -import org.bukkit.command.CommandSender; -import com.sk89q.worldguard.bukkit.WorldGuardPlugin; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; -import java.util.*; +import org.bukkit.command.CommandSender; + +import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** * Represents a flag that consists of a set. @@ -56,8 +61,8 @@ public Set parseInput(WorldGuardPlugin plugin, CommandSender sender, @Override public Set unmarshal(Object o) { - if (o instanceof Collection) { - Collection collection = (Collection) o; + if (o instanceof Collection) { + Collection collection = (Collection) o; Set items = new HashSet(); for (Object sub : collection) { diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/StateFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/StateFlag.java index b763317f..d3ea1f9f 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/StateFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/StateFlag.java @@ -19,6 +19,7 @@ package com.sk89q.worldguard.protection.flags; import org.bukkit.command.CommandSender; + import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/StringFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/StringFlag.java index b8cb8b50..065f2d98 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/StringFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/StringFlag.java @@ -19,6 +19,7 @@ package com.sk89q.worldguard.protection.flags; import org.bukkit.command.CommandSender; + import com.sk89q.worldguard.bukkit.WorldGuardPlugin; /** diff --git a/src/main/java/com/sk89q/worldguard/protection/flags/VectorFlag.java b/src/main/java/com/sk89q/worldguard/protection/flags/VectorFlag.java index 81544473..0ebe24bb 100644 --- a/src/main/java/com/sk89q/worldguard/protection/flags/VectorFlag.java +++ b/src/main/java/com/sk89q/worldguard/protection/flags/VectorFlag.java @@ -20,7 +20,9 @@ import java.util.HashMap; import java.util.Map; + import org.bukkit.command.CommandSender; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.bukkit.BukkitUtil; @@ -54,7 +56,7 @@ public Vector parseInput(WorldGuardPlugin plugin, CommandSender sender, @Override public Vector unmarshal(Object o) { - if (o instanceof Map) { + if (o instanceof Map) { Map map = (Map) o; Object rawX = map.get("x"); diff --git a/src/main/java/com/sk89q/worldguard/protection/managers/FlatRegionManager.java b/src/main/java/com/sk89q/worldguard/protection/managers/FlatRegionManager.java index e22bb01a..c979116e 100644 --- a/src/main/java/com/sk89q/worldguard/protection/managers/FlatRegionManager.java +++ b/src/main/java/com/sk89q/worldguard/protection/managers/FlatRegionManager.java @@ -19,17 +19,18 @@ package com.sk89q.worldguard.protection.managers; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.TreeSet; + import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.protection.ApplicableRegionSet; import com.sk89q.worldguard.protection.UnsupportedIntersectionException; -import com.sk89q.worldguard.protection.regions.ProtectedRegion; import com.sk89q.worldguard.protection.databases.ProtectionDatabase; -import java.util.Iterator; +import com.sk89q.worldguard.protection.regions.ProtectedRegion; /** * A very simple implementation of the region manager that uses a flat list diff --git a/src/main/java/com/sk89q/worldguard/protection/managers/PRTreeRegionManager.java b/src/main/java/com/sk89q/worldguard/protection/managers/PRTreeRegionManager.java index 6761b15b..af89dbbe 100644 --- a/src/main/java/com/sk89q/worldguard/protection/managers/PRTreeRegionManager.java +++ b/src/main/java/com/sk89q/worldguard/protection/managers/PRTreeRegionManager.java @@ -18,21 +18,23 @@ */ package com.sk89q.worldguard.protection.managers; +import java.io.IOException; import java.util.ArrayList; import java.util.Collections; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.TreeMap; + import org.khelekore.prtree.MBRConverter; import org.khelekore.prtree.PRTree; + import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.protection.ApplicableRegionSet; +import com.sk89q.worldguard.protection.databases.ProtectionDatabase; import com.sk89q.worldguard.protection.regions.ProtectedRegion; import com.sk89q.worldguard.protection.regions.ProtectedRegionMBRConverter; -import com.sk89q.worldguard.protection.databases.ProtectionDatabase; -import java.io.IOException; -import java.util.Iterator; public class PRTreeRegionManager extends RegionManager { diff --git a/src/main/java/com/sk89q/worldguard/protection/managers/RegionManager.java b/src/main/java/com/sk89q/worldguard/protection/managers/RegionManager.java index 9f098235..168b0baf 100644 --- a/src/main/java/com/sk89q/worldguard/protection/managers/RegionManager.java +++ b/src/main/java/com/sk89q/worldguard/protection/managers/RegionManager.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.util.List; import java.util.Map; + import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.protection.ApplicableRegionSet; diff --git a/src/main/java/com/sk89q/worldguard/protection/regions/GlobalProtectedRegion.java b/src/main/java/com/sk89q/worldguard/protection/regions/GlobalProtectedRegion.java index c1836734..869240bb 100644 --- a/src/main/java/com/sk89q/worldguard/protection/regions/GlobalProtectedRegion.java +++ b/src/main/java/com/sk89q/worldguard/protection/regions/GlobalProtectedRegion.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.List; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.protection.UnsupportedIntersectionException; diff --git a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedCuboidRegion.java b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedCuboidRegion.java index 6cd6fe64..da099a06 100644 --- a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedCuboidRegion.java +++ b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedCuboidRegion.java @@ -18,11 +18,14 @@ */ package com.sk89q.worldguard.protection.regions; -import com.sk89q.worldedit.*; -import com.sk89q.worldguard.protection.UnsupportedIntersectionException; import java.util.ArrayList; import java.util.List; +import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldguard.protection.UnsupportedIntersectionException; + /** * Represents a cuboid region that can be protected. * diff --git a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedPolygonalRegion.java b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedPolygonalRegion.java index 41a8aa86..0591480e 100644 --- a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedPolygonalRegion.java +++ b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedPolygonalRegion.java @@ -18,8 +18,9 @@ */ package com.sk89q.worldguard.protection.regions; -import java.util.List; import java.util.ArrayList; +import java.util.List; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; diff --git a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegion.java b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegion.java index 0531523a..16631806 100644 --- a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegion.java +++ b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegion.java @@ -19,16 +19,17 @@ package com.sk89q.worldguard.protection.regions; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.domains.DefaultDomain; import com.sk89q.worldguard.protection.UnsupportedIntersectionException; import com.sk89q.worldguard.protection.flags.Flag; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; /** * Represents a region of any shape and size that can be protected. diff --git a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegionMBRConverter.java b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegionMBRConverter.java index ea622379..83606f22 100644 --- a/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegionMBRConverter.java +++ b/src/main/java/com/sk89q/worldguard/protection/regions/ProtectedRegionMBRConverter.java @@ -37,5 +37,4 @@ public double getMaxX(ProtectedRegion t) { public double getMaxY(ProtectedRegion t) { return t.getMaximumPoint().getBlockZ(); } - } diff --git a/src/main/java/com/sk89q/worldguard/util/LogListBlock.java b/src/main/java/com/sk89q/worldguard/util/LogListBlock.java index 0707cff2..936d5a88 100644 --- a/src/main/java/com/sk89q/worldguard/util/LogListBlock.java +++ b/src/main/java/com/sk89q/worldguard/util/LogListBlock.java @@ -19,8 +19,8 @@ package com.sk89q.worldguard.util; -import java.util.Map; import java.util.LinkedHashMap; +import java.util.Map; public class LogListBlock { private LinkedHashMap items diff --git a/src/main/java/com/sk89q/worldguard/util/RegionUtil.java b/src/main/java/com/sk89q/worldguard/util/RegionUtil.java index 879728c9..3b3873e1 100644 --- a/src/main/java/com/sk89q/worldguard/util/RegionUtil.java +++ b/src/main/java/com/sk89q/worldguard/util/RegionUtil.java @@ -21,6 +21,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; + import com.sk89q.worldguard.domains.DefaultDomain; /** diff --git a/src/main/java/com/sk89q/worldguard/util/yaml/Configuration.java b/src/main/java/com/sk89q/worldguard/util/yaml/Configuration.java index 5dcbb7c6..ed4b8b80 100644 --- a/src/main/java/com/sk89q/worldguard/util/yaml/Configuration.java +++ b/src/main/java/com/sk89q/worldguard/util/yaml/Configuration.java @@ -26,8 +26,7 @@ import java.io.OutputStreamWriter; import java.util.HashMap; import java.util.Map; -import com.sk89q.worldguard.util.yaml.ConfigurationException; -import com.sk89q.worldguard.util.yaml.ConfigurationNode; + import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; diff --git a/src/main/java/com/sk89q/worldguard/util/yaml/ConfigurationNode.java b/src/main/java/com/sk89q/worldguard/util/yaml/ConfigurationNode.java index 265e9a23..e72f1534 100644 --- a/src/main/java/com/sk89q/worldguard/util/yaml/ConfigurationNode.java +++ b/src/main/java/com/sk89q/worldguard/util/yaml/ConfigurationNode.java @@ -23,10 +23,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; -import com.sk89q.worldguard.util.yaml.ConfigurationNode; /** * Represents a configuration node.