mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-02-09 00:01:19 +01:00
Return empty buckets when using as ingredient
This commit is contained in:
parent
cb773a3662
commit
31385edce5
@ -73,10 +73,21 @@ public class PlayerListener implements Listener {
|
||||
// contitions
|
||||
} else if (BIngredients.possibleIngredients.contains(materialInHand)) {
|
||||
if (BCauldron.ingredientAdd(clickedBlock, materialInHand)) {
|
||||
boolean isBucket = item.getType().equals(Material.WATER_BUCKET)
|
||||
|| item.getType().equals(Material.LAVA_BUCKET)
|
||||
|| item.getType().equals(Material.MILK_BUCKET);
|
||||
if (item.getAmount() > 1) {
|
||||
item.setAmount(item.getAmount() - 1);
|
||||
|
||||
if (isBucket) {
|
||||
BCauldron.giveItem(player, new ItemStack(Material.BUCKET));
|
||||
}
|
||||
} else {
|
||||
player.setItemInHand(new ItemStack(0));
|
||||
if (isBucket) {
|
||||
player.setItemInHand(new ItemStack(Material.BUCKET));
|
||||
} else {
|
||||
player.setItemInHand(new ItemStack(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
event.setCancelled(true);
|
||||
|
Loading…
Reference in New Issue
Block a user