package com.arckenver.nations.listener;


import org.spongepowered.api.entity.EntityType;
import org.spongepowered.api.entity.EntityTypes;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.entity.SpawnEntityEvent;

import com.arckenver.nations.ConfigHandler;
import com.arckenver.nations.DataHandler;
import com.google.common.collect.ImmutableList;


public class MobSpawningListener
{
	ImmutableList<EntityType> agressiveMobs = new ImmutableList.Builder<EntityType>()
			.add(EntityTypes.BLAZE)
			.add(EntityTypes.CAVE_SPIDER)
			.add(EntityTypes.CREEPER)
			.add(EntityTypes.ENDER_DRAGON)
			.add(EntityTypes.ENDERMAN)
			.add(EntityTypes.ENDERMITE)
			.add(EntityTypes.GHAST)
			.add(EntityTypes.GIANT)
			.add(EntityTypes.GUARDIAN)
			.add(EntityTypes.MAGMA_CUBE)
			.add(EntityTypes.PIG_ZOMBIE)
			.add(EntityTypes.SKELETON)
			.add(EntityTypes.SILVERFISH)
			.add(EntityTypes.SLIME)
			.add(EntityTypes.SPIDER)
			.add(EntityTypes.WITCH)
			.add(EntityTypes.WITHER)
			.add(EntityTypes.WITHER_SKULL)
			.add(EntityTypes.ZOMBIE)
			.build();
	
	@Listener
	public void onPlayerRightClick(SpawnEntityEvent event)
	{
		if (!ConfigHandler.getNode("worlds").getNode(event.getTargetWorld().getName()).getNode("enabled").getBoolean())
		{
			return;
		}
		event.filterEntities(e -> !agressiveMobs.contains(e.getType()) || DataHandler.getFlag("mobs", e.getLocation()));
	}
}

@@ -75,67 +75,30 @@
 ity.
-EntityType;%0Aimport org.spongepowered.api.entity.EntityTypes
+living.monster.Monster
 ;%0Aim
@@ -291,756 +291,44 @@
 er;%0A
-import com.google.common.collect.ImmutableList;%0A%0A%0Apublic class MobSpawningListener%0A%7B%0A%09ImmutableList%3CEntityType%3E agressiveMobs = new ImmutableList.Builder%3CEntityType%3E()%0A%09%09%09.add(EntityTypes.BLAZE)%0A%09%09%09.add(EntityTypes.CAVE_SPIDER)%0A%09%09%09.add(EntityTypes.CREEPER)%0A%09%09%09.add(EntityTypes.ENDER_DRAGON)%0A%09%09%09.add(EntityTypes.ENDERMAN)%0A%09%09%09.add(EntityTypes.ENDERMITE)%0A%09%09%09.add(EntityTypes.GHAST)%0A%09%09%09.add(EntityTypes.GIANT)%0A%09%09%09.add(EntityTypes.GUARDIAN)%0A%09%09%09.add(EntityTypes.MAGMA_CUBE)%0A%09%09%09.add(EntityTypes.PIG_ZOMBIE)%0A%09%09%09.add(EntityTypes.SKELETON)%0A%09%09%09.add(EntityTypes.SILVERFISH)%0A%09%09%09.add(EntityTypes.SLIME)%0A%09%09%09.add(EntityTypes.SPIDER)%0A%09%09%09.add(EntityTypes.WITCH)%0A%09%09%09.add(EntityTypes.WITHER)%0A%09%09%09.add(EntityTypes.WITHER_SKULL)%0A%09%09%09.add(EntityTypes.ZOMBIE)%0A%09%09%09.build();%0A%09
+%0A%0Apublic class MobSpawningListener%0A%7B
 %0A%09@L
@@ -354,24 +354,19 @@
 d on
-PlayerRightClick
+EntitySpawn
 (Spa
@@ -555,42 +555,29 @@
 -%3E !
-agressiveMobs.contains(e.getType()
+(e instanceof Monster
 ) %7C%7C

Extend spawn prevention to all hostile mobs (should take hostile mobs from mods into account)