package io.github.aquerr.eaglefactions.listeners;

import io.github.aquerr.eaglefactions.EagleFactions;
import io.github.aquerr.eaglefactions.logic.FactionLogic;
import io.github.aquerr.eaglefactions.logic.MainLogic;
import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.entity.SpawnEntityEvent;
import org.spongepowered.api.world.World;

public class EntitySpawnListener
{
    @Listener
    public void onEntitySpawn(SpawnEntityEvent event)
    {
        for (Entity entity: event.getEntities())
        {
            if(entity instanceof Player)
            {

            }
            else
            {
                if(MainLogic.getMobSpawning() == false && FactionLogic.isClaimed(entity.getWorld().getUniqueId(), entity.getLocation().getChunkPosition()))
                {
                    event.setCancelled(true);
                    return;
                }
            }
        }
    }
}

@@ -254,16 +254,76 @@
 Entity;%0A
+import org.spongepowered.api.entity.living.monster.Monster;%0A
 import o
@@ -680,32 +680,115 @@
 es())%0A        %7B%0A
+            EagleFactions.getEagleFactions().getLogger().info(entity.toString());%0A%0A
             if(e
@@ -804,20 +804,21 @@
 tanceof 
-Play
+Monst
 er)%0A    
@@ -827,17 +827,16 @@
       %7B%0A
-%0A
         
@@ -843,40 +843,93 @@
     
-%7D%0A            else%0A            %7B
+    EagleFactions.getEagleFactions().getLogger().info(%22Entity is a monster!!!! :O%22);%0A
 %0A   
@@ -1197,32 +1197,261 @@
 %7D%0A            %7D%0A
+            else%0A            %7B%0A                EagleFactions.getEagleFactions().getLogger().info(%22Entity is not a monster. :D%22);%0A            %7D%0A%0A            //EntityType for CustomNPC (it counts as a monster) =%3E EntityCustomNpc%0A%0A%0A
         %7D%0A    %7D%0A

Comment on EntitySpawnListener for future work