mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-02 16:59:56 +01:00
Don't prevent plugins from spawning creatures.
This commit is contained in:
parent
2ff10d0882
commit
6858c878d3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user