forked from Upstream/mmocore
!added 'multiplier' option for the brewPot exp source
This commit is contained in:
parent
feeb3aea78
commit
7efc7133f7
@ -23,11 +23,14 @@ import java.util.List;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public class BrewPotionExperienceSource extends ExperienceSource<PotionMeta> {
|
public class BrewPotionExperienceSource extends ExperienceSource<PotionMeta> {
|
||||||
|
private final double multiplier;
|
||||||
private final List<PotionType> types = new ArrayList<>();
|
private final List<PotionType> types = new ArrayList<>();
|
||||||
|
|
||||||
public BrewPotionExperienceSource(ExperienceDispenser dispenser, MMOLineConfig config) {
|
public BrewPotionExperienceSource(ExperienceDispenser dispenser, MMOLineConfig config) {
|
||||||
super(dispenser);
|
super(dispenser);
|
||||||
|
|
||||||
|
multiplier = config.getDouble("multiplier", 1);
|
||||||
|
|
||||||
if (config.contains("effect"))
|
if (config.contains("effect"))
|
||||||
for (String key : config.getString("effect").split(","))
|
for (String key : config.getString("effect").split(","))
|
||||||
types.add(PotionType.valueOf(key.toUpperCase().replace("-", "_")));
|
types.add(PotionType.valueOf(key.toUpperCase().replace("-", "_")));
|
||||||
@ -164,7 +167,7 @@ public class BrewPotionExperienceSource extends ExperienceSource<PotionMeta> {
|
|||||||
*/
|
*/
|
||||||
// exp += getTotal(mapEffectDurations());
|
// exp += getTotal(mapEffectDurations());
|
||||||
|
|
||||||
getDispenser().giveExperience(PlayerData.get(player), (int) exp, null);
|
getDispenser().giveExperience(PlayerData.get(player), (int) exp * multiplier, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user