mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 07:49:03 +00:00
Decrease Drunkeness on Death
This commit is contained in:
@@ -427,7 +427,7 @@ public class BPlayer {
|
||||
if (type.isInstant()) {
|
||||
type.createEffect(0, duration - 1).apply(player);
|
||||
} else {
|
||||
int amplifier = brew.getQuality() / 3;
|
||||
int amplifier = brew.getQuality() / 4;
|
||||
duration /= type.getDurationModifier();
|
||||
type.createEffect(duration * 20, amplifier).apply(player);
|
||||
}
|
||||
|
||||
@@ -135,10 +135,18 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
// Player has died! He should no longer be drunk
|
||||
// Player has died! Decrease Drunkeness by 20
|
||||
@EventHandler
|
||||
public void onPlayerRespawn(PlayerRespawnEvent event) {
|
||||
BPlayer.players.remove(event.getPlayer().getName());
|
||||
String playerName = event.getPlayer().getName();
|
||||
BPlayer bPlayer = BPlayer.get(playerName);
|
||||
if (bPlayer != null) {
|
||||
if (bPlayer.getDrunkeness() > 20) {
|
||||
bPlayer.setData(bPlayer.getDrunkeness() - 20, 0);
|
||||
} else {
|
||||
BPlayer.players.remove(playerName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// player walks while drunk, push him around!
|
||||
|
||||
Reference in New Issue
Block a user