diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index 28dbeb489..f3cb64f26 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -276,7 +276,6 @@ public class Config extends AutoUpdateConfigLoader { */ /* General Settings */ - public boolean getExperienceGainsMobspawnersEnabled() { return config.getBoolean("Experience.Gains.Mobspawners.Enabled", false); } public boolean getExperienceGainsPlayerVersusPlayerEnabled() { return config.getBoolean("Experience.PVP.Rewards", true); } public double getExperienceGainsGlobalMultiplier() { return config.getDouble("Experience.Gains.Multiplier.Global", 1.0); } @@ -289,6 +288,8 @@ public class Config extends AutoUpdateConfigLoader { public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); } public double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); } + public double getSpawnedMobXpMultiplier() { return config.getDouble("Experience.Gains.MobSpawners.Multiplier", 0.0); } + /* XP Formula Multiplier */ public int getFormulaMultiplierCurve() { return config.getInt("Experience.Formula.Curve_Modifier", 20); } public double getForumulaMultiplier(SkillType skill) { return config.getDouble("Experience.Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); } diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 291a82fdf..8f5a8c2b5 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -309,10 +309,6 @@ public class EntityListener implements Listener { */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onCreatureSpawn(CreatureSpawnEvent event) { - if (Misc.isSpawnerXPEnabled) { - return; - } - switch (event.getSpawnReason()) { case SPAWNER: case SPAWNER_EGG: diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index bd6e3a83b..a082b9dbf 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -20,7 +20,6 @@ import com.gmail.nossr50.util.spout.SpoutUtils; public final class Misc { private static Random random = new Random(); - public static boolean isSpawnerXPEnabled = Config.getInstance().getExperienceGainsMobspawnersEnabled(); public static final int PLAYER_RESPAWN_COOLDOWN_SECONDS = 5; public static final int TIME_CONVERSION_FACTOR = 1000; public static final double SKILL_MESSAGE_MAX_SENDING_DISTANCE = 10.0; diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 552a50450..f99146d82 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -445,7 +445,7 @@ public final class CombatUtils { baseXP = 20 * Config.getInstance().getPlayerVersusPlayerXP(); } } - else if (!target.hasMetadata(mcMMO.entityMetadataKey)) { + else { if (target instanceof Animals) { if (ModUtils.isCustomEntity(target)) { baseXP = ModUtils.getCustomEntity(target).getXpMultiplier(); @@ -505,6 +505,10 @@ public final class CombatUtils { } break; } + + if (target.hasMetadata(mcMMO.entityMetadataKey)) { + baseXP *= Config.getInstance().getSpawnedMobXpMultiplier(); + } } baseXP *= 10; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 47b5a3531..81526c88e 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -277,8 +277,9 @@ Double_Drops: ### Experience: Gains: + # Experience gained from mobs not naturally spawned will get multiplied by this value. 0 by default. Mobspawners: - Enabled: false + Multiplier: 0 # Experience gained in every skill will get multiplied by this value. 1.0 by default, 2.0 means two times as much Multiplier: