@Override
  public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
    NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
    World world = player.worldObj;
    int bID = player.worldObj.getBlockId(x, y, z);
    int meta = world.getBlockMetadata(x, y, z);
    Block block = Block.blocksList[bID];
    if (block == null || bID < 1) return false;
    int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
    int shlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getSecondHarvestType());

    if (hlvl <= tags.getInteger("HarvestLevel") && shlvl <= tags.getInteger("HarvestLevel2")) {
      boolean cancelHarvest = false;
      for (ActiveToolMod mod : TConstructRegistry.activeModifiers) {
        if (mod.beforeBlockBreak(this, stack, x, y, z, player)) cancelHarvest = true;
      }

      return cancelHarvest;
    } else {
      if (!player.capabilities.isCreativeMode) onBlockDestroyed(stack, world, bID, x, y, z, player);
      world.setBlockToAir(x, y, z);
      if (!world.isRemote) world.playAuxSFX(2001, x, y, z, bID + (meta << 12));
      return true;
    }
  }
  @EventHandler // used in 1.6.2
  // @Init       // used in 1.5.2
  public void load(FMLInitializationEvent event) {
    //      proxy.registerRenderers();
    MinecraftForge.EVENT_BUS.register(new VampireEventHandler());

    LanguageRegistry.addName(BloodtapEmpty, "Empty Bloodtap");
    LanguageRegistry.addName(Bloodtap, "Filled Bloodtap");
    LanguageRegistry.addName(BottledBlood, "Bottle of Blood");

    // Recipes
    GameRegistry.addRecipe(
        new ItemStack(BloodtapEmpty),
        "xxx",
        "zyx",
        'x',
        new ItemStack(Item.stick),
        'y',
        new ItemStack(Item.glassBottle),
        'z',
        new ItemStack(Item.ingotIron));

    GameRegistry.addRecipe(
        new ItemStack(RunicBrick),
        "rdr",
        "dod",
        "rdr",
        'r',
        new ItemStack(Item.redstone),
        'd',
        new ItemStack(Item.diamond),
        'o',
        new ItemStack(Block.obsidian));

    LanguageRegistry.addName(RuneCraftingTable, "Runecrafting Table");
    MinecraftForge.setBlockHarvestLevel(RuneCraftingTable, "pickaxe", 2);
    GameRegistry.registerBlock(RuneCraftingTable, "RuneCraftingTable");

    LanguageRegistry.addName(RunicBrick, "Runic Brick");
    MinecraftForge.setBlockHarvestLevel(RunicBrick, "pickaxe", 5);
    GameRegistry.registerBlock(RunicBrick, "RunicBrick");

    LanguageRegistry.instance()
        .addStringLocalization("achievement.vampirism", "en_US", "Became a vampire!");
    LanguageRegistry.instance()
        .addStringLocalization("achievement.vampirism.desc", "en_US", "You (sort of) died!");

    LanguageRegistry.instance()
        .addStringLocalization("achievement.immortality", "en_US", "Became an original");
    LanguageRegistry.instance()
        .addStringLocalization(
            "achievement.immortality.desc", "en_US", "Hope you made the right call.");

    AchievementPage.registerAchievementPage(page1);
  }
Example #3
0
  public static void loadNames() {
    LanguageRegistry.addName(oreCopper, BlockOreRef.ORE_COPPER_NAME);
    MinecraftForge.setBlockHarvestLevel(oreCopper, "pickaxe", 1);

    LanguageRegistry.addName(oreTin, BlockOreRef.ORE_TIN_NAME);
    MinecraftForge.setBlockHarvestLevel(oreTin, "pickaxe", 1);

    LanguageRegistry.addName(oreZinc, BlockOreRef.ORE_ZINC_NAME);
    MinecraftForge.setBlockHarvestLevel(oreZinc, "pickaxe", 1);

    LanguageRegistry.addName(steamBoiler, BlockMachineRef.MACHINE_STEAM_BOILER_NAME);
    MinecraftForge.setBlockHarvestLevel(steamBoiler, "pickaxe", 1);
  }
Example #4
0
 public static void initOreHarvestLevels() {
   MinecraftForge.setBlockHarvestLevel(oreBornite, 0, "pickaxe", 1);
   MinecraftForge.setBlockHarvestLevel(oreBrimstone, 0, "pickaxe", 1);
   MinecraftForge.setBlockHarvestLevel(orePhosphate, 0, "pickaxe", 2);
   MinecraftForge.setBlockHarvestLevel(oreUranite, 0, "pickaxe", 2);
   MinecraftForge.setBlockHarvestLevel(oreVolucite, 0, "pickaxe", 4);
   MinecraftForge.setBlockHarvestLevel(oreAluminum, 0, "pickaxe", 1);
   MinecraftForge.setBlockHarvestLevel(oreCopper, 0, "pickaxe", 1);
   MinecraftForge.setBlockHarvestLevel(oreTin, 0, "pickaxe", 1);
   MinecraftForge.setBlockHarvestLevel(oreZinc, 0, "pickaxe", 1);
 }
Example #5
0
 public HeatSand(int par1) {
   super(par1);
   this.setHardness(3f);
   this.setStepSound(Block.soundSandFootstep);
   this.setCreativeTab(NaturaTab.tab);
   MinecraftForge.setBlockHarvestLevel(this, "shovel", 0);
 }
  float calculateStrength(NBTTagCompound tags, Block block, int meta) {
    float mineSpeed = tags.getInteger("MiningSpeed");
    int heads = 1;
    if (tags.hasKey("MiningSpeed2")) {
      mineSpeed += tags.getInteger("MiningSpeed2");
      heads++;
    }

    if (tags.hasKey("MiningSpeedHandle")) {
      mineSpeed += tags.getInteger("MiningSpeedHandle");
      heads++;
    }

    if (tags.hasKey("MiningSpeedExtra")) {
      mineSpeed += tags.getInteger("MiningSpeedExtra");
      heads++;
    }
    float trueSpeed = mineSpeed / (heads * 100f);
    int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
    int durability = tags.getInteger("Damage");

    float stonebound = tags.getFloat("Shoddy");
    float bonusLog = (float) Math.log(durability / 72f + 1) * 2 * stonebound;
    trueSpeed += bonusLog;

    if (hlvl <= tags.getInteger("HarvestLevel")) return trueSpeed;
    return 0.1f;
  }
Example #7
0
  public static void registerBlockMachineBeta() {
    if (blockMachineBeta == null) {
      int var0 = Config.getBlockID("blocks.base.harmoniontank.id");

      if (var0 > 0) {
        int var1 = Harmonion.proxy.getRenderIdTank();
        int[] var2 = new int[16];
        Arrays.fill(var2, 255);
        var2[EnumMachineBeta.TANK_IRON_WALL.ordinal()] = 0;
        var2[EnumMachineBeta.TANK_IRON_VALVE.ordinal()] = 0;
        var2[EnumMachineBeta.TANK_IRON_GAUGE.ordinal()] = 0;
        blockMachineBeta =
            (new net.Harmonion.tanks.BlockMachine(var0, var1, new MachineProxyBeta(), false, var2))
                .setBlockName("rcBlockMachineBeta");
        GameRegistry.registerBlock(
            blockMachineBeta, ItemMachine.class, blockMachineBeta.getBlockName());
        EnumMachineBeta[] var3 = EnumMachineBeta.values();
        int var4 = var3.length;

        for (int var5 = 0; var5 < var4; ++var5) {
          EnumMachineBeta var6 = var3[var5];
          MinecraftForge.setBlockHarvestLevel(blockMachineBeta, var6.ordinal(), "pickaxe", 2);
        }
      }
    }
  }
  public BlockTradeStation(int id) {
    super(id, new Material(MapColor.stoneColor));
    setHardness(1.0f);

    setCreativeTab(CreativeTabs.tabMisc);

    MinecraftForge.setBlockHarvestLevel(this, "pickaxe", 2);
  }
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    RegisterBlocks.register();
    RegisterItems.register();
    RegisterTileEntities.register();

    MinecraftForge.addGrassSeed(new ItemStack(RegisterItems.flaxSeeds), 10);
  }
  public static void registerBlocks() {
    // Register Blocks//
    GameRegistry.registerBlock(AC.netherStarBlock, "netherStarBlock");
    MinecraftForge.setBlockHarvestLevel(AC.netherStarBlock, "pickaxe", 4);

    GameRegistry.registerBlock(AC.netherStarOre, "netherStarOre");
    MinecraftForge.setBlockHarvestLevel(AC.netherStarOre, "pickaxe", 3);

    // GameRegistry.registerBlock(AC.mobCurtain, "mobCurtain");
    GameRegistry.registerBlock(AC.nerdPole, "nerdPole");
    GameRegistry.registerBlock(AC.cobblestoneGenerator, "cobblestoneGenerator");
    GameRegistry.registerBlock(AC.LiquidRemove_Holder, "LiquidRemove_Holder");
    GameRegistry.registerBlock(AC.RemoteInterface, "RemoteInterface");

    // GameRegistry.registerBlock(advancedFurnaceIdle,
    // "advancedFurnaceIdle");
    // LanguageRegistry.addName(advancedFurnaceIdle, "Advanced Furnace");
    // MinecraftForge.setBlockHarvestLevel(advancedFurnaceIdle, "pickaxe",
    // 1);
  }
  @Init
  public void init(FMLInitializationEvent event) {
    /*
     * Register blocks to forge
     */
    LanguageRegistry.addName(blockDetector, "Detector");
    MinecraftForge.setBlockHarvestLevel(blockDetector, "pickaxe", 3);
    GameRegistry.registerBlock(blockDetector, "Detector");
    GameRegistry.registerTileEntity(TileDetector.class, "containerDetector");

    NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler());
  }
Example #12
0
  public static void configure(Config config) {
    blockInfernalFurnace =
        (new BlockInfernalFurnace(config.blockIdInfernalFurnace))
            .setUnlocalizedName("infernalfurnace")
            .setCreativeTab(Config.tabDwarvenTools);
    blockDwarvenOre =
        (new BlockDwarvenOre(config.blockIdBlockDwarvenOre))
            .setUnlocalizedName("blockDwarvenOre")
            .setCreativeTab(Config.tabDwarvenTools);
    blockDwarvenOreStorage =
        (new BlockDwarvenOreStorage(config.blockIdBlockDwarvenOreStorage))
            .setUnlocalizedName("blockDwarvenOreStorage")
            .setCreativeTab(Config.tabDwarvenTools);

    GameRegistry.registerBlock(blockDwarvenOre, ItemDwarvenOre.class, "DwarvenOre");
    GameRegistry.registerBlock(
        blockDwarvenOreStorage, ItemDwarvenOreStorage.class, "DwarvenOreStorage");

    GameRegistry.registerBlock(blockInfernalFurnace, "InfernalFurnace");

    MinecraftForge.setBlockHarvestLevel(blockDwarvenOre, 0, "pickaxe", 2);
    MinecraftForge.setBlockHarvestLevel(blockDwarvenOre, 1, "pickaxe", 3);
    MinecraftForge.setBlockHarvestLevel(blockDwarvenOreStorage, 0, "pickaxe", 2);
    MinecraftForge.setBlockHarvestLevel(blockDwarvenOreStorage, 1, "pickaxe", 2);
    MinecraftForge.setBlockHarvestLevel(blockDwarvenOreStorage, 2, "pickaxe", 3);

    MinecraftForge.setBlockHarvestLevel(blockInfernalFurnace, "pickaxe", 1);

    GameRegistry.registerTileEntity(TileEntityInfernalFurnace.class, "InfernalFurnace");
  }
  @Override
  public float getStrVsBlock(ItemStack stack, Block block, int meta) {

    NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
    if (tags.getBoolean("Broken")) return 0.1f;

    Material[] materials = getEffectiveMaterials();
    for (int i = 0; i < materials.length; i++) {
      if (materials[i] == block.blockMaterial) {
        float speed = tags.getInteger("MiningSpeed");
        speed /= 100f;
        int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
        int durability = tags.getInteger("Damage");

        float shoddy = tags.getFloat("Shoddy");
        speed += shoddy * durability / 100f;

        if (hlvl <= tags.getInteger("HarvestLevel")) return speed;
        return 0.1f;
      }
    }
    materials = getEffectiveSecondaryMaterials();
    for (int i = 0; i < materials.length; i++) {
      if (materials[i] == block.blockMaterial) {
        float speed = tags.getInteger("MiningSpeed2");
        speed /= 100f;
        int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
        int durability = tags.getInteger("Damage");

        float shoddy = tags.getFloat("Shoddy");
        speed += shoddy * durability / 100f;

        if (hlvl <= tags.getInteger("HarvestLevel2")) return speed;
        return 0.1f;
      }
    }
    return super.getStrVsBlock(stack, block, meta);
  }
Example #14
0
  public static void init() {
    // Initialize mod items
    baconRaw =
        new ItemMFMFood(ItemIds.BACON_RAW, 2, 0.2F, true)
            .setUnlocalizedName(Strings.BACON_RAW_NAME);
    baconCooked =
        new ItemMFMFood(ItemIds.BACON_COOKED, 5, 0.5F, true)
            .setUnlocalizedName(Strings.BACON_COOKED_NAME);
    lettuce =
        new ItemMFMFood(ItemIds.LETTUCE, 2, 0.2F, false).setUnlocalizedName(Strings.LETTUCE_NAME);
    lettuceSeeds =
        new ItemMFMSeeds(
                ItemIds.LETTUCE_SEEDS, ModBlocks.lettucePlant.blockID, Block.tilledField.blockID)
            .setUnlocalizedName(Strings.LETTUCE_SEEDS_NAME);
    tomato =
        new ItemMFMFood(ItemIds.TOMATO, 2, 0.2F, false).setUnlocalizedName(Strings.TOMATO_NAME);
    tomatoSeeds =
        new ItemMFMSeeds(
                ItemIds.TOMATO_SEEDS, ModBlocks.tomatoPlant.blockID, Block.tilledField.blockID)
            .setUnlocalizedName(Strings.TOMATO_SEEDS_NAME);
    blt = new ItemMFMFood(ItemIds.BLT, 10, 1.0F, false).setUnlocalizedName(Strings.BLT_NAME);

    // Add recipes
    FurnaceRecipes.smelting().addSmelting(baconRaw.itemID, new ItemStack(baconCooked), 0.35F);

    GameRegistry.addShapelessRecipe(
        new ItemStack(blt),
        new Object[] {
          new ItemStack(baconCooked), new ItemStack(tomato),
          new ItemStack(lettuce), new ItemStack(Item.bread)
        });
    GameRegistry.addShapelessRecipe(
        new ItemStack(tomatoSeeds), new Object[] {new ItemStack(tomato)});

    MinecraftForge.addGrassSeed(new ItemStack(lettuceSeeds), 2);
    MinecraftForge.addGrassSeed(new ItemStack(tomatoSeeds), 2);
  }
