Package vazkii.botania.api.recipe

Examples of vazkii.botania.api.recipe.RecipeRuneAltar


  }

  public void onWanded(EntityPlayer player, ItemStack wand) {
    updateRecipe();

    RecipeRuneAltar recipe = null;

    for(RecipeRuneAltar recipe_ : BotaniaAPI.runeAltarRecipes) {
      if(recipe_.matches(this)) {
        recipe = recipe_;
        break;
      }
    }

    if(manaToGet > 0 && mana >= manaToGet && !worldObj.isRemote) {
      List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
      EntityItem livingrock = null;
      for(EntityItem item : items)
        if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) {
          livingrock = item;
          break;
        }

      if(livingrock != null) {
        int mana = recipe.getManaUsage();
        recieveMana(-mana);
        if(!worldObj.isRemote) {
          ItemStack output = recipe.getOutput().copy();
          EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output);
          worldObj.spawnEntityInWorld(outputItem);
          cooldown = 60;
        }
View Full Code Here


  public void renderHUD(Minecraft mc, ScaledResolution res) {
    if(manaToGet > 0) {
      int x = res.getScaledWidth() / 2 + 20;
      int y = res.getScaledHeight() / 2 - 8;

      RecipeRuneAltar recipe = null;
      for(RecipeRuneAltar recipe_ : BotaniaAPI.runeAltarRecipes)
        if(recipe_.matches(this)) {
          recipe = recipe_;
          break;
        }
      if(recipe == null)
        return;

      RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, recipe.getOutput(), x, y);

      GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
      GL11.glEnable(GL11.GL_STENCIL_TEST);
      GL11.glColorMask(false, false, false, false);
      GL11.glDepthMask(false);
      GL11.glStencilFunc(GL11.GL_NEVER, 1, 0xFF);
      GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_KEEP, GL11.GL_KEEP);
      GL11.glStencilMask(0xFF);
      RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, recipe.getOutput(), x, y);
     
      mc.renderEngine.bindTexture(new ResourceLocation(LibResources.GUI_MANA_HUD));
      int r = 10;
      int centerX = x + 8;
      int centerY = y + 8;
View Full Code Here

   * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper
   * or String (case for Ore Dictionary). The array can't be larger than 16.
   * @return The recipe created.
   */
  public static RecipeRuneAltar registerRuneAltarRecipe(ItemStack output, int mana, Object... inputs) {
    RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs);
    runeAltarRecipes.add(recipe);
    return recipe;
  }
View Full Code Here

TOP

Related Classes of vazkii.botania.api.recipe.RecipeRuneAltar

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.