add xpPerBeneficialEffect config option
This commit is contained in:
@@ -66,6 +66,7 @@ public final class AscendAdvancements {
|
||||
if (AscendConfig.COMMON.xpPerDamageTaken.get() != 2) changed++;
|
||||
if (AscendConfig.COMMON.xpPerMovement.get() != 1) changed++;
|
||||
if (AscendConfig.COMMON.xpPerPotion.get() != 3) changed++;
|
||||
if (AscendConfig.COMMON.xpPerBeneficialEffect.get() != 2) changed++;
|
||||
if (AscendConfig.COMMON.pointsPerLevel.get() != 15) changed++;
|
||||
if (AscendConfig.COMMON.maxAscendLevel.get() != 20) changed++;
|
||||
if (AscendConfig.COMMON.maxAttributePoints.get() != 100) changed++;
|
||||
@@ -85,6 +86,7 @@ public final class AscendAdvancements {
|
||||
if (AscendConfig.COMMON.xpPerDamageTaken.get() >= 250) extremeSources++;
|
||||
if (AscendConfig.COMMON.xpPerMovement.get() >= 250) extremeSources++;
|
||||
if (AscendConfig.COMMON.xpPerPotion.get() >= 250) extremeSources++;
|
||||
if (AscendConfig.COMMON.xpPerBeneficialEffect.get() >= 250) extremeSources++;
|
||||
return extremeSources >= 4;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.apache.commons.lang3.tuple.Pair;
|
||||
public class AscendConfig {
|
||||
public static class Common {
|
||||
public final ForgeConfigSpec.IntValue xpPerMobKill, xpPerBlockBreak, xpPerCraft, xpPerSmelt,
|
||||
xpPerTrade, xpPerDamageTaken, xpPerMovement, xpPerPotion, pointsPerLevel,
|
||||
xpPerTrade, xpPerDamageTaken, xpPerMovement, xpPerPotion, xpPerBeneficialEffect, pointsPerLevel,
|
||||
maxAscendLevel, maxAttributePoints;
|
||||
public final ForgeConfigSpec.DoubleValue xpMultiplier, attributeScalingMultiplier;
|
||||
public final ForgeConfigSpec.IntValue softCap1, softCap2, softCap3, softCap4;
|
||||
@@ -27,6 +27,7 @@ public class AscendConfig {
|
||||
xpPerDamageTaken = intValue(builder, "xpPerDamageTaken", "Ascend XP gained from dangerous survival conditions.", 2, 0, 1000);
|
||||
xpPerMovement = intValue(builder, "xpPerMovement", "Ascend XP gained for movement activities.", 1, 0, 1000);
|
||||
xpPerPotion = intValue(builder, "xpPerPotion", "Ascend XP gained for potion use.", 3, 0, 1000);
|
||||
xpPerBeneficialEffect = intValue(builder, "xpPerBeneficialEffect", "Ascend XP gained when a beneficial effect is applied.", 2, 0, 1000);
|
||||
pointsPerLevel = intValue(builder, "pointsPerLevel", "Attribute points gained per Ascend level.", 15, 1, 1000);
|
||||
maxAscendLevel = intValue(builder, "maxAscendLevel", "Maximum Ascend level.", 20, 1, 100);
|
||||
maxAttributePoints = intValue(builder, "maxAttributePoints", "Maximum investment in one attribute.", 100, 1, 1000);
|
||||
|
||||
@@ -222,7 +222,7 @@ public class ActivityEvents {
|
||||
if (player.level().isClientSide) return;
|
||||
if (event.getEffectInstance().getEffect().getCategory() == net.minecraft.world.effect.MobEffectCategory.BENEFICIAL) {
|
||||
player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> {
|
||||
stats.addAscendXP(2);
|
||||
stats.addAscendXP((int) (AscendConfig.COMMON.xpPerBeneficialEffect.get() * AscendConfig.COMMON.xpMultiplier.get()));
|
||||
PlayerStatsProvider.sync(player);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user