Example #15
0
  @Override
  public float getStrVsBlock(ItemStack stack, Block block, int meta) {
    if (!stack.hasTagCompound()) return 1.0f;

    NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
    if (tags.getBoolean("Broken")) return 0.1f;

    Material[] materials = getEffectiveMaterials();
    for (int i = 0; i < materials.length; i++) {
      if (materials[i] == block.blockMaterial) {
        return calculateStrength(tags, block, meta);
      }
    }
    if (MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()) > 0) {
      return calculateStrength(tags, block, meta); // No issue if the harvest level is too low
    }
    return super.getStrVsBlock(stack, block, meta);
  }
  @Override
  public boolean canHarvestBlock(Block block) {
    if (block == Block.oreDiamond) {
      return this.getMaterial().getHarvestLevel() >= 2
          && this.getMaterial() != ToolMaterialMedieval.BRONZE;
    }
    if (block == Block.oreIron) {
      return this.getMaterial().getHarvestLevel() >= 2;
    }
    if (block == Block.obsidian) {
      return this.getMaterial().getHarvestLevel() >= 3;
    }

    int harvest = MinecraftForge.getBlockHarvestLevel(block, 0, "pickaxe");
    if (this.getMaterial().getHarvestLevel() >= harvest) {
      return true;
    }
    return super.canHarvestBlock(block);
  }
Example #17
0
  @Mod.EventHandler
  @Override
  public void preLoad(FMLPreInitializationEvent event) {
    super.preLoad(event);
    BushManager.populateBushInfo();

    try {
      config.load();

      dummyLeaves = new BlockFruitLeavesDummy();

      debug = config.get(Configuration.CATEGORY_GENERAL, "debug", false).getBoolean(false);
      bonemealingAllowed =
          config.get(Configuration.CATEGORY_GENERAL, "bonemeal", true).getBoolean(true);

      for (int i = 0; i < leavesBlocksAllocated; i++) {
        leavesList.add(new LeavesInfo(i));
      }

      ItemBagPlanting.blackList()
          .loadFromString(
              config
                  .get(
                      Configuration.CATEGORY_GENERAL,
                      "plantingBagBlackList",
                      "",
                      "Planting bag will ignore these items. Format of item (separated by ',' or ';'): <id>[:meta]")
                  .getString());
      ItemBagPlanting.blackList().printToLog(Log);
      TileFruitCollector.fruitCollectorRange =
          config.get(Configuration.CATEGORY_GENERAL, "fruitCollectorRange", 16).getInt();
    } catch (Exception e) {
      FMLLog.log(Level.FATAL, e, "Mod Jaffas (trees) can't read config file.");
    } finally {
      config.save();
    }

    if (!ModuleManager.isModuleEnabled(ModulesEnum.trees)) return;

    creativeTab = new JaffaCreativeTab("jaffas.trees");
    guiHandler = new GuiHandlerTrees();
    NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);

    JaffasRegistryHelper.registerTileEntity(TileFruitLeaves.class, "fruitLeaves");
    JaffasRegistryHelper.registerTileEntity(TileJaffaCrops.class, "jaffaCrops");

    CompostRegister.init();
    createItems();

    MinecraftForge.addGrassSeed(new ItemStack(itemUnknownSeeds), SEEDS_WEIGHT);

    installRecipes();

    // texture stuff
    proxy.registerRenderThings();

    registerForestryStuff();

    creativeTab.setup(ItemManager.getItem(JaffaItem.oranges));
    LanguageRegistry.instance()
        .addStringLocalization("itemGroup.jaffas.trees", "en_US", "Jaffas and more! Trees");
  }
  @Override
  public void init() {
    GameRegistry.registerWorldGenerator(GenerationManager.instance);

    itemWoolGin = new ItemWoolGin(Configurator.item_woolginID.getInt());
    itemBackpack = new ItemBackpack(Configurator.item_backpackID.getInt());

    blockOres = new BlockOre(Configurator.block_oresID.getInt());
    GameRegistry.registerBlock(blockOres, ItemBlockOre.class, "projectred.exploration.ore");
    for (EnumOre o : EnumOre.VALID_ORES) {
      MinecraftForge.setBlockHarvestLevel(blockOres, "pickaxe", o.harvesLevel);
    }

    blockStones = new BlockSpecialStone(Configurator.block_stonesID.getInt());
    GameRegistry.registerBlock(
        blockStones, ItemBlockSpecialStone.class, "projectred.exploration.stone");

    if (Configurator.gen_SpreadingMoss.getBoolean(true)) {
      int mc = Block.cobblestoneMossy.blockID;
      Block.blocksList[mc] = null;
      new BlockPhotosyntheticCobblestone(mc);

      int sb = Block.stoneBrick.blockID;
      Block.blocksList[sb] = null;
      new BlockPhotosyntheticStoneBrick(sb);
    }

    toolMaterialRuby = EnumHelper.addToolMaterial("RUBY", 2, 500, 8.0F, 4, 12);
    toolMaterialSapphire = EnumHelper.addToolMaterial("SAPPHIRE", 2, 500, 8.0F, 3, 16);
    toolMaterialPeridot = EnumHelper.addToolMaterial("PERIDOT", 2, 500, 8.75F, 3.25F, 12);

    itemRubyAxe = new ItemGemAxe(Configurator.item_rubyAxe.getInt(), EnumSpecialTool.RUBYAXE);
    itemSapphireAxe =
        new ItemGemAxe(Configurator.item_sapphireAxe.getInt(), EnumSpecialTool.SAPPHIREAXE);
    itemPeridotAxe =
        new ItemGemAxe(Configurator.item_peridotAxe.getInt(), EnumSpecialTool.PERIDOTAXE);
    MinecraftForge.setToolClass(itemRubyAxe, "axe", 2);
    MinecraftForge.setToolClass(itemSapphireAxe, "axe", 2);
    MinecraftForge.setToolClass(itemPeridotAxe, "axe", 2);

    itemRubyHoe = new ItemGemHoe(Configurator.item_rubyHoe.getInt(), EnumSpecialTool.RUBYHOE);
    itemSapphireHoe =
        new ItemGemHoe(Configurator.item_sapphireHoe.getInt(), EnumSpecialTool.SAPPHIREHOE);
    itemPeridotHoe =
        new ItemGemHoe(Configurator.item_peridotHoe.getInt(), EnumSpecialTool.PERIDOTHOE);
    MinecraftForge.setToolClass(itemRubyHoe, "hoe", 2);
    MinecraftForge.setToolClass(itemSapphireHoe, "hoe", 2);
    MinecraftForge.setToolClass(itemPeridotHoe, "hoe", 2);

    itemRubyPickaxe =
        new ItemGemPickaxe(Configurator.item_rubyPickaxe.getInt(), EnumSpecialTool.RUBYPICKAXE);
    itemSapphirePickaxe =
        new ItemGemPickaxe(
            Configurator.item_sapphirePickaxe.getInt(), EnumSpecialTool.SAPPHIREPICKAXE);
    itemPeridotPickaxe =
        new ItemGemPickaxe(
            Configurator.item_peridotPickaxe.getInt(), EnumSpecialTool.PERIDOTPICKAXE);
    MinecraftForge.setToolClass(itemRubyPickaxe, "pickaxe", 2);
    MinecraftForge.setToolClass(itemSapphirePickaxe, "pickaxe", 2);
    MinecraftForge.setToolClass(itemPeridotPickaxe, "pickaxe", 2);

    itemRubyShovel =
        new ItemGemShovel(Configurator.item_rubyShovel.getInt(), EnumSpecialTool.RUBYSHOVEL);
    itemSapphireShovel =
        new ItemGemShovel(
            Configurator.item_sapphireShovel.getInt(), EnumSpecialTool.SAPPHIRESHOVEL);
    itemPeridotShovel =
        new ItemGemShovel(Configurator.item_peridotShovel.getInt(), EnumSpecialTool.PERIDOTSHOVEL);
    MinecraftForge.setToolClass(itemRubyShovel, "shovel", 2);
    MinecraftForge.setToolClass(itemSapphireShovel, "shovel", 2);
    MinecraftForge.setToolClass(itemPeridotShovel, "shovel", 2);

    itemRubySword =
        new ItemGemSword(Configurator.item_rubySword.getInt(), EnumSpecialTool.RUBYSWORD);
    itemSapphireSword =
        new ItemGemSword(Configurator.item_sapphireSword.getInt(), EnumSpecialTool.SAPPHIRESWORD);
    itemPeridotSword =
        new ItemGemSword(Configurator.item_peridotSword.getInt(), EnumSpecialTool.PERIDOTSWORD);
    MinecraftForge.setToolClass(itemRubySword, "sword", 2);
    MinecraftForge.setToolClass(itemSapphireSword, "sword", 2);
    MinecraftForge.setToolClass(itemPeridotSword, "sword", 2);

    itemWoodSaw = new ItemGemSaw(Configurator.item_woodSaw.getInt(), EnumSpecialTool.WOODSAW);
    itemStoneSaw = new ItemGemSaw(Configurator.item_stoneSaw.getInt(), EnumSpecialTool.STONESAW);
    itemIronSaw = new ItemGemSaw(Configurator.item_ironSaw.getInt(), EnumSpecialTool.IRONSAW);
    itemGoldSaw = new ItemGemSaw(Configurator.item_goldSaw.getInt(), EnumSpecialTool.GOLDSAW);
    itemRubySaw = new ItemGemSaw(Configurator.item_rubySaw.getInt(), EnumSpecialTool.RUBYSAW);
    itemSapphireSaw =
        new ItemGemSaw(Configurator.item_sapphireSaw.getInt(), EnumSpecialTool.SAPPHIRESAW);
    itemPeridotSaw =
        new ItemGemSaw(Configurator.item_peridotSaw.getInt(), EnumSpecialTool.PERIDOTSAW);
    itemDiamondSaw =
        new ItemGemSaw(Configurator.item_diamondSaw.getInt(), EnumSpecialTool.DIAMONDSAW);

    itemWoodSickle =
        new ItemGemSickle(Configurator.item_woodSickle.getInt(), EnumSpecialTool.WOODSICKLE);
    itemStoneSickle =
        new ItemGemSickle(Configurator.item_stoneSickle.getInt(), EnumSpecialTool.STONESICKLE);
    itemIronSickle =
        new ItemGemSickle(Configurator.item_ironSickle.getInt(), EnumSpecialTool.IRONSICKLE);
    itemGoldSickle =
        new ItemGemSickle(Configurator.item_goldSickle.getInt(), EnumSpecialTool.GOLDSICKLE);
    itemRubySickle =
        new ItemGemSickle(Configurator.item_rubySickle.getInt(), EnumSpecialTool.RUBYSICKLE);
    itemSapphireSickle =
        new ItemGemSickle(
            Configurator.item_sapphireSickle.getInt(), EnumSpecialTool.SAPPHIRESICKLE);
    itemPeridotSickle =
        new ItemGemSickle(Configurator.item_peridotSickle.getInt(), EnumSpecialTool.PERIDOTSICKLE);
    itemDiamondSickle =
        new ItemGemSickle(Configurator.item_diamondSickle.getInt(), EnumSpecialTool.DIAMONDSICKLE);

    for (EnumSpecialStone s : EnumSpecialStone.VALID_STONE) {
      MicroMaterialRegistry.registerMaterial(
          new BlockMicroMaterial(ProjectRedExploration.blockStones, s.meta),
          ProjectRedExploration.blockStones.getUnlocalizedName()
              + (s.meta > 0 ? "_" + s.meta : ""));
    }
  }
