<commit_before>package info.tregmine.commands;

import java.sql.Connection;
import java.sql.SQLException;

import static org.bukkit.ChatColor.*;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.Location;
import org.bukkit.Chunk;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import info.tregmine.Tregmine;
import info.tregmine.database.ConnectionPool;
import info.tregmine.database.DBWarpDAO;
import info.tregmine.api.TregminePlayer;

public class WarpCommand extends AbstractCommand
{

    private static class WarpTask implements Runnable
    {
        private TregminePlayer player;
        private Location loc;

        public WarpTask(TregminePlayer player, Location loc)
        {
            this.player = player;
            this.loc = loc;
        }

        @Override
        public void run()
        {
            if (player.isAdmin()) {
                player.teleport(loc);
                PotionEffect ef =
                        new PotionEffect(PotionEffectType.BLINDNESS, 60, 100);
                player.addPotionEffect(ef);
                return;
            }

            World playerWorld = player.getWorld();
            String playerWorldName = playerWorld.getName();
            World locWorld = loc.getWorld();
            String locWorldName = locWorld.getName();

            if (playerWorldName.equalsIgnoreCase(locWorldName)) {
                player.teleport(loc);
            }
            else {
                player.sendMessage(RED + "You can't teleport between worlds.");
            }
        }
    }

    public WarpCommand(Tregmine tregmine)
    {
        super(tregmine, "warp");<commit_msg>When a player warps, their horses should follow.<commit_after>package info.tregmine.commands;

import java.sql.Connection;
import java.sql.SQLException;

import static org.bukkit.ChatColor.*;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.Location;
import org.bukkit.Chunk;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Horse;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import info.tregmine.Tregmine;
import info.tregmine.database.ConnectionPool;
import info.tregmine.database.DBWarpDAO;
import info.tregmine.api.TregminePlayer;

public class WarpCommand extends AbstractCommand
{

    private static class WarpTask implements Runnable
    {
        private TregminePlayer player;
        private Location loc;

        public WarpTask(TregminePlayer player, Location loc)
        {
            this.player = player;
            this.loc = loc;
        }

        @Override
        public void run()
        {
            if (player.isAdmin()) {
                player.teleport(loc);
                PotionEffect ef =
                        new PotionEffect(PotionEffectType.BLINDNESS, 60, 100);
                player.addPotionEffect(ef);
                return;
            }

            World playerWorld = player.getWorld();
            String playerWorldName = playerWorld.getName();
            World locWorld = loc.getWorld();
            String locWorldName = locWorld.getName();

            if (playerWorldName.equalsIgnoreCase(locWorldName)) {
            	for(Horse horse: player.getWorld().getEntitiesByClass(Horse.class)){
            		if((horse.isTamed()) && (horse.getOwner() == player.getDelegate())){
            			horse.teleport(loc);
            		}
            	}
                player.teleport(loc);
            }
            else {
                player.sendMessage(RED + "You can't teleport between worlds.");
            }
        }
    }

    public WarpCommand(Tregmine tregmine)
    {
        super(tregmine, "warp");
{'fraction_non_alphanumeric': 0.09164915966386554, 'fraction_numerical': 0.0026260504201680674, 'mean_word_length': 2.1847826086956523, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4928979', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1053, 'n_words': 215}