Package vazkii.botania.api.brew

Examples of vazkii.botania.api.brew.Brew


  @Override
  public int getColorFromItemStack(ItemStack stack, int pass) {
    if(pass == 0)
      return 0xFFFFFF;
   
    Brew brew = getBrew(stack);
    if(brew == BotaniaAPI.fallbackBrew)
      return 0xC6000E;
   
    Color color = new Color(brew.getColor(stack));
    int add = (int) (Math.sin((double) ClientTickHandler.ticksInGame * 0.2) * 24);
   
    int r = Math.max(0, Math.min(255, color.getRed() + add));
    int g = Math.max(0, Math.min(255, color.getGreen() + add));
    int b = Math.max(0, Math.min(255, color.getBlue() + add));
View Full Code Here


 
  @Override
  public void addHiddenTooltip(ItemStack stack, EntityPlayer player, List list, boolean adv) {
    super.addHiddenTooltip(stack, player, list, adv);
   
    Brew brew = getBrew(stack);
    if(brew == BotaniaAPI.fallbackBrew) {
      addStringToTooltip(EnumChatFormatting.LIGHT_PURPLE + StatCollector.translateToLocal("botaniamisc.notInfused"), list);
      return;
    }
   
    addStringToTooltip(EnumChatFormatting.LIGHT_PURPLE + String.format(StatCollector.translateToLocal("botaniamisc.brewOf"), StatCollector.translateToLocal(brew.getUnlocalizedName(stack))), list);
    for(PotionEffect effect : brew.getPotionEffects(stack)) {
      Potion potion = Potion.potionTypes[effect.getPotionID()];
      EnumChatFormatting format = potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY;
      addStringToTooltip(" " + format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : (" " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1)))), list);
    }
  }
View Full Code Here

    return BaubleType.AMULET;
  }

  @Override
  public void onWornTick(ItemStack stack, EntityLivingBase player) {
    Brew brew = getBrew(stack);
    if(brew != BotaniaAPI.fallbackBrew && player instanceof EntityPlayer && !player.worldObj.isRemote) {
      EntityPlayer eplayer = (EntityPlayer) player;
      PotionEffect effect = brew.getPotionEffects(stack).get(0);
      float cost = (float) brew.getManaCost(stack) / effect.getDuration() / (1 + effect.getAmplifier()) * 2.5F;
      boolean doRand = cost < 1;
      if(ManaItemHandler.requestManaExact(stack, eplayer, (int) Math.ceil(cost), false)) {
        PotionEffect currentEffect = player.getActivePotionEffect(Potion.potionTypes[effect.getPotionID()]);
        if(currentEffect == null || currentEffect.getDuration() < 3) {
          PotionEffect applyEffect = new PotionEffect(effect.getPotionID(), 80, effect.getAmplifier());
View Full Code Here

    return String.format(StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name"), StatCollector.translateToLocal(getBrew(stack).getUnlocalizedName(stack)), EnumChatFormatting.BOLD + "" + getSwigsLeft(stack) + EnumChatFormatting.RESET);
  }

  @Override
  public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
    Brew brew = getBrew(stack);
    for(PotionEffect effect : brew.getPotionEffects(stack)) {
      Potion potion = Potion.potionTypes[effect.getPotionID()];
      EnumChatFormatting format = potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY;
      list.add(format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : (" " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1)))) + EnumChatFormatting.GRAY + (potion.isInstant() ? "" : (" (" + Potion.getDurationString(effect) + ")")));
    }
  }
View Full Code Here

    int width = gui.getWidth() - 30;
    int height = gui.getHeight();
    int x = gui.getLeft() + 16;
    int y = gui.getTop() + 12;
   
    Brew brew = recipe.getBrew();
    FontRenderer renderer = Minecraft.getMinecraft().fontRenderer;
    boolean unicode = renderer.getUnicodeFlag();
    renderer.setUnicodeFlag(true);
    String s = EnumChatFormatting.BOLD + String.format(StatCollector.translateToLocal("botaniamisc.brewOf"), StatCollector.translateToLocal(brew.getUnlocalizedName()));
    renderer.drawString(s, gui.getLeft() + gui.getWidth() / 2 - renderer.getStringWidth(s) / 2, y, 0x222222);
    renderer.setUnicodeFlag(unicode);
    PageText.renderText(x, y + 22, width, height, text);
   
    ItemStack book = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem();
View Full Code Here

TOP

Related Classes of vazkii.botania.api.brew.Brew

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.