mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-02-19 01:41:22 +01:00
Cancel Creation of Potion with full Inventory
This commit is contained in:
parent
4496e94e55
commit
b7d0b73aa0
@ -43,6 +43,7 @@ public class PlayerListener implements Listener {
|
||||
|
||||
// fill a glass bottle with potion
|
||||
} else if (materialInHand == Material.GLASS_BOTTLE) {
|
||||
if (player.getInventory().firstEmpty() != -1 || item.getAmount() == 1) {
|
||||
if (BCauldron.fill(player, clickedBlock)) {
|
||||
event.setCancelled(true);
|
||||
if (item.getAmount() > 1) {
|
||||
@ -51,6 +52,9 @@ public class PlayerListener implements Listener {
|
||||
player.setItemInHand(new ItemStack(0));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
// reset cauldron when refilling to prevent
|
||||
// unlimited source of potions
|
||||
|
Loading…
Reference in New Issue
Block a user