Example #19
0
  private void registerBlocks() {
    orePlasma = new BlockPlasmaOre(oreBlockID, orePlutoniumIndex).setLightValue(0.5334f);
    GameRegistry.registerBlock(
        orePlasma, com.elvenwater.malkierian.Plasmacraft.common.ItemPlasmaOre.class);
    LanguageRegistry.addName(new ItemStack(orePlasma, 1, plutoniumMeta), "Plutonium Ore");
    LanguageRegistry.addName(new ItemStack(orePlasma, 1, radioniteMeta), "Radionite Ore");
    LanguageRegistry.addName(new ItemStack(orePlasma, 1, uraniumMeta), "Uranium Ore");
    LanguageRegistry.addName(new ItemStack(orePlasma, 1, neptuniumMeta), "Neptunium Ore");
    LanguageRegistry.addName(new ItemStack(orePlasma, 1, obsidiumMeta), "Obsidium Ore");

    oreLeadBlock =
        new BlockOre(oreLeadBlockID, oreLeadIndex).setLightValue(0.0f).setBlockName("Lead Ore");
    oreLeadBlock.setTextureFile(CommonProxy.BLOCK_PNG);
    GameRegistry.registerBlock(oreLeadBlock);
    LanguageRegistry.addName(oreLeadBlock, "Lead Ore");

    MinecraftForge.setBlockHarvestLevel(orePlasma, obsidiumMeta, "pickaxe", 3);
    MinecraftForge.setBlockHarvestLevel(orePlasma, uraniumMeta, "pickaxe", 2);
    MinecraftForge.setBlockHarvestLevel(orePlasma, radioniteMeta, "pickaxe", 2);
    MinecraftForge.setBlockHarvestLevel(orePlasma, plutoniumMeta, "pickaxe", 2);
    MinecraftForge.setBlockHarvestLevel(orePlasma, neptuniumMeta, "pickaxe", 1);
    MinecraftForge.setBlockHarvestLevel(oreLeadBlock, "pickaxe", 1);
    // MinecraftForge.setBlockHarvestLevel(frozenCryonite, "pickaxe", 1);

    acidMoving =
        (new BlockCausticFlowing(
                acidFlowingBlockID,
                acidStillIndex,
                acidMovingIndex,
                causticID,
                acidStillBlockID,
                acidFlowingBlockID))
            .setBlockName("acidMoving");
    acidStill =
        (new BlockCausticStationary(
                acidStillBlockID,
                acidStillIndex,
                acidMovingIndex,
                causticID,
                acidStillBlockID,
                acidFlowingBlockID,
                1.0F))
            .setBlockName("acidStill");
    cryoniteMoving =
        (new BlockCausticFlowing(
                cryoniteFlowingBlockID,
                cryoniteStillIndex,
                cryoniteMovingIndex,
                causticID,
                cryoniteStillBlockID,
                cryoniteFlowingBlockID))
            .setBlockName("cryoniteMoving");
    cryoniteStill =
        (new BlockCausticStationary(
                cryoniteStillBlockID,
                cryoniteStillIndex,
                cryoniteMovingIndex,
                causticID,
                cryoniteStillBlockID,
                cryoniteFlowingBlockID,
                0.0F))
            .setBlockName("cryoniteStill");
    neptuniumMoving =
        (new BlockCausticFlowing(
                neptuniumFlowingBlockID,
                neptuniumStillIndex,
                neptuniumMovingIndex,
                causticID,
                neptuniumStillBlockID,
                neptuniumFlowingBlockID))
            .setBlockName("neptuniumMoving");
    neptuniumStill =
        (new BlockCausticStationary(
                neptuniumStillBlockID,
                neptuniumStillIndex,
                neptuniumMovingIndex,
                causticID,
                neptuniumStillBlockID,
                neptuniumFlowingBlockID,
                1.0F))
            .setBlockName("neptuniumStill");
    netherflowMoving =
        (new BlockCausticFlowing(
                netherflowFlowingBlockID,
                netherflowStillIndex,
                netherflowMovingIndex,
                causticID,
                netherflowStillBlockID,
                netherflowFlowingBlockID))
            .setBlockName("netherflowMoving");
    netherflowStill =
        (new BlockCausticStationary(
                netherflowStillBlockID,
                netherflowStillIndex,
                netherflowMovingIndex,
                causticID,
                netherflowStillBlockID,
                netherflowFlowingBlockID,
                1.0F))
            .setBlockName("netherflowStill");
    obsidiumMoving =
        (new BlockCausticFlowing(
                obsidiumFlowingBlockID,
                obsidiumStillIndex,
                obsidiumMovingIndex,
                causticID,
                obsidiumStillBlockID,
                obsidiumFlowingBlockID))
            .setBlockName("obsidiumMoving");
    obsidiumStill =
        (new BlockCausticStationary(
                obsidiumStillBlockID,
                obsidiumStillIndex,
                obsidiumMovingIndex,
                causticID,
                obsidiumStillBlockID,
                obsidiumFlowingBlockID,
                1.0F))
            .setBlockName("obsidiumStill");
    plutoniumMoving =
        (new BlockCausticFlowing(
                plutoniumFlowingBlockID,
                plutoniumStillIndex,
                plutoniumMovingIndex,
                causticID,
                plutoniumStillBlockID,
                plutoniumFlowingBlockID))
            .setBlockName("plutoniumMoving");
    plutoniumStill =
        (new BlockCausticStationary(
                plutoniumStillBlockID,
                plutoniumStillIndex,
                plutoniumMovingIndex,
                causticID,
                plutoniumStillBlockID,
                plutoniumFlowingBlockID,
                1.0F))
            .setBlockName("plutoniumStill");
    radioniteMoving =
        (new BlockCausticFlowing(
                radioniteFlowingBlockID,
                radioniteStillIndex,
                radioniteMovingIndex,
                causticID,
                radioniteStillBlockID,
                radioniteFlowingBlockID))
            .setBlockName("radioniteMoving");
    radioniteStill =
        (new BlockCausticStationary(
                radioniteStillBlockID,
                radioniteStillIndex,
                radioniteMovingIndex,
                causticID,
                radioniteStillBlockID,
                radioniteFlowingBlockID,
                1.0F))
            .setBlockName("radioniteStill");
    uraniumMoving =
        (new BlockCausticFlowing(
                uraniumFlowingBlockID,
                uraniumStillIndex,
                uraniumMovingIndex,
                causticID,
                uraniumStillBlockID,
                uraniumFlowingBlockID))
            .setBlockName("uraniumMoving");
    uraniumStill =
        (new BlockCausticStationary(
                uraniumStillBlockID,
                uraniumStillIndex,
                uraniumMovingIndex,
                causticID,
                uraniumStillBlockID,
                uraniumFlowingBlockID,
                1.0F))
            .setBlockName("uraniumStill");
    GameRegistry.registerBlock(acidMoving);
    //        GameRegistry.registerBlock(acidStill);
    GameRegistry.registerBlock(cryoniteMoving);
    //        GameRegistry.registerBlock(cryoniteStill);
    GameRegistry.registerBlock(neptuniumMoving);
    //        GameRegistry.registerBlock(neptuniumStill);
    GameRegistry.registerBlock(netherflowMoving);
    //        GameRegistry.registerBlock(netherflowStill);
    GameRegistry.registerBlock(obsidiumMoving);
    //        GameRegistry.registerBlock(obsidiumStill);
    GameRegistry.registerBlock(plutoniumMoving);
    //        GameRegistry.registerBlock(plutoniumStill);
    GameRegistry.registerBlock(radioniteMoving);
    //        GameRegistry.registerBlock(radioniteStill);
    GameRegistry.registerBlock(uraniumMoving);
    //        GameRegistry.registerBlock(uraniumStill);
    LanguageRegistry.addName(acidMoving, "Acid");
    // LanguageRegistry.addName(acidStill, "Acid Still");
    LanguageRegistry.addName(cryoniteMoving, "Cryonite");
    // LanguageRegistry.addName(cryoniteStill, "Cryonite Still");
    LanguageRegistry.addName(neptuniumMoving, "Neptunium");
    // LanguageRegistry.addName(neptuniumStill, "Neptunium Still");
    LanguageRegistry.addName(netherflowMoving, "Netherflow");
    // LanguageRegistry.addName(netherflowStill, "Netherflow Still");
    LanguageRegistry.addName(obsidiumMoving, "Obsidium");
    // LanguageRegistry.addName(obsidiumStill, "Obsidium Still");
    LanguageRegistry.addName(plutoniumMoving, "Plutonium");
    // LanguageRegistry.addName(plutoniumStill, "Plutonium Still");
    LanguageRegistry.addName(radioniteMoving, "Radionite");
    // LanguageRegistry.addName(radioniteStill, "Radionite Still");
    LanguageRegistry.addName(uraniumMoving, "Uranium");
    // LanguageRegistry.addName(uraniumStill, "Uranium Still");

    glowCloth = new BlockGlowCloth(glowClothBlockID, glowClothAcidIndex);
    GameRegistry.registerBlock(
        glowCloth, com.elvenwater.malkierian.Plasmacraft.common.ItemGlowCloth.class);
    LanguageRegistry.addName(new ItemStack(glowCloth, 1, glowClothAcidMeta), "Acid Glowcloth");
    LanguageRegistry.addName(
        new ItemStack(glowCloth, 1, glowClothRadioniteMeta), "Radionite Glowcloth");
    LanguageRegistry.addName(
        new ItemStack(glowCloth, 1, glowClothNetherflowMeta), "Netherflow Glowcloth");
    LanguageRegistry.addName(
        new ItemStack(glowCloth, 1, glowClothNeptuniumMeta), "Neptunium Glowcloth");
    LanguageRegistry.addName(
        new ItemStack(glowCloth, 1, glowClothUraniumMeta), "Uranium Glowcloth");
    LanguageRegistry.addName(
        new ItemStack(glowCloth, 1, glowClothPlutoniumMeta), "Plutonium Glowcloth");
    LanguageRegistry.addName(
        new ItemStack(glowCloth, 1, glowClothCryoniteMeta), "Cryonite Glowcloth");
    LanguageRegistry.addName(
        new ItemStack(glowCloth, 1, glowClothObsidiumMeta), "Obsidium Glowcloth");

    frozenCryonite =
        (new BlockReinforcedGlass(
                cryoniteFrozenBlockID, frozenCryoniteIndex, Material.glass, false, 1.0F))
            .setBlockName("frozenCryonite");
    reinforcedGlass =
        (new BlockReinforcedGlass(
                reinforcedGlassBlockID, reinforcedGlassIndex, Material.glass, false, 500.0F))
            .setBlockName("reinforcedGlass");
    GameRegistry.registerBlock(frozenCryonite);
    GameRegistry.registerBlock(reinforcedGlass);
    LanguageRegistry.addName(frozenCryonite, "Frozen Cryonite");
    LanguageRegistry.addName(reinforcedGlass, "Reinforced Glass");

    plasmaBench = (new BlockPlasmaBench(plasmaBenchBlockID)).setBlockName("plasmaBench");
    GameRegistry.registerBlock(plasmaBench);
    LanguageRegistry.addName(plasmaBench, "Plasmificator");

    acidBarrier =
        (new BlockAcidBarrier(acidBarrierBlockID, acidBarrierIndex)).setBlockName("acidBarrier");
    GameRegistry.registerBlock(acidBarrier);
    LanguageRegistry.addName(acidBarrier, "Acid Barrier");

    acidTnt =
        (new BlockAcidTNT(acidTNTBlockID, acidTntSideIndex, acidTntTopIndex, acidTntBottomIndex))
            .setBlockName("acidTnt");
    GameRegistry.registerBlock(acidTnt, "Acid TNT");
    LanguageRegistry.addName(acidTnt, "Acid TNT");
  }
 /** an array of the blocks this pickaxe is effective against */
 public ItemMedievalPick(int id, EnumToolMaterial material) {
   super(id, material);
   MinecraftForge.setToolClass(this, "pickaxe", material.getHarvestLevel());
   setCreativeTab(ItemListMF.tabTool);
 }