Mob Spawner XP multiplier

This commit is contained in:
T00thpick1 2013-05-15 00:31:00 -04:00
parent 5029ad9d93
commit a05a0da9fb
5 changed files with 9 additions and 8 deletions

View File

@ -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())); }

View File

@ -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:

View File

@ -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;

View File

@ -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;

View File

@ -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: