Brew Drink command to simulate drinking a brew

This commit is contained in:
Sn0wStorm
2020-11-16 15:53:08 +01:00
parent 2471628e2d
commit 4111ceec81
11 changed files with 101 additions and 22 deletions
+7 -5
View File
@@ -161,12 +161,14 @@ public class BPlayer {
bPlayer = addPlayer(player);
}
BrewDrinkEvent drinkEvent = new BrewDrinkEvent(brew, meta, player, bPlayer);
P.p.getServer().getPluginManager().callEvent(drinkEvent);
if (drinkEvent.isCancelled()) {
if (bPlayer.drunkeness <= 0) {
bPlayer.remove();
if (meta != null) {
P.p.getServer().getPluginManager().callEvent(drinkEvent);
if (drinkEvent.isCancelled()) {
if (bPlayer.drunkeness <= 0) {
bPlayer.remove();
}
return false;
}
return false;
}
if (brew.hasRecipe()) {