diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java index 780a33d78..3129a48ec 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java @@ -2,12 +2,8 @@ package com.intellectualcrafters.plot; import java.io.File; -import org.bukkit.entity.Player; - import net.milkbowl.vault.economy.Economy; -import com.intellectualcrafters.plot.object.Location; -import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.util.TaskManager; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java index f95ae7d61..877eeaac6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java @@ -14,9 +14,9 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; -import java.util.UUID; import java.util.Map.Entry; import java.util.Set; +import java.util.UUID; import net.milkbowl.vault.economy.Economy; @@ -49,10 +49,10 @@ import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.util.ClusterManager; import com.intellectualcrafters.plot.util.ExpireManager; import com.intellectualcrafters.plot.util.Logger; -import com.intellectualcrafters.plot.util.PlotHelper; -import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.Logger.LogLevel; +import com.intellectualcrafters.plot.util.PlotHelper; import com.intellectualcrafters.plot.util.TaskManager; +import com.intellectualcrafters.plot.util.UUIDHandler; public class PlotSquared { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/_PlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/_PlotMain.java index 5080f75ad..6dd1bffd6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/_PlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/_PlotMain.java @@ -383,7 +383,7 @@ public class _PlotSquared { return true; } PlayerFunctions.sendMessage(player, C.TELEPORT_IN_SECONDS, Settings.TELEPORT_DELAY + ""); - Location loc = player.getLocation(); + Location loc = BukkitUtil.getLocation(entity); final String world = player.getWorld(); final String name = player.getName(); TaskManager.TELEPORT_QUEUE.add(name); @@ -398,7 +398,7 @@ public class _PlotSquared { if (!player.isOnline()) { return; } - Location loc = player.getLocation(); + Location loc = BukkitUtil.getLocation(entity); if (!loc.getWorld().equals(world)) { PlayerFunctions.sendMessage(player, C.TELEPORT_FAILED); return; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java index 0cd0e7d97..66a1241e4 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java @@ -21,31 +21,6 @@ package com.intellectualcrafters.plot.api; -import java.util.ArrayList; -import java.util.Set; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import com.intellectualcrafters.plot.PlotSquared; -import com.intellectualcrafters.plot.commands.MainCommand; -import com.intellectualcrafters.plot.commands.SubCommand; -import com.intellectualcrafters.plot.config.C; -import com.intellectualcrafters.plot.flag.AbstractFlag; -import com.intellectualcrafters.plot.flag.FlagManager; -import com.intellectualcrafters.plot.object.Plot; -import com.intellectualcrafters.plot.object.PlotId; -import com.intellectualcrafters.plot.object.PlotManager; -import com.intellectualcrafters.plot.object.PlotWorld; -import com.intellectualcrafters.plot.util.PlayerFunctions; -import com.intellectualcrafters.plot.util.PlotHelper; -import com.intellectualcrafters.plot.util.PlotSquaredException; -import com.intellectualcrafters.plot.util.SchematicHandler; -import com.intellectualcrafters.plot.util.UUIDHandler; /** * PlotSquared API @@ -423,7 +398,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler; // * @see com.intellectualcrafters.plot.object.Plot // */ // public Plot getPlot(final Player player) { -// return this.getPlot(player.getLocation()); +// return this.getPlot(BukkitUtil.getLocation(entity)); // } // // /** diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java index 2f1db2f48..cd101a200 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java @@ -27,11 +27,10 @@ import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.events.PlayerClaimPlotEvent; -import com.intellectualcrafters.plot.generator.ClassicPlotWorld; -import com.intellectualcrafters.plot.generator.HybridPlotWorld; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.util.PlayerFunctions; @@ -62,7 +61,7 @@ public class Claim extends SubCommand { PlotHelper.setSign(player, plot); PlayerFunctions.sendMessage(player, C.CLAIMED); if (teleport) { - PlotSquared.teleportPlayer(player, player.getLocation(), plot); + PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); } World world = plot.getWorld(); final PlotWorld plotworld = PlotSquared.getWorldSettings(world); @@ -79,10 +78,10 @@ public class Claim extends SubCommand { sch = SchematicHandler.getSchematic(plotworld.SCHEMATIC_FILE); } } - SchematicHandler.paste(player.getLocation(), sch, plot2, 0, 0); + SchematicHandler.paste(BukkitUtil.getLocation(entity), sch, plot2, 0, 0); } PlotSquared.getPlotManager(plot.world).claimPlot(world, plotworld, plot); - PlotHelper.update(player.getLocation()); + PlotHelper.update(BukkitUtil.getLocation(entity)); } return event.isCancelled(); } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java index 6cfa00afb..7a84b43bf 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java @@ -24,6 +24,7 @@ package com.intellectualcrafters.plot.commands; import org.bukkit.Bukkit; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Plot; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java index 437509315..afc71ee3f 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java @@ -30,6 +30,7 @@ import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.generator.BlockPopulator; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CommandPermission.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CommandPermission.java index 9e17b4b1c..f104798a3 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CommandPermission.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CommandPermission.java @@ -23,7 +23,7 @@ package com.intellectualcrafters.plot.commands; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; /** * Created by Citymonstret on 2014-08-03. diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Comment.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Comment.java index f8040b252..2eb796700 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Comment.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Comment.java @@ -27,7 +27,7 @@ import java.util.List; import org.apache.commons.lang.StringUtils; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Plot; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Copy.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Copy.java index bb492b5e4..08f0e17bf 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Copy.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Copy.java @@ -23,7 +23,7 @@ package com.intellectualcrafters.plot.commands; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotSelection; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java index cab2afda7..d9c6bdb64 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java @@ -54,7 +54,7 @@ public class CreateRoadSchematic extends SubCommand { HybridPlotManager manager = (HybridPlotManager) PlotSquared.getPlotManager(player.getWorld()); manager.setupRoadSchematic(plot); - PlotHelper.update(player.getLocation()); + PlotHelper.update(BukkitUtil.getLocation(entity)); PlayerFunctions.sendMessage(player, "&6Saved new road schematic"); return true; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java index 5a01d0a0b..0666b82a0 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java @@ -68,7 +68,7 @@ public class DebugClaimTest extends SubCommand { PlotHelper.setSign(player, plot); PlayerFunctions.sendMessage(player, C.CLAIMED); if (teleport) { - PlotSquared.teleportPlayer(player, player.getLocation(), plot); + PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); } } return event.isCancelled(); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java index 1583384cb..770f0e1ce 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java @@ -26,6 +26,7 @@ import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.generator.SquarePlotWorld; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java index eab28d1ca..da608c3c9 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java @@ -30,8 +30,8 @@ import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.generator.HybridPlotManager; import com.intellectualcrafters.plot.generator.HybridPlotWorld; -import com.intellectualcrafters.plot.util.SetBlockManager; import com.intellectualcrafters.plot.util.PlayerFunctions; +import com.intellectualcrafters.plot.util.SetBlockManager; public class DebugRoadRegen extends SubCommand { @@ -46,7 +46,7 @@ public class DebugRoadRegen extends SubCommand { } HybridPlotManager manager = (HybridPlotManager) PlotSquared.getPlotManager(player.getWorld()); - Chunk chunk = player.getLocation().getChunk(); + Chunk chunk = BukkitUtil.getLocation(entity).getChunk(); boolean result = manager.regenerateRoad(chunk); if (result) { SetBlockManager.setBlockManager.update(Arrays.asList(new Chunk[] {chunk})); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java index 7d41ddd31..626851473 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java @@ -25,6 +25,7 @@ import net.milkbowl.vault.economy.Economy; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java index 63ca9c501..944a413b5 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Denied.java @@ -26,7 +26,7 @@ import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.events.PlayerPlotDeniedEvent; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java index 972bc5a10..3d2b48088 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java @@ -28,7 +28,7 @@ import java.util.HashMap; import org.apache.commons.lang.StringUtils; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.flag.AbstractFlag; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java index 81219107a..85a7baab7 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Helpers.java @@ -26,7 +26,7 @@ import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.events.PlayerPlotHelperEvent; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java index e326d5eee..de758bb59 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java @@ -88,7 +88,7 @@ public class Home extends SubCommand { } public void teleportPlayer(Player player, Plot plot) { - PlotSquared.teleportPlayer(player, player.getLocation(), plot); + PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java index d1f3d39ec..de4b7952e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java @@ -29,6 +29,7 @@ import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java index e70767edd..4cbb260eb 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Kick.java @@ -24,7 +24,7 @@ package com.intellectualcrafters.plot.commands; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.util.PlayerFunctions; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java index c2330fd1e..ff8989b71 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java @@ -30,6 +30,7 @@ import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.events.PlotMergeEvent; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Move.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Move.java index 40ee9422b..c180aba67 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Move.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Move.java @@ -21,21 +21,12 @@ package com.intellectualcrafters.plot.commands; -import java.util.ArrayList; -import java.util.UUID; - -import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; -import com.intellectualcrafters.plot.database.DBFunc; -import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotId; -import com.intellectualcrafters.plot.util.ChunkManager; import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlotHelper; -import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager; /** * Created 2014-08-01 for PlotSquared diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Paste.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Paste.java index 343ae313b..b05d85c18 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Paste.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Paste.java @@ -23,7 +23,7 @@ package com.intellectualcrafters.plot.commands; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotSelection; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Reload.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Reload.java index f847acff3..bf604e31e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Reload.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Reload.java @@ -26,6 +26,7 @@ import org.bukkit.entity.Player; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.PlotWorld; +import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.PlayerFunctions; public class Reload extends SubCommand { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Schematic.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Schematic.java index 130edd9ce..eaa3a0c2b 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Schematic.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Schematic.java @@ -31,6 +31,7 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import com.intellectualcrafters.jnbt.CompoundTag; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.Settings; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java index 676fa58c8..b56466d8d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java @@ -21,7 +21,6 @@ package com.intellectualcrafters.plot.commands; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -33,15 +32,14 @@ import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.Configuration; -import com.intellectualcrafters.plot.config.Configuration.SettingValue; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.flag.AbstractFlag; import com.intellectualcrafters.plot.flag.Flag; import com.intellectualcrafters.plot.flag.FlagManager; -import com.intellectualcrafters.plot.flag.FlagValue; import com.intellectualcrafters.plot.listeners.PlotListener; import com.intellectualcrafters.plot.object.BlockLoc; import com.intellectualcrafters.plot.object.Plot; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/SetOwner.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/SetOwner.java index 79eb7fb2b..347a5bef0 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/SetOwner.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/SetOwner.java @@ -27,6 +27,7 @@ import java.util.UUID; import org.bukkit.World; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java index 57ee354d3..e93c1de94 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java @@ -24,6 +24,7 @@ package com.intellectualcrafters.plot.commands; import org.bukkit.World; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trim.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trim.java index 57d023160..cd1c3d193 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trim.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trim.java @@ -28,7 +28,6 @@ import java.nio.file.Paths; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.HashSet; -import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -37,13 +36,10 @@ import org.bukkit.entity.Player; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; -import com.intellectualcrafters.plot.generator.SquarePlotManager; -import com.intellectualcrafters.plot.generator.SquarePlotWorld; import com.intellectualcrafters.plot.object.ChunkLoc; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.util.ChunkManager; -import com.intellectualcrafters.plot.util.ExpireManager; import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlotHelper; import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trusted.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trusted.java index 3d1d493c7..b2618a6d1 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trusted.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trusted.java @@ -26,7 +26,7 @@ import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.events.PlayerPlotTrustedEvent; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java index 91d534670..4add6adbb 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java @@ -26,6 +26,7 @@ import net.milkbowl.vault.economy.Economy; import org.bukkit.World; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java index 7d91e0868..86ad65d27 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java @@ -27,6 +27,7 @@ import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/WE_Anywhere.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/WE_Anywhere.java index eb37026bb..789fd2812 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/WE_Anywhere.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/WE_Anywhere.java @@ -23,6 +23,7 @@ package com.intellectualcrafters.plot.commands; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.util.PWE; import com.intellectualcrafters.plot.util.PlayerFunctions; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java index 9995b1689..92d96cb37 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -21,11 +21,15 @@ package com.intellectualcrafters.plot.config; -import com.intellectualcrafters.plot.PlotSquared; -import com.intellectualsites.translation.*; -import com.intellectualsites.translation.bukkit.BukkitTranslation; import org.bukkit.ChatColor; +import com.intellectualsites.translation.TranslationFile; +import com.intellectualsites.translation.TranslationLanguage; +import com.intellectualsites.translation.TranslationManager; +import com.intellectualsites.translation.TranslationObject; +import com.intellectualsites.translation.YamlTranslationFile; +import com.intellectualsites.translation.bukkit.BukkitTranslation; + /** * Captions class. * diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/Database.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/Database.java index b9e14899d..0e3b503e9 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/Database.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/Database.java @@ -25,8 +25,6 @@ import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; -import org.bukkit.plugin.Plugin; - import com.intellectualcrafters.plot.PlotSquared; /** diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/MySQL.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/MySQL.java index 2dd5a0f3c..6622a85c5 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/MySQL.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/MySQL.java @@ -27,8 +27,6 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import org.bukkit.plugin.Plugin; - import com.intellectualcrafters.plot.PlotSquared; /** diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLite.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLite.java index 392381d04..495f2999d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLite.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/SQLite.java @@ -30,8 +30,6 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.logging.Level; -import org.bukkit.plugin.Plugin; - import com.intellectualcrafters.plot.PlotSquared; /** diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java index cd98d066b..030931cb2 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java @@ -17,9 +17,9 @@ import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotManager; import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.object.RegionWrapper; -import com.intellectualcrafters.plot.util.SetBlockManager; import com.intellectualcrafters.plot.util.ChunkManager; import com.intellectualcrafters.plot.util.PlotHelper; +import com.intellectualcrafters.plot.util.SetBlockManager; import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager; public class AugmentedPopulator extends BlockPopulator { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/ClassicPlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/ClassicPlotManager.java index c1d93bd85..878fb7589 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/ClassicPlotManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/ClassicPlotManager.java @@ -1,25 +1,16 @@ package com.intellectualcrafters.plot.generator; import java.util.ArrayList; -import java.util.HashMap; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; -import org.bukkit.block.Biome; -import org.bukkit.block.Block; -import com.intellectualcrafters.plot.PlotSquared; -import com.intellectualcrafters.plot.config.C; -import com.intellectualcrafters.plot.object.ChunkLoc; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotWorld; -import com.intellectualcrafters.plot.util.ChunkManager; -import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlotHelper; -import com.intellectualcrafters.plot.util.UUIDHandler; /** diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java index a25ce25de..eb07a6f95 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java @@ -29,7 +29,6 @@ import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.World; -import org.bukkit.block.Biome; import org.bukkit.block.Block; import org.bukkit.plugin.Plugin; @@ -41,11 +40,10 @@ import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotWorld; -import com.intellectualcrafters.plot.util.SetBlockManager; import com.intellectualcrafters.plot.util.ChunkManager; -import com.intellectualcrafters.plot.util.PlayerFunctions; import com.intellectualcrafters.plot.util.PlotHelper; import com.intellectualcrafters.plot.util.SchematicHandler; +import com.intellectualcrafters.plot.util.SetBlockManager; import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index 93b6710a6..1683bfe25 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -83,6 +83,7 @@ import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.WorldInitEvent; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.commands.Setup; import com.intellectualcrafters.plot.config.C; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents_1_8.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents_1_8.java index 4c45a933c..7edea424e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents_1_8.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents_1_8.java @@ -7,7 +7,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerInteractAtEntityEvent; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.util.PlayerFunctions; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotPlusListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotPlusListener.java index 9bd0b376c..bd057d4d8 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotPlusListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotPlusListener.java @@ -46,7 +46,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.plugin.java.JavaPlugin; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.events.PlayerEnterPlotEvent; import com.intellectualcrafters.plot.events.PlayerLeavePlotEvent; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java index 443bd91ef..7ce18627a 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldEditListener.java @@ -40,6 +40,7 @@ import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerTeleportEvent; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.Settings; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/Plot.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/Plot.java index 5269fcd42..972ce83f5 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/Plot.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/Plot.java @@ -31,7 +31,7 @@ import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.entity.Player; -import com.intellectualcrafters.plot.PlotSquared; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.flag.Flag; import com.intellectualcrafters.plot.util.PlotHelper; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotManager.java index 80c6dc9c9..2c63302ae 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotManager.java @@ -23,7 +23,6 @@ package com.intellectualcrafters.plot.object; import java.util.ArrayList; -import org.bukkit.World; import org.bukkit.block.Biome; public abstract class PlotManager { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java index 9f6c68ade..d030ab618 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java @@ -1,7 +1,5 @@ package com.intellectualcrafters.plot.util; -import org.bukkit.World; - import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.util.bukkit.BukkitUtil; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java index 7efbf52b8..ac6e8d344 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java @@ -10,7 +10,6 @@ import org.apache.commons.lang.mutable.MutableInt; import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.DyeColor; -import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Note; import org.bukkit.SkullType; @@ -43,10 +42,12 @@ import org.bukkit.plugin.Plugin; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.object.BlockLoc; import com.intellectualcrafters.plot.object.ChunkLoc; +import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.RegionWrapper; import com.intellectualcrafters.plot.object.entity.EntityWrapper; import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager; +import com.intellectualcrafters.plot.util.bukkit.BukkitUtil; public class ChunkManager { @@ -57,8 +58,8 @@ public class ChunkManager { public static HashMap tasks = new HashMap<>(); public static ChunkLoc getChunkChunk(Location loc) { - int x = loc.getBlockX() >> 9; - int z = loc.getBlockZ() >> 9; + int x = loc.getX() >> 9; + int z = loc.getZ() >> 9; return new ChunkLoc(x, z); } @@ -153,21 +154,21 @@ public class ChunkManager { */ public static boolean copyRegion(final Location pos1, final Location pos2, final Location newPos, final Runnable whenDone) { index.increment(); - final int relX = newPos.getBlockX() - pos1.getBlockX(); - final int relZ = newPos.getBlockZ() - pos1.getBlockZ(); - final RegionWrapper region = new RegionWrapper(pos1.getBlockX(), pos2.getBlockX(), pos1.getBlockZ(), pos2.getBlockZ()); + final int relX = newPos.getX() - pos1.getX(); + final int relZ = newPos.getZ() - pos1.getZ(); + final RegionWrapper region = new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ()); final World world = pos1.getWorld(); Chunk c1 = world.getChunkAt(pos1); Chunk c2 = world.getChunkAt(pos2); - Chunk c3 = world.getChunkAt((pos1.getBlockX() + relX) >> 4, (pos1.getBlockZ() + relZ) >> 4); - Chunk c4 = world.getChunkAt((pos2.getBlockX() + relX) >> 4, (pos2.getBlockZ() + relZ) >> 4); + Chunk c3 = world.getChunkAt((pos1.getX() + relX) >> 4, (pos1.getZ() + relZ) >> 4); + Chunk c4 = world.getChunkAt((pos2.getX() + relX) >> 4, (pos2.getZ() + relZ) >> 4); - final int sx = pos1.getBlockX(); - final int sz = pos1.getBlockZ(); - final int ex = pos2.getBlockX(); - final int ez = pos2.getBlockZ(); + final int sx = pos1.getX(); + final int sz = pos1.getZ(); + final int ex = pos2.getX(); + final int ez = pos2.getZ(); final int c1x = c1.getX(); final int c1z = c1.getZ(); @@ -275,10 +276,10 @@ public class ChunkManager { Chunk c1 = world.getChunkAt(pos1); Chunk c2 = world.getChunkAt(pos2); - final int sx = pos1.getBlockX(); - final int sz = pos1.getBlockZ(); - final int ex = pos2.getBlockX(); - final int ez = pos2.getBlockZ(); + final int sx = pos1.getX(); + final int sz = pos1.getZ(); + final int ex = pos2.getX(); + final int ez = pos2.getZ(); final int c1x = c1.getX(); final int c1z = c1.getZ(); @@ -304,7 +305,7 @@ public class ChunkManager { tasks.remove(currentIndex); return; } - CURRENT_PLOT_CLEAR = new RegionWrapper(pos1.getBlockX(), pos2.getBlockX(), pos1.getBlockZ(), pos2.getBlockZ()); + CURRENT_PLOT_CLEAR = new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ()); Chunk chunk = chunks.get(0); chunks.remove(0); int x = chunk.getX(); @@ -396,8 +397,8 @@ public class ChunkManager { public static void saveEntitiesOut(Chunk chunk, RegionWrapper region) { for (Entity entity : chunk.getEntities()) { Location loc = entity.getLocation(); - int x = loc.getBlockX(); - int z = loc.getBlockZ(); + int x = loc.getX(); + int z = loc.getZ(); if (isIn(region, x, z)) { continue; } @@ -411,9 +412,9 @@ public class ChunkManager { public static void saveEntitiesIn(Chunk chunk, RegionWrapper region) { for (Entity entity : chunk.getEntities()) { - Location loc = entity.getLocation(); - int x = loc.getBlockX(); - int z = loc.getBlockZ(); + Location loc = BukkitUtil.getLocation(entity); + int x = loc.getX(); + int z = loc.getZ(); if (!isIn(region, x, z)) { continue; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PWE.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PWE.java index d198db9d0..683e1b19e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PWE.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PWE.java @@ -25,6 +25,7 @@ import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Player; +import com.intellectualcrafters.plot.BukkitMain; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.flag.FlagManager; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlayerFunctions.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlayerFunctions.java index b0cef2723..c0a66ccb8 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlayerFunctions.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlayerFunctions.java @@ -172,7 +172,7 @@ import java.util.UUID; if (!PlotSquared.isPlotWorld(player.getWorld())) { return null; } - final PlotId id = getPlot(player.getLocation()); + final PlotId id = getPlot(BukkitUtil.getLocation(entity)); final World world = player.getWorld(); if (id == null) { return null; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/SetBlockManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/SetBlockManager.java index 0c1ddd854..34755dd02 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/SetBlockManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/SetBlockManager.java @@ -3,9 +3,6 @@ package com.intellectualcrafters.plot.util; import java.util.List; import org.bukkit.Chunk; -import org.bukkit.World; - -import com.intellectualcrafters.plot.object.PlotBlock; public abstract class SetBlockManager { public static SetBlockManager setBlockManager = null; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/UUIDHandler.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/UUIDHandler.java index 78ed98bcf..5ed532a3a 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/UUIDHandler.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/UUIDHandler.java @@ -13,7 +13,6 @@ import org.bukkit.entity.Player; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import com.intellectualcrafters.plot.PlotSquared; -import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.database.DBFunc; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitTaskManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitTaskManager.java index 47cbf69c6..6ba807dc5 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitTaskManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitTaskManager.java @@ -1,9 +1,6 @@ package com.intellectualcrafters.plot.util.bukkit; -import java.util.HashSet; - import com.intellectualcrafters.plot.BukkitMain; -import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.util.TaskManager; public class BukkitTaskManager extends TaskManager { @@ -21,9 +18,11 @@ public class BukkitTaskManager extends TaskManager { } public void taskLater(final Runnable r, int delay) { - if (r == null) { - return; - } BukkitMain.THIS.getServer().getScheduler().runTaskLater(BukkitMain.THIS, r, delay); } + + @Override + public void taskLaterAsync(Runnable r, int delay) { + BukkitMain.THIS.getServer().getScheduler().runTaskLaterAsynchronously(BukkitMain.THIS, r, delay); + } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java index df9ec1abe..2cbd42342 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitUtil.java @@ -15,7 +15,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import com.intellectualcrafters.plot.object.Location; -import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.util.BlockManager; import com.intellectualcrafters.plot.util.SetBlockManager; import com.intellectualcrafters.plot.util.SetBlockSlow; diff --git a/PlotSquared/src/main/java/com/intellectualsites/translation/bukkit/TranslationPlugin.java b/PlotSquared/src/main/java/com/intellectualsites/translation/bukkit/TranslationPlugin.java index 4fa992155..612307dc2 100644 --- a/PlotSquared/src/main/java/com/intellectualsites/translation/bukkit/TranslationPlugin.java +++ b/PlotSquared/src/main/java/com/intellectualsites/translation/bukkit/TranslationPlugin.java @@ -33,7 +33,7 @@ public class TranslationPlugin extends JavaPlugin { e.printStackTrace(); } // Now let's create some default files :D - this.english = new YamlTranslationFile(BukkitTranslation.getParent(this), TranslationLanguage.englishAmerican, getName(), manager).read().header("Example file", "@author Citymonstret"); + this.english = new YamlTranslationFile(BukkitTranslation.getParent(), TranslationLanguage.englishAmerican, getName(), manager).read().header("Example file", "@author Citymonstret"); // That created the file, read it, and made a default header getLogger().log(Level.INFO, BukkitTranslation.convert(manager.getTranslated("translator_loaded", TranslationLanguage.englishAmerican))); }