Created
January 30, 2014 01:02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler(priority = EventPriority.HIGH) | |
public void zombieIsMasterRace(CreatureSpawnEvent e) { | |
if (e.getEntityType() == EntityType.ZOMBIE) { // convert ALL zombies in ALL worlds | |
if (ZombieSpawner.getSurvivorsZombie((Zombie) e.getEntity()) == null) { | |
e.setCancelled(true); | |
ZombieSpawner.spawnLeveledZombie(e.getLocation()); | |
} | |
return; | |
} | |
final Entity entity = e.getEntity(); | |
if (!RUtils.isInInfectedWorld(entity)) return; // abnormal monster spawn only in infected worlds | |
if (!(entity instanceof Monster) && !(entity instanceof Slime)) return; | |
e.setCancelled(true); | |
ZombieSpawner.spawnLeveledZombie(e.getLocation()); | |
} | |
@EventHandler(priority = EventPriority.HIGHEST) | |
public void noVanillaZombiesWhatsoever(CreatureSpawnEvent e) { | |
if (e.getEntityType() != EntityType.ZOMBIE) return; | |
if (ZombieSpawner.getSurvivorsZombie((Zombie) e.getEntity()) != null) return; | |
e.setCancelled(true); | |
System.out.println("Blocked a vanilla zombie from spawning. This is a bug."); // fires whenever a zombie is spawned manually via command but not by egg | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment