mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Fixes #93
This commit is contained in:
parent
101cd6b114
commit
d958f57375
@ -575,10 +575,11 @@ import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
|||||||
* @return true if successful
|
* @return true if successful
|
||||||
*/
|
*/
|
||||||
public static boolean teleportPlayer(final Player player, final Location from, final Plot plot) {
|
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);
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled()) {
|
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)) {
|
if ((location.getBlockX() >= 29999999) || (location.getBlockX() <= -29999999) || (location.getBlockZ() >= 299999999) || (location.getBlockZ() <= -29999999)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return false;
|
return false;
|
||||||
|
@ -65,7 +65,7 @@ public class Home extends SubCommand {
|
|||||||
if ((temp = isAlias(args[0])) != null) {
|
if ((temp = isAlias(args[0])) != null) {
|
||||||
if (temp.hasOwner()) {
|
if (temp.hasOwner()) {
|
||||||
if (temp.getOwner().equals(UUIDHandler.getUUID(plr))) {
|
if (temp.getOwner().equals(UUIDHandler.getUUID(plr))) {
|
||||||
PlotMain.teleportPlayer(plr, plr.getLocation(), temp);
|
teleportPlayer(plr, temp);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,11 +79,16 @@ public class Home extends SubCommand {
|
|||||||
PlayerFunctions.sendMessage(plr, C.NOT_VALID_NUMBER);
|
PlayerFunctions.sendMessage(plr, C.NOT_VALID_NUMBER);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PlotMain.teleportPlayer(plr, plr.getLocation(), plots[id - 1]);
|
teleportPlayer(plr, plots[id - 1]);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOTS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOTS);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void teleportPlayer(Player player, Plot plot) {
|
||||||
|
PlotMain.teleportPlayer(player, player.getLocation(), plot);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,6 @@ public abstract class PlotWorld {
|
|||||||
public final static boolean WORLD_BORDER_DEFAULT = false;
|
public final static boolean WORLD_BORDER_DEFAULT = false;
|
||||||
// TODO make this configurable
|
// TODO make this configurable
|
||||||
// make non static and static_default_valu + add config option
|
// make non static and static_default_valu + add config option
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public static List<Material> BLOCKS; /*
|
public static List<Material> BLOCKS; /*
|
||||||
* =
|
* =
|
||||||
* new
|
* new
|
||||||
@ -258,7 +257,6 @@ public abstract class PlotWorld {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// TODO: Let jesse decide if this is stupid or not
|
|
||||||
BLOCKS = new ArrayList<>();
|
BLOCKS = new ArrayList<>();
|
||||||
for (final Material material : Material.values()) {
|
for (final Material material : Material.values()) {
|
||||||
if (material.isBlock() && material.isSolid() && !material.hasGravity() && !material.isTransparent() && material.isOccluding() && (material != Material.DROPPER)) {
|
if (material.isBlock() && material.isSolid() && !material.hasGravity() && !material.isTransparent() && material.isOccluding() && (material != Material.DROPPER)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user