@Override
    public void run() {
        for (Player player : main.getServer().getOnlinePlayers()) {
            if (player.getLocation().getX() < -main.radius) {
                Location target = player.getLocation().clone();
                target.setX(-main.radius);

                if (player.isInsideVehicle()) {
                    Entity vehicle = player.getVehicle();
                    player.leaveVehicle();
                    vehicle.teleport(target);
                    player.teleport(target);
                    vehicle.setPassenger(player);
                } else {
                    player.teleport(target);
                }

                player.sendMessage("You cannot go further.");
            }
            if (player.getLocation().getX() > main.radius) {
                Location target = player.getLocation().clone();
                target.setX(main.radius);

                if (player.isInsideVehicle()) {
                    Entity vehicle = player.getVehicle();
                    player.leaveVehicle();
                    vehicle.teleport(target);
                    player.teleport(target);
                    vehicle.setPassenger(player);
                } else {
                    player.teleport(target);
                }

                player.sendMessage("You cannot go further.");
            }
            if (player.getLocation().getZ() > main.radius) {
                Location target = player.getLocation().clone();
                target.setZ(main.radius);

                if (player.isInsideVehicle()) {
                    Entity vehicle = player.getVehicle();
                    player.leaveVehicle();
                    vehicle.teleport(target);
                    player.teleport(target);
                    vehicle.setPassenger(player);
                } else {
                    player.teleport(target);
                }

                player.sendMessage("You cannot go further.");
            }
            if (player.getLocation().getZ() < -main.radius) {
                Location target = player.getLocation().clone();
                target.setZ(-main.radius);

                if (player.isInsideVehicle()) {
                    Entity vehicle = player.getVehicle();
                    player.leaveVehicle();
                    vehicle.teleport(target);
                    player.teleport(target);
                    vehicle.setPassenger(player);
                } else {
                    player.teleport(target);
                }

                player.sendMessage("You cannot go further.");
            }
        }
    }