mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 11:13:45 +01:00 
			
		
		
		
	Prevent loading faraway chunks (#4370)
* Prevent loading faraway chunks * docs
This commit is contained in:
		@@ -32,6 +32,7 @@ import com.plotsquared.core.plot.PlotWeather;
 | 
			
		||||
import com.plotsquared.core.plot.world.PlotAreaManager;
 | 
			
		||||
import com.plotsquared.core.util.EventDispatcher;
 | 
			
		||||
import com.plotsquared.core.util.MathMan;
 | 
			
		||||
import com.plotsquared.core.util.WorldUtil;
 | 
			
		||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
 | 
			
		||||
import com.sk89q.worldedit.extension.platform.Actor;
 | 
			
		||||
import com.sk89q.worldedit.world.item.ItemType;
 | 
			
		||||
@@ -120,6 +121,9 @@ public class BukkitPlayer extends PlotPlayer<Player> {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean canTeleport(final @NonNull Location location) {
 | 
			
		||||
        if (!WorldUtil.isValidLocation(location)) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        final org.bukkit.Location to = BukkitUtil.adapt(location);
 | 
			
		||||
        final org.bukkit.Location from = player.getLocation();
 | 
			
		||||
        PlayerTeleportEvent event = new PlayerTeleportEvent(player, from, to);
 | 
			
		||||
@@ -221,7 +225,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void teleport(final @NonNull Location location, final @NonNull TeleportCause cause) {
 | 
			
		||||
        if (Math.abs(location.getX()) >= 30000000 || Math.abs(location.getZ()) >= 30000000) {
 | 
			
		||||
        if (!WorldUtil.isValidLocation(location)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        final org.bukkit.Location bukkitLocation =
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user