diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java index 08313addf..f59c2e29e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/object/BukkitPlayer.java @@ -1,11 +1,14 @@ package com.github.intellectualsites.plotsquared.bukkit.object; +import com.github.intellectualsites.plotsquared.bukkit.util.BukkitEventUtil; import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.EconHandler; +import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; import com.github.intellectualsites.plotsquared.plot.util.StringMan; @@ -193,13 +196,13 @@ public class BukkitPlayer extends PlotPlayer { } } - @Override public void teleport(@NotNull final Location location) { + @Override public void teleport(@NotNull final Location location, @NotNull final TeleportCause cause) { if (Math.abs(location.getX()) >= 30000000 || Math.abs(location.getZ()) >= 30000000) { return; } final org.bukkit.Location bukkitLocation = new org.bukkit.Location(BukkitUtil.getWorld(location.getWorld()), location.getX() + 0.5, location.getY(), location.getZ() + 0.5, location.getYaw(), location.getPitch()); - PaperLib.teleportAsync(player, bukkitLocation, PlayerTeleportEvent.TeleportCause.COMMAND); + PaperLib.teleportAsync(player, bukkitLocation, ((BukkitEventUtil) EventUtil.manager).getTeleportCause(cause)); } @Override public String getName() { diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java index 25ca0e16e..e76a1e23e 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitEventUtil.java @@ -25,11 +25,13 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Rating; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; +import org.bukkit.event.player.PlayerTeleportEvent; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -130,4 +132,14 @@ public final class BukkitEventUtil extends EventUtil { } return event.getRating(); } + + public PlayerTeleportEvent.TeleportCause getTeleportCause(@NotNull final TeleportCause cause) { + switch (cause) { + case COMMAND: + return PlayerTeleportEvent.TeleportCause.COMMAND; + case PLUGIN: + return PlayerTeleportEvent.TeleportCause.PLUGIN; + default: return PlayerTeleportEvent.TeleportCause.UNKNOWN; + } + } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java index e21c82f7f..2a9195028 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java @@ -15,6 +15,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; import com.github.intellectualsites.plotsquared.plot.object.SetupObject; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; import com.github.intellectualsites.plotsquared.plot.util.CmdConfirm; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; @@ -134,7 +135,7 @@ import java.util.Set; if (WorldUtil.IMP.isWorld(world)) { PlotSquared.get().loadWorld(world, null); Captions.SETUP_FINISHED.send(player); - player.teleport(WorldUtil.IMP.getSpawn(world)); + player.teleport(WorldUtil.IMP.getSpawn(world), TeleportCause.COMMAND); if (area.TERRAIN != 3) { ChunkManager.largeRegionTask(world, region, new RunnableVal() { @@ -257,7 +258,7 @@ import java.util.Set; String world = SetupUtils.manager.setupWorld(object); if (WorldUtil.IMP.isWorld(world)) { Captions.SETUP_FINISHED.send(player); - player.teleport(WorldUtil.IMP.getSpawn(world)); + player.teleport(WorldUtil.IMP.getSpawn(world), TeleportCause.COMMAND); } else { MainUtil.sendMessage(player, "An error occurred while creating the world: " @@ -284,13 +285,13 @@ import java.util.Set; } if (WorldUtil.IMP.isWorld(pa.worldname)) { if (!player.getLocation().getWorld().equals(pa.worldname)) { - player.teleport(WorldUtil.IMP.getSpawn(pa.worldname)); + player.teleport(WorldUtil.IMP.getSpawn(pa.worldname), TeleportCause.COMMAND); } } else { object.terrain = 0; object.type = 0; SetupUtils.manager.setupWorld(object); - player.teleport(WorldUtil.IMP.getSpawn(pa.worldname)); + player.teleport(WorldUtil.IMP.getSpawn(pa.worldname), TeleportCause.COMMAND); } player.setMeta("area_create_area", pa); MainUtil.sendMessage(player, @@ -468,7 +469,7 @@ import java.util.Set; center.setY(1 + WorldUtil.IMP .getHighestBlock(area.worldname, center.getX(), center.getZ())); } - player.teleport(center); + player.teleport(center, TeleportCause.COMMAND); return true; case "delete": case "remove": diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java index d3148370c..294e4668a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java @@ -12,6 +12,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; @@ -82,7 +83,7 @@ public class Auto extends SubCommand { final String schematic) { Set plots = player.getPlots(); if (!plots.isEmpty()) { - plots.iterator().next().teleportPlayer(player); + plots.iterator().next().teleportPlayer(player, TeleportCause.COMMAND); } else { autoClaimSafe(player, area, start, schematic); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java index 088273c9c..f1f9a401c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java @@ -12,6 +12,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotCluster; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; @@ -551,7 +552,7 @@ import java.util.UUID; return false; } } - player.teleport(cluster.getHome()); + player.teleport(cluster.getHome(), TeleportCause.COMMAND); return MainUtil.sendMessage(player, Captions.CLUSTER_TELEPORTING); } case "i": diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java index 378da26c2..bf6162769 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java @@ -9,6 +9,7 @@ import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Rating; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; @@ -42,7 +43,7 @@ import java.util.UUID; for (final Plot plot : plots) { if ((!Settings.Done.REQUIRED_FOR_RATINGS || plot.hasFlag(Flags.DONE)) && plot.isBasePlot() && (!plot.getLikes().containsKey(uuid))) { - plot.teleportPlayer(player); + plot.teleportPlayer(player, TeleportCause.COMMAND); MainUtil.sendMessage(player, Captions.RATE_THIS); return true; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java index f3acaf5a0..95e07f9cd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java @@ -5,6 +5,7 @@ import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; /** * @author manuelgu, altered by Citymonstret @@ -20,7 +21,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; if (plot == null) { return sendMessage(player, Captions.NOT_IN_PLOT); } - player.teleport(plot.getCenter()); + player.teleport(plot.getCenter(), TeleportCause.COMMAND); return true; } } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java index f81f02719..603433b7f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java @@ -12,6 +12,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotInventory; import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.Rating; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.EventUtil; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -55,7 +56,7 @@ import java.util.UUID; if ((!Settings.Done.REQUIRED_FOR_RATINGS || p.hasFlag(Flags.DONE)) && p .isBasePlot() && (!p.getRatings().containsKey(uuid)) && !p .isAdded(uuid)) { - p.teleportPlayer(player); + p.teleportPlayer(player, TeleportCause.COMMAND); MainUtil.sendMessage(player, Captions.RATE_THIS); return true; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java index eb7826ee5..8b8b22653 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java @@ -11,6 +11,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotMessage; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.SetupObject; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; import com.github.intellectualsites.plotsquared.plot.util.StringMan; @@ -325,7 +326,7 @@ import java.util.UUID; world = object.setupManager.setupWorld(object); } try { - player.teleport(WorldUtil.IMP.getSpawn(world)); + player.teleport(WorldUtil.IMP.getSpawn(world), TeleportCause.COMMAND); } catch (Exception e) { player.sendMessage("&cAn error occurred. See console for more information"); e.printStackTrace(); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java index 85a0fe633..d001388ea 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java @@ -13,6 +13,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.SetupObject; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.SetupUtils; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; @@ -167,7 +168,7 @@ import java.util.zip.ZipOutputStream; SetupUtils.manager.setupWorld(setup); GlobalBlockQueue.IMP.addEmptyTask(() -> { MainUtil.sendMessage(player, "Done!"); - player.teleport(WorldUtil.IMP.getSpawn(world)); + player.teleport(WorldUtil.IMP.getSpawn(world), TeleportCause.COMMAND); }); return true; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java index e2b7fa382..5a1056811 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java @@ -11,6 +11,7 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.Permissions; @@ -145,7 +146,7 @@ import java.util.concurrent.CompletableFuture; } } confirm.run(this, () -> { - if (plot.teleportPlayer(player)) { + if (plot.teleportPlayer(player, TeleportCause.COMMAND)) { whenDone.run(Visit.this, CommandResult.SUCCESS); } else { whenDone.run(Visit.this, CommandResult.FAILURE); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java index d22e23a7e..93b451b3f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java @@ -78,7 +78,7 @@ public class ConsolePlayer extends PlotPlayer { PlotSquared.log(message); } - @Override public void teleport(Location location) { + @Override public void teleport(Location location, TeleportCause cause) { setMeta(PlotPlayer.META_LAST_PLOT, location.getPlot()); setMeta(PlotPlayer.META_LOCATION, location); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index 5308e620a..27b16d5a3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -1524,7 +1524,7 @@ public class Plot { setSign(player.getName()); MainUtil.sendMessage(player, Captions.CLAIMED); if (teleport && Settings.Teleport.ON_CLAIM) { - teleportPlayer(player); + teleportPlayer(player, TeleportCause.COMMAND); } PlotArea plotworld = getArea(); if (plotworld.SCHEMATIC_ON_CLAIM) { @@ -2809,6 +2809,17 @@ public class Plot { * @return if the teleport succeeded */ public boolean teleportPlayer(final PlotPlayer player) { + return teleportPlayer(player, TeleportCause.PLUGIN); + } + + /** + * Teleport a player to a plot and send them the teleport message. + * + * @param player the player + * @param cause the cause of the teleport + * @return if the teleport succeeded + */ + public boolean teleportPlayer(final PlotPlayer player, TeleportCause cause) { Plot plot = this.getBasePlot(false); boolean result = EventUtil.manager.callTeleport(player, player.getLocation(), plot); if (result) { @@ -2818,14 +2829,12 @@ public class Plot { } else { location = this.getDefaultHome(false); } - if (Settings.Teleport.DELAY == 0 || Permissions - .hasPermission(player, "plots.teleport.delay.bypass")) { + if (Settings.Teleport.DELAY == 0 || Permissions.hasPermission(player, "plots.teleport.delay.bypass")) { MainUtil.sendMessage(player, Captions.TELEPORTED_TO_PLOT); - player.teleport(location); + player.teleport(location, cause); return true; } - MainUtil - .sendMessage(player, Captions.TELEPORT_IN_SECONDS, Settings.Teleport.DELAY + ""); + MainUtil.sendMessage(player, Captions.TELEPORT_IN_SECONDS, Settings.Teleport.DELAY + ""); final String name = player.getName(); TaskManager.TELEPORT_QUEUE.add(name); TaskManager.runTaskLater(() -> { @@ -2836,7 +2845,7 @@ public class Plot { TaskManager.TELEPORT_QUEUE.remove(name); if (player.isOnline()) { MainUtil.sendMessage(player, Captions.TELEPORTED_TO_PLOT); - player.teleport(location); + player.teleport(location, cause); } }, Settings.Teleport.DELAY * 20); return true; diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java index 059f20559..443a93f5b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java @@ -373,7 +373,17 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer { * * @param location the target location */ - public abstract void teleport(Location location); + public void teleport(Location location) { + teleport(location, TeleportCause.PLUGIN); + } + + /** + * Teleport this player to a location. + * + * @param location the target location + * @param cause the cause of the teleport + */ + public abstract void teleport(Location location, TeleportCause cause); /** * Kick this player to a location diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/TeleportCause.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/TeleportCause.java new file mode 100644 index 000000000..af919e1ba --- /dev/null +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/TeleportCause.java @@ -0,0 +1,7 @@ +package com.github.intellectualsites.plotsquared.plot.object; + +public enum TeleportCause { + COMMAND, + PLUGIN, + UNKNOWN +} diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java index 1a8c88b9f..b143b755b 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlot.java @@ -8,6 +8,7 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotId; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import org.jetbrains.annotations.NotNull; @@ -50,9 +51,9 @@ public class SinglePlot extends Plot { return (SinglePlotArea) super.getArea(); } - public boolean teleportPlayer(final PlotPlayer player) { + public boolean teleportPlayer(final PlotPlayer player, TeleportCause cause) { if (isLoaded()) { - return super.teleportPlayer(player); + return super.teleportPlayer(player, cause); } else { Captions.NOT_LOADED.send(player); return false; diff --git a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/object/NukkitPlayer.java b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/object/NukkitPlayer.java index f53213d69..5fffa92d5 100644 --- a/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/object/NukkitPlayer.java +++ b/Nukkit/src/main/java/com/github/intellectualsites/plotsquared/nukkit/object/NukkitPlayer.java @@ -10,6 +10,7 @@ import com.github.intellectualsites.plotsquared.nukkit.util.NukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import java.util.Collections; import java.util.UUID; @@ -107,7 +108,7 @@ public class NukkitPlayer extends PlotPlayer { } } - @Override public void teleport(Location to) { + @Override public void teleport(Location to, TeleportCause cause) { if (Math.abs(to.getX()) >= 30000000 || Math.abs(to.getZ()) >= 30000000) { return; } diff --git a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/object/SpongePlayer.java b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/object/SpongePlayer.java index 150fe44cd..1a0879b21 100644 --- a/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/object/SpongePlayer.java +++ b/Sponge/src/main/java/com/github/intellectualsites/plotsquared/sponge/object/SpongePlayer.java @@ -5,6 +5,7 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; +import com.github.intellectualsites.plotsquared.plot.object.TeleportCause; import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode; import com.github.intellectualsites.plotsquared.plot.util.PlotWeather; import com.github.intellectualsites.plotsquared.plot.util.StringMan; @@ -85,7 +86,7 @@ public class SpongePlayer extends PlotPlayer { } } - @Override public void teleport(Location location) { + @Override public void teleport(Location location, TeleportCause cause) { if ((Math.abs(location.getX()) >= 30000000) || (Math.abs(location.getZ()) >= 30000000)) { return; }