Negative alc Fixes

This commit is contained in:
Sn0wStorm 2021-04-06 18:04:14 +02:00
parent 01c498a608
commit 02f2e0c966
10 changed files with 23 additions and 12 deletions

View File

@ -440,6 +440,7 @@ recipes:
cookingtime: 2 cookingtime: 2
color: BLACK color: BLACK
difficulty: 3 difficulty: 3
alcohol: -6
lore: + &8Bestimmt schon eine Woche alt lore: + &8Bestimmt schon eine Woche alt
effects: effects:
- REGENERATION/1/2-5 - REGENERATION/1/2-5

View File

@ -438,6 +438,7 @@ recipes:
cookingtime: 2 cookingtime: 2
color: BLACK color: BLACK
difficulty: 3 difficulty: 3
alcohol: -6
effects: effects:
- REGENERATION/1/2-5 - REGENERATION/1/2-5
- SPEED/1/30-140 - SPEED/1/30-140

View File

@ -429,6 +429,7 @@ recipes:
cookingtime: 2 cookingtime: 2
color: BLACK color: BLACK
difficulty: 3 difficulty: 3
alcohol: -6
effects: effects:
- REGENERATION/1/2-5 - REGENERATION/1/2-5
- SPEED/1/30-140 - SPEED/1/30-140

View File

@ -740,6 +740,7 @@ recipes:
cookingtime: 2 cookingtime: 2
color: BLACK color: BLACK
difficulty: 3 difficulty: 3
alcohol: -6
lore: + &8Bestimmt schon eine Woche alt lore: + &8Bestimmt schon eine Woche alt
effects: effects:
- REGENERATION/1/2-5 - REGENERATION/1/2-5
@ -844,7 +845,7 @@ recipes:
# Pumpkin Spice Bier, # Pumpkin Spice Bier,
# Melonen Vodka # Melonen Vodka
# Es gibt noch viele Minecraft Items wie Ranken und items von anderen plugins die sich gut als Zutaten machen würden # Es gibt noch viele Minecraft Items wie Ranken, Milch und items von anderen plugins die sich gut als Zutaten machen würden

View File

@ -840,7 +840,7 @@ recipes:
# Pumpkin Spice Beer, # Pumpkin Spice Beer,
# Melon Vodka # Melon Vodka
# There are a lot of items in Minecraft like Vines and items added by plugins that would make great ingredients. # There are a lot of items in Minecraft like Vines, Milk and items added by plugins that would make great ingredients.
# -- Plugin Compatibility -- # -- Plugin Compatibility --

View File

@ -840,7 +840,7 @@ recipes:
# Pumpkin Spice Beer, # Pumpkin Spice Beer,
# Melon Vodka # Melon Vodka
# There are a lot of items in Minecraft like Vines and items added by plugins that would make great ingredients. # There are a lot of items in Minecraft like Vines, Milk and items added by plugins that would make great ingredients.
# -- Plugin Compatibility -- # -- Plugin Compatibility --

View File

@ -846,7 +846,7 @@ recipes:
# Pumpkin Spice Beer, # Pumpkin Spice Beer,
# Melon Vodka # Melon Vodka
# There are a lot of items in Minecraft like Vines and items added by plugins that would make great ingredients. # There are a lot of items in Minecraft like Vines, Milk and items added by plugins that would make great ingredients.
# -- Compatibilité entre Plugins -- # -- Compatibilité entre Plugins --

View File

@ -739,6 +739,7 @@ recipes:
cookingtime: 2 cookingtime: 2
color: BLACK color: BLACK
difficulty: 3 difficulty: 3
alcohol: -6
lore: + &8Probably a week old lore: + &8Probably a week old
effects: effects:
- REGENERATION/1/2-5 - REGENERATION/1/2-5
@ -839,7 +840,7 @@ eggnog:
# Pumpkin Spice Beer, # Pumpkin Spice Beer,
# Melon Vodka # Melon Vodka
# There are a lot of items in Minecraft like Vines and items added by plugins that would make great ingredients. # There are a lot of items in Minecraft like Vines, Milk and items added by plugins that would make great ingredients.
# -- Compatibilità con altri plugin -- # -- Compatibilità con altri plugin --

View File

@ -743,6 +743,7 @@ recipes:
cookingtime: 2 cookingtime: 2
color: BLACK color: BLACK
difficulty: 3 difficulty: 3
alcohol: -6
lore: + &8Probably a week old lore: + &8Probably a week old
effects: effects:
- REGENERATION/1/2-5 - REGENERATION/1/2-5
@ -820,7 +821,7 @@ recipes:
# cookingtime: 1 # cookingtime: 1
# color: BLACK # color: BLACK
# difficulty: 4 # difficulty: 4
# alcohol: -6 # alcohol: -8
# effects: # effects:
# - REGENERATION/30 # - REGENERATION/30
# - SPEED/10 # - SPEED/10
@ -843,7 +844,7 @@ recipes:
# Pumpkin Spice Beer, # Pumpkin Spice Beer,
# Melon Vodka # Melon Vodka
# There are a lot of items in Minecraft like Vines and items added by plugins that would make great ingredients. # There are a lot of items in Minecraft like Vines, Milk and items added by plugins that would make great ingredients.
# -- 插件兼容性 -- # -- 插件兼容性 --

View File

@ -182,6 +182,7 @@ public class BPlayer {
applyEffects(effects, player, PlayerEffectEvent.EffectType.DRINK); applyEffects(effects, player, PlayerEffectEvent.EffectType.DRINK);
if (brewAlc < 0) { if (brewAlc < 0) {
// If the Drink has negative alcohol, drain some alcohol
bPlayer.drain(player, -brewAlc); bPlayer.drain(player, -brewAlc);
} else if (brewAlc > 0) { } else if (brewAlc > 0) {
bPlayer.drunkeness += brewAlc; bPlayer.drunkeness += brewAlc;
@ -190,21 +191,25 @@ public class BPlayer {
} else { } else {
bPlayer.quality += brewAlc; bPlayer.quality += brewAlc;
} }
applyEffects(getQualityEffects(quality, brewAlc), player, PlayerEffectEvent.EffectType.QUALITY); applyEffects(getQualityEffects(quality, brewAlc), player, PlayerEffectEvent.EffectType.QUALITY);
} }
if (bPlayer.drunkeness > 100) { if (bPlayer.drunkeness > 100) {
bPlayer.drinkCap(player); bPlayer.drinkCap(player);
} }
bPlayer.syncToSQL(false);
if (BConfig.showStatusOnDrink) { if (BConfig.showStatusOnDrink) {
bPlayer.showDrunkeness(player); // Only show the Player his drunkeness if he is already drunk, or this drink changed his drunkeness
if (brewAlc != 0 || bPlayer.drunkeness > 0) {
bPlayer.showDrunkeness(player);
}
} }
if (bPlayer.drunkeness <= 0) { if (bPlayer.drunkeness <= 0) {
bPlayer.remove(); bPlayer.remove();
} else {
bPlayer.syncToSQL(false);
} }
return true; return true;
} }