diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java index 3fe2dda28..b2f84b171 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java @@ -575,10 +575,11 @@ import com.sk89q.worldguard.bukkit.WorldGuardPlugin; * @return true if successful */ public static boolean teleportPlayer(final Player player, final Location from, final Plot plot) { - final PlayerTeleportToPlotEvent event = new PlayerTeleportToPlotEvent(player, from, plot); + Plot bot = PlayerFunctions.getBottomPlot(player.getWorld(), plot); + final PlayerTeleportToPlotEvent event = new PlayerTeleportToPlotEvent(player, from, bot); Bukkit.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { - final Location location = PlotHelper.getPlotHome(Bukkit.getWorld(plot.world), plot); + final Location location = PlotHelper.getPlotHome(Bukkit.getWorld(bot.world), bot); if ((location.getBlockX() >= 29999999) || (location.getBlockX() <= -29999999) || (location.getBlockZ() >= 299999999) || (location.getBlockZ() <= -29999999)) { event.setCancelled(true); return false; 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 99e0cb223..7ddf8ef47 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Home.java @@ -65,7 +65,7 @@ public class Home extends SubCommand { if ((temp = isAlias(args[0])) != null) { if (temp.hasOwner()) { if (temp.getOwner().equals(UUIDHandler.getUUID(plr))) { - PlotMain.teleportPlayer(plr, plr.getLocation(), temp); + teleportPlayer(plr, temp); return true; } } @@ -79,11 +79,16 @@ public class Home extends SubCommand { PlayerFunctions.sendMessage(plr, C.NOT_VALID_NUMBER); return false; } - PlotMain.teleportPlayer(plr, plr.getLocation(), plots[id - 1]); + teleportPlayer(plr, plots[id - 1]); return true; } else { PlayerFunctions.sendMessage(plr, C.NO_PLOTS); return true; } } + + public void teleportPlayer(Player player, Plot plot) { + PlotMain.teleportPlayer(player, player.getLocation(), plot); + } + } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java index 8e4914c43..0b46d2364 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java @@ -61,7 +61,6 @@ public abstract class PlotWorld { public final static boolean WORLD_BORDER_DEFAULT = false; // TODO make this configurable // make non static and static_default_valu + add config option - @SuppressWarnings("deprecation") public static List<Material> BLOCKS; /* * = * new @@ -258,7 +257,6 @@ public abstract class PlotWorld { */ static { - // TODO: Let jesse decide if this is stupid or not BLOCKS = new ArrayList<>(); for (final Material material : Material.values()) { if (material.isBlock() && material.isSolid() && !material.hasGravity() && !material.isTransparent() && material.isOccluding() && (material != Material.DROPPER)) {