diff --git a/src/com/wasteofplastic/askyblock/ASkyBlock.java b/src/com/wasteofplastic/askyblock/ASkyBlock.java index f20981848..e94103a03 100644 --- a/src/com/wasteofplastic/askyblock/ASkyBlock.java +++ b/src/com/wasteofplastic/askyblock/ASkyBlock.java @@ -496,17 +496,19 @@ protected boolean homeTeleport(final Player player) { if (home == null) { // The home is not safe if (!player.performCommand(Settings.SPAWNCOMMAND)) { + player.teleport(player.getWorld().getSpawnLocation()); + /* player.sendBlockChange(player.getWorld().getSpawnLocation() ,player.getWorld().getSpawnLocation().getBlock().getType() ,player.getWorld().getSpawnLocation().getBlock().getData()); - player.teleport(player.getWorld().getSpawnLocation()); + */ } player.sendMessage(ChatColor.RED + Locale.warpserrorNotSafe); return true; } //home.getWorld().refreshChunk(home.getChunk().getX(), home.getChunk().getZ()); // Removing this line because it appears to cause artifacts of hovering blocks - //home.getWorld().loadChunk(home.getChunk()); + home.getWorld().loadChunk(home.getChunk()); //getLogger().info("DEBUG: " + home.toString()); // This next line should help players with long ping times // http://bukkit.org/threads/workaround-for-playing-falling-after-teleport-when-lagging.293035/ @@ -515,7 +517,11 @@ protected boolean homeTeleport(final Player player) { //player.sendBlockChange(home.getBlock().getRelative(BlockFace.DOWN).getLocation(),home.getBlock().getRelative(BlockFace.DOWN).getType(),home.getBlock().getRelative(BlockFace.DOWN).getData()); //getLogger().info("DEBUG: " + home.getBlock().getType().toString()); //getLogger().info("DEBUG: " + home.getBlock().getRelative(BlockFace.DOWN).getType()); - player.teleport(home); + player.teleport(home); + /* + player.sendBlockChange(home,home.getBlock().getType(),home.getBlock().getData()); + player.sendBlockChange(home.getBlock().getRelative(BlockFace.DOWN).getLocation(),home.getBlock().getRelative(BlockFace.DOWN).getType(),home.getBlock().getRelative(BlockFace.DOWN).getData()); + */ player.sendMessage(ChatColor.GREEN + Locale.islandteleport); return true; } @@ -1924,10 +1930,10 @@ protected void removeMobsFromIsland(final Location loc) { // Move player to spawn if (plugin.getSpawn().getSpawnLoc() != null) { // go to island spawn + pl.teleport(plugin.getSpawn().getSpawnLoc()); pl.sendBlockChange(plugin.getSpawn().getSpawnLoc() ,plugin.getSpawn().getSpawnLoc().getBlock().getType() ,plugin.getSpawn().getSpawnLoc().getBlock().getData()); - pl.teleport(plugin.getSpawn().getSpawnLoc()); getLogger().warning("During island deletion player " + pl.getName() + " sent to spawn."); } else { if (!pl.performCommand(Settings.SPAWNCOMMAND)) { diff --git a/src/com/wasteofplastic/askyblock/AdminCmd.java b/src/com/wasteofplastic/askyblock/AdminCmd.java index f586ea16c..c413f8ed0 100644 --- a/src/com/wasteofplastic/askyblock/AdminCmd.java +++ b/src/com/wasteofplastic/askyblock/AdminCmd.java @@ -503,8 +503,8 @@ public void run() { Location safeSpot = plugin.getSafeHomeLocation(playerUUID); if (safeSpot != null) { // This next line should help players with long ping times - ((Player)sender).sendBlockChange(safeSpot,safeSpot.getBlock().getType(),safeSpot.getBlock().getData()); ((Player)sender).teleport(safeSpot); + //((Player)sender).sendBlockChange(safeSpot,safeSpot.getBlock().getType(),safeSpot.getBlock().getData()); } else { sender.sendMessage(ChatColor.RED + Locale.warpserrorNotSafe); Location warpSpot = plugin.getPlayers().getIslandLocation(playerUUID); diff --git a/src/com/wasteofplastic/askyblock/IslandCmd.java b/src/com/wasteofplastic/askyblock/IslandCmd.java index 21186ff9c..0847a703c 100644 --- a/src/com/wasteofplastic/askyblock/IslandCmd.java +++ b/src/com/wasteofplastic/askyblock/IslandCmd.java @@ -930,13 +930,15 @@ public void run() { // go to spawn //plugin.getLogger().info("Debug: getSpawn" + plugin.getSpawn().toString() ); //plugin.getLogger().info("Debug: getSpawn loc" + plugin.getSpawn().getSpawnLoc().toString() ); + player.teleport(plugin.getSpawn().getSpawnLoc()); + /* player.sendBlockChange(plugin.getSpawn().getSpawnLoc() ,plugin.getSpawn().getSpawnLoc().getBlock().getType() ,plugin.getSpawn().getSpawnLoc().getBlock().getData()); player.sendBlockChange(plugin.getSpawn().getSpawnLoc().getBlock().getRelative(BlockFace.DOWN).getLocation() ,plugin.getSpawn().getSpawnLoc().getBlock().getRelative(BlockFace.DOWN).getType() ,plugin.getSpawn().getSpawnLoc().getBlock().getRelative(BlockFace.DOWN).getData()); - player.teleport(plugin.getSpawn().getSpawnLoc()); + */ return true; } else if (split[0].equalsIgnoreCase("top")) { if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + "island.topten")) { @@ -1433,10 +1435,12 @@ public void run() { } else { // Just move target to spawn if (!target.performCommand(Settings.SPAWNCOMMAND)) { + target.teleport(player.getWorld().getSpawnLocation()); + /* target.sendBlockChange(target.getWorld().getSpawnLocation() ,target.getWorld().getSpawnLocation().getBlock().getType() ,target.getWorld().getSpawnLocation().getBlock().getData()); - target.teleport(player.getWorld().getSpawnLocation()); + */ } } target.sendMessage(ChatColor.RED + Locale.expelExpelled); diff --git a/src/com/wasteofplastic/askyblock/NetherPortals.java b/src/com/wasteofplastic/askyblock/NetherPortals.java index 46956a454..ab18b5eaa 100644 --- a/src/com/wasteofplastic/askyblock/NetherPortals.java +++ b/src/com/wasteofplastic/askyblock/NetherPortals.java @@ -128,8 +128,8 @@ public void onPlayerPortal(PlayerPortalEvent event) { event.setCancelled(true); Location end_place = plugin.getServer().getWorld(Settings.worldName + "_the_end").getSpawnLocation(); if (ASkyBlock.isSafeLocation(end_place)) { - event.getPlayer().sendBlockChange(end_place, end_place.getBlock().getType(),end_place.getBlock().getData()); event.getPlayer().teleport(end_place); + //event.getPlayer().sendBlockChange(end_place, end_place.getBlock().getType(),end_place.getBlock().getData()); return; } else { event.getPlayer().sendMessage(ChatColor.RED + Locale.warpserrorNotSafe);