Ejemplo n.º 1
0
  private void updateCreativeSearch() {
    ContainerCreative var1 = (ContainerCreative) this.inventorySlots;
    var1.itemList.clear();
    Item[] var2 = Item.itemsList;
    int var3 = var2.length;
    int var4;

    for (var4 = 0; var4 < var3; ++var4) {
      Item var5 = var2[var4];

      if (var5 != null && var5.getCreativeTab() != null) {
        var5.getSubItems(var5.itemID, (CreativeTabs) null, var1.itemList);
      }
    }

    Enchantment[] var8 = Enchantment.enchantmentsList;
    var3 = var8.length;

    for (var4 = 0; var4 < var3; ++var4) {
      Enchantment var12 = var8[var4];

      if (var12 != null && var12.type != null) {
        Item.enchantedBook.func_92113_a(var12, var1.itemList);
      }
    }

    Iterator var9 = var1.itemList.iterator();
    String var10 = this.searchField.getText().toLowerCase();

    while (var9.hasNext()) {
      ItemStack var11 = (ItemStack) var9.next();
      boolean var13 = false;
      Iterator var6 =
          var11.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips).iterator();

      while (true) {
        if (var6.hasNext()) {
          String var7 = (String) var6.next();

          if (!var7.toLowerCase().contains(var10)) {
            continue;
          }

          var13 = true;
        }

        if (!var13) {
          var9.remove();
        }

        break;
      }
    }

    this.currentScroll = 0.0F;
    var1.scrollTo(0.0F);
  }
Ejemplo n.º 2
0
  public static int func_77514_a(
      Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) {
    Item var4 = p_77514_3_.func_77973_b();
    int var5 = var4.func_77619_b();
    if (var5 <= 0) {
      return 0;
    } else {
      if (p_77514_2_ > 15) {
        p_77514_2_ = 15;
      }

      int var6 = p_77514_0_.nextInt(8) + 1 + (p_77514_2_ >> 1) + p_77514_0_.nextInt(p_77514_2_ + 1);
      return p_77514_1_ == 0
          ? Math.max(var6 / 3, 1)
          : (p_77514_1_ == 1 ? var6 * 2 / 3 + 1 : Math.max(var6, p_77514_2_ * 2));
    }
  }
Ejemplo n.º 3
0
  private void updateCreativeSearch() {
    ContainerCreative var1 = (ContainerCreative) this.inventorySlots;
    var1.itemList.clear();
    Item[] var2 = Item.itemsList;
    int var3 = var2.length;

    for (int var4 = 0; var4 < var3; ++var4) {
      Item var5 = var2[var4];

      if (var5 != null && var5.getCreativeTab() != null) {
        var5.getSubItems(var5.shiftedIndex, (CreativeTabs) null, var1.itemList);
      }
    }

    Iterator var8 = var1.itemList.iterator();
    String var9 = this.searchField.getText().toLowerCase();

    while (var8.hasNext()) {
      ItemStack var10 = (ItemStack) var8.next();
      boolean var11 = false;
      Iterator var6 =
          var10.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips).iterator();

      while (true) {
        if (var6.hasNext()) {
          String var7 = (String) var6.next();

          if (!var7.toLowerCase().contains(var9)) {
            continue;
          }

          var11 = true;
        }

        if (!var11) {
          var8.remove();
        }

        break;
      }
    }

    this.currentScroll = 0.0F;
    var1.scrollTo(0.0F);
  }
  /**
   * Returns the enchantability of itemstack, it's uses a singular formula for each index (2nd
   * parameter: 0, 1 and 2), cutting to the max enchantability power of the table (3rd parameter)
   */
  public static int calcItemStackEnchantability(
      Random par0Random, int par1, int par2, ItemStack par3ItemStack) {
    Item var4 = par3ItemStack.getItem();
    int var5 = var4.getItemEnchantability();

    if (var5 <= 0) {
      return 0;
    } else {
      if (par2 > 15) {
        par2 = 15;
      }

      int var6 = par0Random.nextInt(8) + 1 + (par2 >> 1) + par0Random.nextInt(par2 + 1);
      return par1 == 0
          ? Math.max(var6 / 3, 1)
          : (par1 == 1 ? var6 * 2 / 3 + 1 : Math.max(var6, par2 * 2));
    }
  }
Ejemplo n.º 5
0
 static {
   mortar =
       (new Item(AutomatonLogger.mortar))
           .setIconCoord(4, 11)
           .setMaxStackSize(1)
           .setContainerItem(mortar)
           .setItemName("mortar");
   mortar.setContainerItem(mortar);
 }
Ejemplo n.º 6
0
  public void registerIcons(IconRegister par1IconRegister) {
    super.registerIcons(par1IconRegister);

    if (this.material == EnumArmorMaterial.CLOTH) {
      this.field_94605_cw = par1IconRegister.registerIcon(field_94606_cu[this.armorType]);
    }

    this.field_94604_cx = par1IconRegister.registerIcon(field_94603_a[this.armorType]);
  }
Ejemplo n.º 7
0
  public ItemStack findMatchingRecipe(InventoryCrafting inventorycrafting) {
    int i = 0;
    ItemStack itemstack = null;
    ItemStack itemstack1 = null;
    for (int j = 0; j < inventorycrafting.getSizeInventory(); j++) {
      ItemStack itemstack2 = inventorycrafting.getStackInSlot(j);
      if (itemstack2 == null) {
        continue;
      }
      if (i == 0) {
        itemstack = itemstack2;
      }
      if (i == 1) {
        itemstack1 = itemstack2;
      }
      i++;
    }

    if (i == 2
        && itemstack.itemID == itemstack1.itemID
        && itemstack.stackSize == 1
        && itemstack1.stackSize == 1
        && Item.itemsList[itemstack.itemID].isDamageable()) {
      Item item = Item.itemsList[itemstack.itemID];
      int l = item.getMaxDamage() - itemstack.getItemDamageForDisplay();
      int i1 = item.getMaxDamage() - itemstack1.getItemDamageForDisplay();
      int j1 = l + i1 + (item.getMaxDamage() * 10) / 100;
      int k1 = item.getMaxDamage() - j1;
      if (k1 < 0) {
        k1 = 0;
      }
      return new ItemStack(itemstack.itemID, 1, k1);
    }
    for (int k = 0; k < recipes.size(); k++) {
      IRecipe irecipe = (IRecipe) recipes.get(k);
      if (irecipe.matches(inventorycrafting)) {
        return irecipe.getCraftingResult(inventorycrafting);
      }
    }

    return null;
  }
Ejemplo n.º 8
0
 protected void func_27267_a(StatCrafting statcrafting, int i, int j) {
   if (statcrafting == null) {
     return;
   }
   Item item = Item.field_233_c[statcrafting.func_25072_b()];
   String s =
       (new StringBuilder())
           .append("")
           .append(StringTranslate.func_20162_a().func_20161_b(item.func_20009_a()))
           .toString()
           .trim();
   if (s.length() > 0) {
     int k = i + 12;
     int l = j - 12;
     int i1 = GuiStats.func_27127_n(field_27269_g).func_871_a(s);
     GuiStats.func_27135_b(
         field_27269_g, k - 3, l - 3, k + i1 + 3, l + 8 + 3, 0xc0000000, 0xc0000000);
     GuiStats.func_27131_o(field_27269_g).func_874_a(s, k, l, -1);
   }
 }
Ejemplo n.º 9
0
 public EntityBreakingFX(
     World p_i9003_1_,
     double p_i9003_2_,
     double p_i9003_4_,
     double p_i9003_6_,
     Item p_i9003_8_,
     RenderEngine p_i9003_9_) {
   super(p_i9003_1_, p_i9003_2_, p_i9003_4_, p_i9003_6_, 0.0D, 0.0D, 0.0D);
   this.func_94052_a(p_i9003_9_, p_i9003_8_.func_77617_a(0));
   this.field_70552_h = this.field_70553_i = this.field_70551_j = 1.0F;
   this.field_70545_g = Block.field_72039_aU.field_72017_co;
   this.field_70544_f /= 2.0F;
 }
  /**
   * Create a list of random EnchantmentData (enchantments) that can be added together to the
   * ItemStack, the 3rd parameter is the total enchantability level.
   */
  public static List buildEnchantmentList(Random par0Random, ItemStack par1ItemStack, int par2) {
    Item var3 = par1ItemStack.getItem();
    int var4 = var3.getItemEnchantability();

    if (var4 <= 0) {
      return null;
    } else {
      var4 /= 2;
      var4 = 1 + par0Random.nextInt((var4 >> 1) + 1) + par0Random.nextInt((var4 >> 1) + 1);
      int var5 = var4 + par2;
      float var6 = (par0Random.nextFloat() + par0Random.nextFloat() - 1.0F) * 0.15F;
      int var7 = (int) ((float) var5 * (1.0F + var6) + 0.5F);

      if (var7 < 1) {
        var7 = 1;
      }

      ArrayList var8 = null;
      Map var9 = mapEnchantmentData(var7, par1ItemStack);

      if (var9 != null && !var9.isEmpty()) {
        EnchantmentData var10 =
            (EnchantmentData) WeightedRandom.getRandomItem(par0Random, var9.values());

        if (var10 != null) {
          var8 = new ArrayList();
          var8.add(var10);

          for (int var11 = var7; par0Random.nextInt(50) <= var11; var11 >>= 1) {
            Iterator var12 = var9.keySet().iterator();

            while (var12.hasNext()) {
              Integer var13 = (Integer) var12.next();
              boolean var14 = true;
              Iterator var15 = var8.iterator();

              while (true) {
                if (var15.hasNext()) {
                  EnchantmentData var16 = (EnchantmentData) var15.next();

                  if (var16.enchantmentobj.canApplyTogether(
                      Enchantment.enchantmentsList[var13.intValue()])) {
                    continue;
                  }

                  var14 = false;
                }

                if (!var14) {
                  var12.remove();
                }

                break;
              }
            }

            if (!var9.isEmpty()) {
              EnchantmentData var17 =
                  (EnchantmentData) WeightedRandom.getRandomItem(par0Random, var9.values());
              var8.add(var17);
            }
          }
        }
      }

      return var8;
    }
  }
