Cancel Creation of Potion with full Inventory

This commit is contained in:
Sn0wStorm
2013-08-20 12:32:57 +02:00
parent 4496e94e55
commit b7d0b73aa0
@@ -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