!added 'multiplier' option for the brewPot exp source

This commit is contained in:
Indyuce 2022-01-15 23:30:32 +01:00
parent feeb3aea78
commit 7efc7133f7

View File

@ -23,11 +23,14 @@ import java.util.List;
import java.util.Optional;
public class BrewPotionExperienceSource extends ExperienceSource<PotionMeta> {
private final double multiplier;
private final List<PotionType> types = new ArrayList<>();
public BrewPotionExperienceSource(ExperienceDispenser dispenser, MMOLineConfig config) {
super(dispenser);
multiplier = config.getDouble("multiplier", 1);
if (config.contains("effect"))
for (String key : config.getString("effect").split(","))
types.add(PotionType.valueOf(key.toUpperCase().replace("-", "_")));
@ -164,7 +167,7 @@ public class BrewPotionExperienceSource extends ExperienceSource<PotionMeta> {
*/
// exp += getTotal(mapEffectDurations());
getDispenser().giveExperience(PlayerData.get(player), (int) exp, null);
getDispenser().giveExperience(PlayerData.get(player), (int) exp * multiplier, null);
}
}
}