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.monster.Monster;
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())
        {
            EagleFactions.getEagleFactions().getLogger().info(entity.toString());

            if(entity instanceof Monster)
            {
                EagleFactions.getEagleFactions().getLogger().info("Entity is a monster!!!! :O");

                if(MainLogic.getMobSpawning() == false && FactionLogic.isClaimed(entity.getWorld().getUniqueId(), entity.getLocation().getChunkPosition()))
                {
                    event.setCancelled(true);
                    return;
                }
            }
            else
            {
                EagleFactions.getEagleFactions().getLogger().info("Entity is not a monster. :D");
            }

            //EntityType for CustomNPC (it counts as a monster) => EntityCustomNpc


        }
    }
}

@@ -254,16 +254,65 @@
 Entity;%0A
+import org.spongepowered.api.entity.EntityTypes;%0A
 import o
@@ -359,24 +359,24 @@
 er.Monster;%0A
-
 import org.s
@@ -973,16 +973,262 @@
 ! :O%22);%0A
+                EagleFactions.getEagleFactions().getLogger().info(%22Printing enity type: %22 + entity.getType().toString());%0A                EagleFactions.getEagleFactions().getLogger().info(%22Prining spawn couse: %22 + event.getCause().toString());%0A%0A%0A
 %0A       
@@ -1523,32 +1523,32 @@
 e%0A            %7B%0A
-
                 
@@ -1625,24 +1625,268 @@
 ster. :D%22);%0A
+                EagleFactions.getEagleFactions().getLogger().info(%22Printing enity type: %22 + entity.getType().toString());%0A                EagleFactions.getEagleFactions().getLogger().info(%22Prining spawn couse: %22 + event.getCause().toString());%0A
             

Add two more checks for future work