Implemented optional specification of teleport causes

This should have backwards-compatibility for any users of the API but would require an update from anything reimplementing (for whatever reason) the interfaces amended by this commit.
This commit is contained in:
zombachu
2020-01-02 18:29:12 -10:00
parent 0f39df0e0b
commit 3aa554c52b
18 changed files with 81 additions and 28 deletions

View File

@ -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;
}