<commit_before>package com.arckenver.nations.listener;

import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.entity.DisplaceEntityEvent;
import org.spongepowered.api.event.filter.cause.First;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.format.TextColors;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;

import com.arckenver.nations.ConfigHandler;
import com.arckenver.nations.DataHandler;
import com.arckenver.nations.LanguageHandler;
import com.arckenver.nations.Utils;
import com.arckenver.nations.object.Nation;
import com.arckenver.nations.object.Zone;

public class PlayerMoveListener
{
	@Listener
	public void onPlayerMove(DisplaceEntityEvent.TargetPlayer event, @First Player player)
	{
		if (event.getFromTransform().getLocation().getBlockX() == event.getToTransform().getLocation().getBlockX() && 
	            event.getFromTransform().getLocation().getBlockZ() == event.getToTransform().getLocation().getBlockZ())
	    {
	        return;
	    }
		if (!ConfigHandler.getNode("worlds").getNode(event.getToTransform().getExtent().getName()).getNode("enabled").getBoolean())
		{
			return;
		}
		
		Location<World> loc = event.getToTransform().getLocation();
		Nation nation = DataHandler.getNation(loc);
		Nation lastNationWalkedOn = DataHandler.getLastNationWalkedOn(player.getUniqueId());
		Zone zone = null;
		if (nation != null)
		{
			zone = nation.getZone(loc);
		}
		Zone lastZoneWalkedOn = DataHandler.getLastZoneWalkedOn(player.getUniqueId());
		if ((nation == null && lastNationWalkedOn == null) || (nation != null && lastNationWalkedOn != null && nation.getUUID().equals(lastNationWalkedOn.getUUID())))
		{
			if ((zone == null && lastZoneWalkedOn == null) || (zone != null && lastZoneWalkedOn != null && zone.getUUID().equals(lastZoneWalkedOn.getUUID())))
			{
				return;
			}
		}
		DataHandler.setLastNationWalkedOn(player.getUniqueId(), nation);
		DataHandler.setLastZoneWalkedOn(player.getUniqueId(), zone);
		
		Text.Builder builder = Text.builder("~ ").color(TextColors.GRAY);
		
		builder.append((nation == null) ? Text.of(TextColors.DARK_GREEN, LanguageHandler.IA) : Utils.nationClickable(TextColors.DARK_AQUA, nation.getName()));
		builder.append(Text.of(TextColors.GRAY, " - "));
		if (zone != null)
		{
			builder.append(Utils.zoneClickable(TextColors.GREEN, zone.getName()));
			if (zone.isForSale())
			{
				builder.append(
						Text.of(TextColors.GRAY, " - "),
						Text.of(TextColors.YELLOW, "["),
						Utils.formatPrice(TextColors.YELLOW, zone.getPrice()),
						Text.of(TextColors.YELLOW, "]")
				);
			}
			builder.append(Text.of(TextColors.GRAY, " - "));
		}
		boolean isPvp = ConfigHandler.getNode("flags").getNode("wilderness").getNode("pvp").getBoolean();
		if (nation != null)
		{
			isPvp = nation.getFlag("pvp");
			if (zone != null)
			{
				isPvp = zone.getFlag("pvp");
			}
		}
		builder.append((isPvp) ? Text.of(TextColors.DARK_RED, "(PvP)") : Text.of(TextColors.DARK_GREEN, "(No PvP)"));
		builder.append(Text.of(TextColors.GRAY, " ~"));
		
		player.sendMessage(builder.build());
	}
}<commit_msg>Fixed bad displaying<commit_after>package com.arckenver.nations.listener;

import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.entity.DisplaceEntityEvent;
import org.spongepowered.api.event.filter.cause.First;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.format.TextColors;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;

import com.arckenver.nations.ConfigHandler;
import com.arckenver.nations.DataHandler;
import com.arckenver.nations.LanguageHandler;
import com.arckenver.nations.Utils;
import com.arckenver.nations.object.Nation;
import com.arckenver.nations.object.Zone;

public class PlayerMoveListener
{
	@Listener
	public void onPlayerMove(DisplaceEntityEvent.TargetPlayer event, @First Player player)
	{
		if (event.getFromTransform().getLocation().getBlockX() == event.getToTransform().getLocation().getBlockX() && 
	            event.getFromTransform().getLocation().getBlockZ() == event.getToTransform().getLocation().getBlockZ())
	    {
	        return;
	    }
		if (!ConfigHandler.getNode("worlds").getNode(event.getToTransform().getExtent().getName()).getNode("enabled").getBoolean())
		{
			return;
		}
		
		Location<World> loc = event.getToTransform().getLocation();
		Nation nation = DataHandler.getNation(loc);
		Nation lastNationWalkedOn = DataHandler.getLastNationWalkedOn(player.getUniqueId());
		Zone zone = null;
		if (nation != null)
		{
			zone = nation.getZone(loc);
		}
		Zone lastZoneWalkedOn = DataHandler.getLastZoneWalkedOn(player.getUniqueId());
		if ((nation == null && lastNationWalkedOn == null) || (nation != null && lastNationWalkedOn != null && nation.getUUID().equals(lastNationWalkedOn.getUUID())))
		{
			if ((zone == null && lastZoneWalkedOn == null) || (zone != null && lastZoneWalkedOn != null && zone.getUUID().equals(lastZoneWalkedOn.getUUID())))
			{
				return;
			}
		}
		DataHandler.setLastNationWalkedOn(player.getUniqueId(), nation);
		DataHandler.setLastZoneWalkedOn(player.getUniqueId(), zone);
		
		Text.Builder builder = Text.builder("~ ").color(TextColors.GRAY);
		
		builder.append((nation == null) ? Text.of(TextColors.DARK_GREEN, LanguageHandler.IA) : Utils.nationClickable(TextColors.DARK_AQUA, nation.getName()));
		builder.append(Text.of(TextColors.GRAY, " - "));
		if (zone != null)
		{
			builder.append(Utils.zoneClickable(TextColors.GREEN, zone.getName()));
			if (zone.isForSale())
			{
				builder.append(
						Text.of(TextColors.GRAY, " - "),
						Text.of(TextColors.YELLOW, "["),
						Utils.formatPrice(TextColors.YELLOW, zone.getPrice()),
						Text.of(TextColors.YELLOW, "]")
				);
			}
			builder.append(Text.of(TextColors.GRAY, " - "));
		}
		
		builder.append((DataHandler.getFlag("pvp", loc)) ? Text.of(TextColors.DARK_RED, "(PvP)") : Text.of(TextColors.DARK_GREEN, "(No PvP)"));
		builder.append(Text.of(TextColors.GRAY, " ~"));
		
		player.sendMessage(builder.build());
	}
}
{'fraction_non_alphanumeric': 0.15760694757156643, 'fraction_numerical': 0.0, 'mean_word_length': 4.8013059701492535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2654099', 'n_tokens_mistral': 2300, 'n_tokens_neox': 2126, 'n_words': 272}