diff --git a/MODSRC/vazkii/botania/common/brew/ModBrews.java b/MODSRC/vazkii/botania/common/brew/ModBrews.java index fc33bc51e..6606f6a27 100644 --- a/MODSRC/vazkii/botania/common/brew/ModBrews.java +++ b/MODSRC/vazkii/botania/common/brew/ModBrews.java @@ -22,8 +22,8 @@ public class ModBrews { public static Brew strength; public static void init() { - speed = new BrewMod(LibBrewNames.SPEED, 0x59B7FF, 2000, new PotionEffect(Potion.moveSpeed.id, 1200, 1)); - strength = new BrewMod(LibBrewNames.STRENGTH, 0XEE3F3F, 2000, new PotionEffect(Potion.damageBoost.id, 1200, 1)); + speed = new BrewMod(LibBrewNames.SPEED, 0x59B7FF, 2000, new PotionEffect(Potion.moveSpeed.id, 1800, 1)); + strength = new BrewMod(LibBrewNames.STRENGTH, 0XEE3F3F, 2000, new PotionEffect(Potion.damageBoost.id, 1800, 1)); } } diff --git a/MODSRC/vazkii/botania/common/item/brew/ItemBrewBase.java b/MODSRC/vazkii/botania/common/item/brew/ItemBrewBase.java index 6ab8e99e0..2bf2778f8 100644 --- a/MODSRC/vazkii/botania/common/item/brew/ItemBrewBase.java +++ b/MODSRC/vazkii/botania/common/item/brew/ItemBrewBase.java @@ -76,22 +76,29 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem { @Override public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) { - for(PotionEffect effect : getBrew(stack).getPotionEffects(stack)) { - PotionEffect newEffect = new PotionEffect(effect); - player.addPotionEffect(newEffect); - } - - if(!world.isRemote && world.rand.nextBoolean()) - world.playSoundAtEntity(player, "random.burp", 0.4F, 1F); - - int swigs = getSwigsLeft(stack); - if(!player.capabilities.isCreativeMode) { - if(swigs == 1) - return baseItem.copy(); + if(!player.worldObj.isRemote) { + for(PotionEffect effect : getBrew(stack).getPotionEffects(stack)) { + PotionEffect newEffect = new PotionEffect(effect); + player.addPotionEffect(newEffect); + } - setSwigsLeft(stack, swigs - 1); + if(!world.isRemote && world.rand.nextBoolean()) + world.playSoundAtEntity(player, "random.burp", 0.4F, 1F); + + int swigs = getSwigsLeft(stack); + if(!player.capabilities.isCreativeMode) { + if(swigs == 1) { + ItemStack copy = baseItem.copy(); + if(!player.inventory.addItemStackToInventory(copy)) + return baseItem.copy(); + return null; + } + + + setSwigsLeft(stack, swigs - 1); + } } - + return stack; } @@ -120,7 +127,7 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem { @Override public IIcon getIcon(ItemStack stack, int pass) { - return pass == 0 ? itemIcon : icons[Math.max(0, swigs - getSwigsLeft(stack))]; + return pass == 0 ? itemIcon : icons[Math.max(0, Math.min(icons.length - 1, swigs - getSwigsLeft(stack)))]; } @Override