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