Multiple Effects per Potion

This commit is contained in:
Sn0wStorm
2013-08-14 20:08:55 +02:00
parent 62f1d7686a
commit e2e6448cf6
7 changed files with 85 additions and 42 deletions
+11 -6
View File
@@ -353,12 +353,17 @@ public class BPlayer {
}
public static void addBrewEffects(Brew brew, Player player) {
if (brew.getEffect() != null) {
int duration = (brew.getEffectDur() / 8) * brew.getQuality() * 20;
int amplifier = brew.getQuality() / 3;
Map<String, Integer> effects = brew.getEffects();
if (effects != null) {
for (Map.Entry<String, Integer> entry : effects.entrySet()) {
PotionEffectType type = PotionEffectType.getByName(entry.getKey());
if (type != null) {
int duration = (entry.getValue() / 8) * brew.getQuality() * 20;
int amplifier = brew.getQuality() / 3;
PotionEffectType type = PotionEffectType.getByName(brew.getEffect());
type.createEffect(duration, amplifier).apply(player);
type.createEffect(duration, amplifier).apply(player);
}
}
}
}
@@ -404,7 +409,7 @@ public class BPlayer {
}
}
} else if (bplayer.drunkeness <= (-1) * bplayer.offlineDrunk) {
players.remove(name);
iter.remove();
}
}
}