mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Mob Spawner XP multiplier
This commit is contained in:
parent
5029ad9d93
commit
a05a0da9fb
@ -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())); }
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user