Don't prevent plugins from spawning creatures.

This commit is contained in:
Rigby 2011-06-30 20:45:04 +01:00
parent 2ff10d0882
commit 6858c878d3

View File

@ -10,6 +10,7 @@ import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
import org.bukkit.entity.Slime;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityListener;
@ -46,6 +47,11 @@ public class MVEntityListener extends EntityListener {
@Override
public void onCreatureSpawn(CreatureSpawnEvent event) {
// Check to see if the Creature is spawned by a plugin, we don't want to prevent this behaviour.
if (event.getSpawnReason() == SpawnReason.CUSTOM) {
return;
}
World world = event.getEntity().getWorld();
if (event.isCancelled())
return;