package com.devotedmc.ExilePearl.listener;

import com.devotedmc.ExilePearl.ExilePearlApi;
import com.github.maxopoly.artemis.events.PlayerAttemptLeaveShard;
import org.bukkit.event.EventHandler;
import org.bukkit.inventory.ItemStack;

public class ArtemisListener extends RuleListener {
	/**
	 * Creates a new ExileListener instance
	 *
	 * @param pearlApi The PearlApi instance
	 */
	public ArtemisListener(ExilePearlApi pearlApi) {
		super(pearlApi);
	}
	
	@EventHandler
	public void onPlayerShardTransfer(PlayerAttemptLeaveShard event) {
		if (pearlApi.isPlayerExiled(event.getPlayer())) {
			event.setCancelled(true);
			return;
		}

		for (ItemStack itemStack : event.getPlayer().getInventory()) {
			if (pearlApi.getPearlFromItemStack(itemStack) != null) {
				event.setCancelled(true);
				return;
			}
		}
	}
}

@@ -151,16 +151,45 @@
 eShard;%0A
+import org.bukkit.ChatColor;%0A
 import o
@@ -645,16 +645,114 @@
 (true);%0A
+%09%09%09event.getPlayer().sendMessage(ChatColor.RED + %22Exiled players cannot travel between shards.%22);%0A
 %09%09%09retur
@@ -914,16 +914,142 @@
 (true);%0A
+%09%09%09%09event.getPlayer().sendMessage(ChatColor.RED + %22You cannot carry pearls across shards! Store the pearl before retrying.%22);%0A
 %09%09%09%09retu

Add msgs