From d0e7e1bbb5632d6e7d4d901481972106ddc0f004 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 3 Apr 2012 11:51:33 -0400 Subject: [PATCH] Added check for mobs spawning from Spawner Eggs to deny XP from spawners. --- .../java/com/gmail/nossr50/listeners/mcEntityListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java index efb74b449..0f0f64119 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java @@ -163,7 +163,9 @@ public class mcEntityListener implements Listener { */ @EventHandler (priority = EventPriority.MONITOR) public void onCreatureSpawn(CreatureSpawnEvent event) { - if (event.getSpawnReason().equals(SpawnReason.SPAWNER) && !LoadProperties.xpGainsMobSpawners) { + SpawnReason reason = event.getSpawnReason(); + + if ((reason.equals(SpawnReason.SPAWNER) || reason.equals(SpawnReason.SPAWNER_EGG)) && !LoadProperties.xpGainsMobSpawners) { event.getEntity().setMetadata("mcmmoFromMobSpawner", new FixedMetadataValue(plugin, true)); } }