Ejemplo n.º 11
0
  public mod_Automatons() {

    (new AM_DimensionBot()).name = "Bot Land";

    techAchievement =
        (new Achievement(4281, "WERG", -4, -6, Item.appleRed, null)).registerAchievement();
    ModLoader.AddAchievementDesc(techAchievement, "YOU IS WINRAR!", "herpy derp derp?");

    itemOmni.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/itemOmni.png");
    ModLoader.AddName(itemOmni, "Omni Unit");

    cheatStick.iconIndex =
        53; // ModLoader.addOverride("/gui/items.png", "/automatons/itemOmni.png");
    ModLoader.AddName(cheatStick, "CHEAT STICK!1!1ONE11!!");

    mortar.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/mortar.png");
    ModLoader.AddName(mortar, "Grinder");

    regulator.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/regulator.png");
    ModLoader.AddName(regulator, "Phase Regulator");

    daymaker.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/daymaker.png");
    ModLoader.AddName(daymaker, "Dawn");

    techifier.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/techifier.png");
    ModLoader.AddName(techifier, "Bionic Conversion System");

    smack.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/sliderpan.png");
    ModLoader.AddName(smack, "Slider Pan");

    naturizer.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/naturizer.png");
    ModLoader.AddName(naturizer, "Organic Conversion System");

    // itemBally

    // itemBot

    // stuffs

    automaton.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/automaton.png");
    ModLoader.AddName(automaton, "Worker");

    // automatonHead.iconIndex = ModLoader.addOverride("/gui/items.png",
    // "/automatons/automatonHead.png");
    // ModLoader.AddName(automatonHead, "Worker Head");

    // automatonBod.iconIndex = ModLoader.addOverride("/gui/items.png",
    // "/automatons/automatonBod.png");
    // ModLoader.AddName(automatonBod, "Automaton Body");

    // automatonLeg.iconIndex = ModLoader.addOverride("/gui/items.png",
    // "/automatons/automatonLeg.png");
    // ModLoader.AddName(automatonLeg, "Automaton Leg");

    automatonCore.iconIndex =
        ModLoader.addOverride("/gui/items.png", "/automatons/automatonCore.png");
    ModLoader.AddName(automatonCore, "Blue Core");

    beacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/beacon.png");
    ModLoader.AddName(beacon, "Beacon");

    biter.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/biter.png");
    ModLoader.AddName(biter, "Sentry");

    // automatonBack.iconIndex = ModLoader.addOverride("/gui/items.png",
    // "/automatons/automatonBack.png");
    // ModLoader.AddName(automatonBack, "Automaton Back");

    // biterHead.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/biterHead.png");
    // ModLoader.AddName(biterHead, "Sentry Head");

    // rod.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/rod.png");
    // ModLoader.AddName(rod, "Iron Rod");

    superCore.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/superCore.png");
    ModLoader.AddName(superCore, "Red Core");

    guard.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/guard.png");
    ModLoader.AddName(guard, "Guard Turret");

    blaster.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/blaster.png");
    ModLoader.AddName(blaster, "Pulse Rifle");

    factotum.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/itemfactotum.png");
    ModLoader.AddName(factotum, "Factotum");

    pickTech.iconIndex = ModLoader.addOverride("/gui/items.png", "/automatons/picktech.png");
    ModLoader.AddName(pickTech, "Charged Pick");

    ModLoader.AddName(new ItemStack(stuffs, 1, 0), "Adaptive Bionic Conglomerate");
    ModLoader.AddName(new ItemStack(stuffs, 1, 1), "Automaton Body");
    ModLoader.AddName(new ItemStack(stuffs, 1, 2), "Worker Head");
    ModLoader.AddName(new ItemStack(stuffs, 1, 3), "Automaton Leg");
    ModLoader.AddName(new ItemStack(stuffs, 1, 4), "Iron Rod");
    ModLoader.AddName(new ItemStack(stuffs, 1, 5), "Automaton Back");
    ModLoader.AddName(new ItemStack(stuffs, 1, 6), "Sentry Head");
    ModLoader.AddName(new ItemStack(stuffs, 1, 7), "Cybernetic Particulate");
    ModLoader.AddName(new ItemStack(stuffs, 1, 8), "Plant Matter");
    ModLoader.AddName(new ItemStack(stuffs, 1, 9), "Coal Dust");
    ModLoader.AddName(new ItemStack(stuffs, 1, 10), "Salt Petre");
    ModLoader.AddName(new ItemStack(stuffs, 1, 11), "Sulfur");
    ModLoader.AddName(new ItemStack(stuffs, 1, 12), "Factotum Head");
    ModLoader.AddName(new ItemStack(stuffs, 1, 13), "Furnace Chunk");
    ModLoader.AddName(new ItemStack(stuffs, 1, 14), "Greater Automaton Body");

    ModLoader.RegisterBlock(tech, AM_ItemComplex.class);
    ModLoader.RegisterBlock(crink);
    ModLoader.RegisterBlock(duplex);
    ModLoader.RegisterBlock(crystal);
    ModLoader.RegisterBlock(glowy);
    ModLoader.RegisterBlock(fakeCrystal);
    ModLoader.RegisterBlock(frass, AM_ItemFrass.class);
    ModLoader.RegisterBlock(heal);
    ModLoader.RegisterBlock(boing);
    ModLoader.RegisterBlock(dapling);
    ModLoader.RegisterBlock(grower);
    ModLoader.RegisterBlock(frass2);
    ModLoader.RegisterBlock(tv);
    ModLoader.RegisterBlock(sky, AM_ItemLumo.class);
    ModLoader.RegisterBlock(techPlant);
    ModLoader.RegisterBlock(importantBuildingThingy);
    ModLoader.RegisterBlock(arbor);
    ModLoader.RegisterBlock(deployer);

    ModLoader.AddName(new ItemStack(tech, 1, 0), "Ancient Construct");
    ModLoader.AddName(new ItemStack(tech, 1, 1), "Bionic Mass");
    ModLoader.AddName(new ItemStack(tech, 1, 2), "Domestic Tile");
    ModLoader.AddName(new ItemStack(tech, 1, 3), "Domestic Tile2");

    ModLoader.AddName(new ItemStack(sky, 1, 0), "Atmospheric simulator");
    ModLoader.AddName(new ItemStack(sky, 1, 1), "Walkway Tile");

    ModLoader.AddName(crink, "Foliage Array");
    ModLoader.AddName(duplex, "Duplex");
    ModLoader.AddName(crystal, "Power Shard");
    ModLoader.AddName(glowy, "Illuminator");
    ModLoader.AddName(fakeCrystal, "Power Shard");
    ModLoader.AddName(frass, "Frass");
    ModLoader.AddName(heal, "Biomatter Regenerator");
    ModLoader.AddName(boing, "Slider Shell");
    ModLoader.AddName(dapling, "Dapling");
    ModLoader.AddName(grower, "Bionic Stalk");

    // tech.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/automatons/tech.png");
    // crystal.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/automatons/tech.png");
    // crink.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/automatons/crink.png");
    duplex.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/automatons/duplex.png");
    frass2.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/automatons/frass5.png");
    hollow.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/automatons/crink3.png");
    // techPlant.blockIndexInTexture =ModLoader.addOverride("/terrain.png",
    // "/automatons/techPlant.png");

    // sky.blockIndexInTexture =ModLoader.addOverride("/terrain.png", "/automatons/sky.png");
    // dapling.blockIndexInTexture =

    // tech.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/automatons/tech.png");
    AM_BlockComplex.loadSprites();
    AM_BlockBoing.loadSprites();
    AM_BlockFrass.loadSprites();
    AM_BlockHeal.loadSprites();
    AM_BlockGrower.loadSprites();
    AM_BlockCrink.loadSprites();
    AM_BlockHollow.loadSprites();
    AM_BlockLumo.loadSprites();
    AM_BlockDeployer.loadSprites();
    AM_BlockArbor.loadSprites();
    // Item.itemsList[frass.blockID] = (new ItemFrass(frass.blockID - 256)).setItemName("frass");

    ((AM_BlockGlow) crystal).loadSprites1();
    fakeCrystal.loadSprites(((AM_BlockGlow) crystal).D[0], ((AM_BlockGlow) crystal).D[1]);

    AM_BlockFrass.setAllowed();

    ModLoader.AddSpawn(AM_EntityWatcher.class, 12, 4, 4, EnumCreatureType.monster);
    ModLoader.AddSpawn(AM_EntitySlider.class, 4, 4, 4, EnumCreatureType.creature);

    ModLoader.AddSpawn(AM_EntityChopper.class, 14, 4, 4, EnumCreatureType.creature);
    ModLoader.AddSpawn(AM_EntityBobby.class, 16, 4, 4, EnumCreatureType.creature);
    ModLoader.AddSpawn(AM_EntityGolem.class, 5, 4, 4, EnumCreatureType.creature);

    // ModLoader.AddSpawn(AM_EntityArborist.class, 2,1,1 EnumCreatureType.creature);

    // ModLoader.getUniqueEntityId()
    ModLoader.RegisterEntityID(AM_EntityWatcher.class, "AM_Watcher", AutomatonLogger.watcher);
    ModLoader.RegisterEntityID(AM_EntityWorker.class, "AM_Worker", AutomatonLogger.worker);
    ModLoader.RegisterEntityID(AM_EntityBeacon.class, "AM_Beacon", AutomatonLogger.beacon);
    ModLoader.RegisterEntityID(AM_EntitySentry.class, "AM_Sentry", AutomatonLogger.sentry);
    ModLoader.RegisterEntityID(AM_EntitySlider.class, "AM_Slider", AutomatonLogger.slider);
    ModLoader.RegisterEntityID(AM_EntityGuard.class, "AM_Guard", AutomatonLogger.guardTurret);
    ModLoader.RegisterEntityID(AM_EntityChopper.class, "AM_Chopper", AutomatonLogger.chopper);
    ModLoader.RegisterEntityID(AM_EntityBobby.class, "AM_Bobby", AutomatonLogger.bobby);
    ModLoader.RegisterEntityID(AM_EntityGolem.class, "AM_Golem", AutomatonLogger.golem1);
    ModLoader.RegisterEntityID(AM_EntityGolem2.class, "AM_Golem2", AutomatonLogger.golem2);
    ModLoader.RegisterEntityID(AM_EntityOmni.class, "Omni", AutomatonLogger.omni);
    ModLoader.RegisterEntityID(AM_EntityFactotum.class, "AM_Factotum", AutomatonLogger.factotum);
    ModLoader.RegisterEntityID(AM_EntityRemnant.class, "AM_Remnant", AutomatonLogger.remnant);
    ModLoader.RegisterEntityID(AM_EntityArborist.class, "AM_Arborist", AutomatonLogger.arborist);
    ModLoader.RegisterEntityID(AM_EntityHydra.class, "AM_Hydra", AutomatonLogger.hydra);
    // ModLoader.RegisterEntityID(EntityAZiz.class, "AZiz",AutomatonLogger.ziz);

    ModLoader.AddRecipe(
        new ItemStack(automatonCore, 1),
        new Object[] { // core
          "###",
          "OOO",
          "OOO",
          Character.valueOf('#'),
          Block.stone,
          Character.valueOf('O'),
          Item.redstone
        });

    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 3),
        new Object[] { // leg
          "#O",
          " O",
          Character.valueOf('#'),
          new ItemStack(stuffs, 1, 4),
          Character.valueOf('O'),
          Block.cobblestone
        });
    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 3),
        new Object[] { // leg
          "O#",
          "O ",
          Character.valueOf('#'),
          new ItemStack(stuffs, 1, 4),
          Character.valueOf('O'),
          Block.cobblestone
        });
    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 2),
        new Object[] { // workerhead
          "OIO",
          "#OO",
          " s ",
          Character.valueOf('s'),
          new ItemStack(stuffs, 1, 4),
          Character.valueOf('I'),
          Block.torchWood,
          Character.valueOf('#'),
          Block.glass,
          Character.valueOf('O'),
          Block.cobblestone
        });
    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 1),
        new Object[] { // bod
          "O#O",
          "OHO",
          "O#O",
          Character.valueOf('H'),
          automatonCore,
          Character.valueOf('#'),
          Block.glass,
          Character.valueOf('O'),
          Block.cobblestone
        });

    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 14),
        new Object[] { // bod2
          "O#O",
          "OHO",
          "O#O",
          Character.valueOf('H'),
          superCore,
          Character.valueOf('#'),
          Block.glass,
          Character.valueOf('O'),
          Block.cobblestone
        });

    ModLoader.AddRecipe(
        new ItemStack(automaton, 1),
        new Object[] { // automaton
          " A ",
          "CBC",
          Character.valueOf('A'),
          new ItemStack(stuffs, 1, 2),
          Character.valueOf('B'),
          new ItemStack(stuffs, 1, 1),
          Character.valueOf('C'),
          new ItemStack(stuffs, 1, 3)
        });

    ModLoader.AddRecipe(
        new ItemStack(beacon, 1),
        new Object[] {
          " O ",
          " H ",
          "OOO",
          Character.valueOf('H'),
          automatonCore,
          Character.valueOf('O'),
          Block.cobblestone
        });
    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 5),
        new Object[] { // biter back
          "OsO",
          "OsO",
          Character.valueOf('s'),
          new ItemStack(stuffs, 1, 4),
          Character.valueOf('O'),
          Block.cobblestone
        });
    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 6),
        new Object[] { // biter head
          "OOO",
          "ssr",
          "OOO",
          Character.valueOf('s'),
          new ItemStack(stuffs, 1, 4),
          Character.valueOf('r'),
          Block.torchWood,
          Character.valueOf('O'),
          Block.cobblestone
        });

    ModLoader.AddRecipe(
        new ItemStack(biter, 1),
        new Object[] {
          " ll",
          "hbk",
          " ll",
          Character.valueOf('h'),
          new ItemStack(stuffs, 1, 6),
          Character.valueOf('b'),
          new ItemStack(stuffs, 1, 14),
          Character.valueOf('k'),
          new ItemStack(stuffs, 1, 5),
          Character.valueOf('l'),
          new ItemStack(stuffs, 1, 3)
        });

    ModLoader.AddRecipe(
        new ItemStack(blaster, 1),
        new Object[] {
          "OOs",
          "DDD",
          "  r",
          Character.valueOf('O'),
          Item.ingotIron,
          Character.valueOf('s'),
          superCore,
          Character.valueOf('D'),
          crystal,
          Character.valueOf('r'),
          new ItemStack(stuffs, 1, 4)
        });

    ModLoader.AddShapelessRecipe(new ItemStack(stuffs, 9, 4), new Object[] {Item.ingotIron});

    ModLoader.AddShapelessRecipe(new ItemStack(duplex, 1), new Object[] {crystal, crink});

    /*ModLoader.AddShapelessRecipe(new ItemStack(duplex, 9), new Object[] {
    	duplex
    });*/

    ModLoader.AddShapelessRecipe(new ItemStack(guard, 1), new Object[] {blaster, beacon});

    ModLoader.AddShapelessRecipe(
        new ItemStack(superCore, 1), new Object[] {automatonCore, automatonCore, automatonCore});

    ModLoader.AddRecipe(
        new ItemStack(Item.ingotIron, 1),
        new Object[] {"OOO", "OOO", "OOO", Character.valueOf('O'), new ItemStack(stuffs, 1, 4)});

    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 4),
        new Object[] {"O", "O", "O", Character.valueOf('O'), new ItemStack(stuffs, 1, 0)});

    ModLoader.AddShapelessRecipe(new ItemStack(stuffs, 2, 9), new Object[] {Item.coal, mortar});

    ModLoader.AddRecipe(
        new ItemStack(pickTech, 1),
        new Object[] {
          "i",
          "L",
          Character.valueOf('i'),
          new ItemStack(stuffs, 1, 4),
          Character.valueOf('L'),
          grower
        });

    ModLoader.AddShapelessRecipe(new ItemStack(stuffs, 2, 8), new Object[] {Block.sapling, mortar});

    ModLoader.AddShapelessRecipe(new ItemStack(stuffs, 2, 8), new Object[] {Item.seeds, mortar});

    ModLoader.AddRecipe(
        new ItemStack(stuffs, 2, 7),
        new Object[] {"O", "M", Character.valueOf('O'), frass, Character.valueOf('M'), mortar});

    /*ddShapelessRecipe(new ItemStack(stuffs, 2,7), new Object[] {
    Block.frass, Item.mortar
    });*/
    ModLoader.AddShapelessRecipe(new ItemStack(stuffs, 2, 7), new Object[] {crink, mortar});

    ModLoader.AddShapelessRecipe(
        new ItemStack(Item.redstone, 3), new Object[] {automatonCore, mortar});
    ModLoader.AddShapelessRecipe(new ItemStack(Item.redstone, 6), new Object[] {superCore, mortar});

    ModLoader.AddShapelessRecipe(
        new ItemStack(stuffs, 1, 0),
        new Object[] {new ItemStack(stuffs, 2, 8), new ItemStack(stuffs, 2, 7)});

    ModLoader.AddRecipe(
        new ItemStack(techifier, 1),
        new Object[] {
          "OOO",
          "OfO",
          "i i",
          Character.valueOf('O'),
          new ItemStack(stuffs, 1, 0),
          Character.valueOf('f'),
          frass,
          Character.valueOf('i'),
          new ItemStack(stuffs, 1, 4)
        });

    ModLoader.AddRecipe(
        new ItemStack(naturizer, 1),
        new Object[] {
          "i i",
          "OfO",
          "OOO",
          Character.valueOf('O'),
          new ItemStack(stuffs, 1, 0),
          Character.valueOf('f'),
          Block.sapling,
          Character.valueOf('i'),
          Item.stick
        });

    ModLoader.AddRecipe(
        new ItemStack(dapling, 1),
        new Object[] {
          " O ",
          "OCO",
          " s ",
          Character.valueOf('O'),
          crink,
          Character.valueOf('C'),
          automatonCore,
          Character.valueOf('s'),
          new ItemStack(stuffs, 1, 0)
        });

    ModLoader.AddRecipe(
        new ItemStack(itemOmni, 1),
        new Object[] {
          "OOO",
          "OCO",
          "OOO",
          Character.valueOf('O'),
          new ItemStack(stuffs, 1, 0),
          Character.valueOf('C'),
          superCore
        });

    ModLoader.AddRecipe(
        new ItemStack(mortar, 1),
        new Object[] {
          "#-#",
          "#-#",
          "#-#",
          Character.valueOf('#'),
          Block.stone,
          Character.valueOf('-'),
          new ItemStack(stuffs, 1, 4)
        });

    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 12),
        new Object[] {
          "OOO",
          "gig",
          "OOO",
          Character.valueOf('O'),
          Block.cobblestone,
          Character.valueOf('g'),
          Block.glass,
          Character.valueOf('i'),
          Item.ingotIron
        });

    ModLoader.AddRecipe(
        new ItemStack(stuffs, 1, 13),
        new Object[] {
          "FfF",
          "iPi",
          "OFO",
          Character.valueOf('O'),
          Block.cobblestone,
          Character.valueOf('F'),
          Block.stoneOvenIdle,
          Character.valueOf('i'),
          Item.ingotIron,
          Character.valueOf('f'),
          Item.flintAndSteel,
          Character.valueOf('P'),
          crystal
        });

    ModLoader.AddRecipe(
        new ItemStack(factotum, 1),
        new Object[] {
          " ll",
          "hbk",
          " ll",
          Character.valueOf('h'),
          new ItemStack(stuffs, 1, 12),
          Character.valueOf('b'),
          new ItemStack(stuffs, 1, 14),
          Character.valueOf('k'),
          new ItemStack(stuffs, 1, 13),
          Character.valueOf('l'),
          new ItemStack(stuffs, 1, 3)
        });

    ModLoader.AddRecipe(
        new ItemStack(Block.workbench, 1),
        new Object[] {"DD", "DD", Character.valueOf('D'), new ItemStack(tech, 1, 1)});

    ModLoader.AddRecipe(
        new ItemStack(smack, 1),
        new Object[] {
          " S",
          "i ",
          Character.valueOf('S'),
          boing,
          Character.valueOf('i'),
          new ItemStack(stuffs, 1, 4)
        });

    ModLoader.AddShapelessRecipe(
        new ItemStack(Item.gunpowder, 3),
        new Object[] {
          new ItemStack(stuffs, 1, 10), new ItemStack(stuffs, 1, 11), new ItemStack(stuffs, 1, 9)
        });

    /// BAD///
    ModLoader.AddRecipe(
        new ItemStack(frass, 1, 1),
        new Object[] {"##", "##", Character.valueOf('#'), Item.redstone});

    ModLoader.AddRecipe(
        new ItemStack(frass, 64, 1), new Object[] {"##", "##", Character.valueOf('#'), Block.dirt});

    ModLoader.AddRecipe(
        new ItemStack(cheatStick, 1), new Object[] {"##", "##", Character.valueOf('#'), frass});

    ModLoader.AddRecipe(
        new ItemStack(Block.reed, 50),
        new Object[] {"##", "# ", Character.valueOf('#'), Block.dirt});
    ModLoader.AddRecipe(
        new ItemStack(stuffs, 10, 10), new Object[] {"#", "#", Character.valueOf('#'), frass});
    ModLoader.AddRecipe(
        new ItemStack(Item.ingotIron, 10, 0),
        new Object[] {" #", "##", Character.valueOf('#'), Block.dirt});
    ModLoader.AddRecipe(
        new ItemStack(arbor, 64), new Object[] {"##", Character.valueOf('#'), frass});
    ModLoader.AddRecipe(
        new ItemStack(stuffs, 10, 11), new Object[] {"# ", " #", Character.valueOf('#'), frass});

    /*
    System.out.println("\nall tech biomes is " +((AutomatonLogger.allTech==1)?"on":"off"));
    if(AutomatonLogger.allTech==1){
    	BiomeGenBase.generateBiomeLookup();
    }*/

    // defaultTerrain=ModLoader.getMinecraftInstance().renderEngine.getTexture("/terrain.png");

    // AutomatonLogger.tvRenderId=ModLoader.getUniqueBlockModelID(this,true);
    // ModLoader.SetInGameHook(this,true,true);

  }
