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