Ejemplo n.º 12
0
 public static int GetDamageVS(Item item, EntityLiving living) {
   return GetDamageVS(item.getDamageVsEntity(living), living);
 }
Ejemplo n.º 13
0
  public static List func_77513_b(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_) {
    Item var3 = p_77513_1_.func_77973_b();
    int var4 = var3.func_77619_b();
    if (var4 <= 0) {
      return null;
    } else {
      var4 /= 2;
      var4 = 1 + p_77513_0_.nextInt((var4 >> 1) + 1) + p_77513_0_.nextInt((var4 >> 1) + 1);
      int var5 = var4 + p_77513_2_;
      float var6 = (p_77513_0_.nextFloat() + p_77513_0_.nextFloat() - 1.0F) * 0.15F;
      int var7 = (int) ((float) var5 * (1.0F + var6) + 0.5F);
      if (var7 < 1) {
        var7 = 1;
      }

      ArrayList var8 = null;
      Map var9 = func_77505_b(var7, p_77513_1_);
      if (var9 != null && !var9.isEmpty()) {
        EnchantmentData var10 =
            (EnchantmentData) WeightedRandom.func_76271_a(p_77513_0_, var9.values());
        if (var10 != null) {
          var8 = new ArrayList();
          var8.add(var10);

          for (int var11 = var7; p_77513_0_.nextInt(50) <= var11; var11 >>= 1) {
            Iterator var12 = var9.keySet().iterator();

            while (var12.hasNext()) {
              Integer var13 = (Integer) var12.next();
              boolean var14 = true;
              Iterator var15 = var8.iterator();

              while (true) {
                if (var15.hasNext()) {
                  EnchantmentData var16 = (EnchantmentData) var15.next();
                  if (var16.field_76302_b.func_77326_a(
                      Enchantment.field_77331_b[var13.intValue()])) {
                    continue;
                  }

                  var14 = false;
                }

                if (!var14) {
                  var12.remove();
                }
                break;
              }
            }

            if (!var9.isEmpty()) {
              EnchantmentData var17 =
                  (EnchantmentData) WeightedRandom.func_76271_a(p_77513_0_, var9.values());
              var8.add(var17);
            }
          }
        }
      }

      return var8;
    }
  }