public static void initRecipes() { addRecipeBothList(OreDictionary.getOres("cobblestone", false), 1, OreDictionary.getOres("gravel", false), 1, OreDictionary.getOres("sand", false), 1, 20, 1600); addRecipeBothList(OreDictionary.getOres("gravel", false), 1, OreDictionary.getOres("sand", false), 1, Collections.singletonList(new ItemStack(Items.FLINT)), 1, 40, 1600); addRecipeBothList(OreDictionary.getOres("sand", false), 1, OreDictionary.getOres("itemSilicon", false), 1, null, 0, 0, 800); addRecipeListSecondOutput(new ItemStack(Items.BLAZE_ROD), new ItemStack(Items.BLAZE_POWDER, 4), OreDictionary.getOres("dustSulfer", false), 1, 50, 1600); addRecipe(new ItemStack(Items.BONE), new ItemStack(Items.DYE, 6, EnumDyeColor.WHITE.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(Items.REEDS), new ItemStack(Items.SUGAR, 3), ItemStackTools.getEmptyStack(), 0, 800); for(EnumDyeColor dye : EnumDyeColor.values()){ addRecipe(new ItemStack(Blocks.WOOL, 1, dye.getMetadata()), new ItemStack(Items.STRING, 3), new ItemStack(Items.DYE, 1, dye.getDyeDamage()), 20, 1600); } int powerDye = 800; addRecipe(new ItemStack(Blocks.YELLOW_FLOWER), new ItemStack(Items.DYE, 3, EnumDyeColor.YELLOW.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.RED_FLOWER, 1, EnumFlowerType.POPPY.getMeta()), new ItemStack(Items.DYE, 3, EnumDyeColor.RED.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.RED_FLOWER, 1, EnumFlowerType.BLUE_ORCHID.getMeta()), new ItemStack(Items.DYE, 3, EnumDyeColor.LIGHT_BLUE.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.RED_FLOWER, 1, EnumFlowerType.ALLIUM.getMeta()), new ItemStack(Items.DYE, 3, EnumDyeColor.MAGENTA.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.RED_FLOWER, 1, EnumFlowerType.HOUSTONIA.getMeta()), new ItemStack(Items.DYE, 3, EnumDyeColor.SILVER.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.RED_FLOWER, 1, EnumFlowerType.RED_TULIP.getMeta()), new ItemStack(Items.DYE, 3, EnumDyeColor.RED.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.RED_FLOWER, 1, EnumFlowerType.ORANGE_TULIP.getMeta()), new ItemStack(Items.DYE, 3, EnumDyeColor.ORANGE.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.RED_FLOWER, 1, EnumFlowerType.WHITE_TULIP.getMeta()), new ItemStack(Items.DYE, 3, EnumDyeColor.SILVER.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.RED_FLOWER, 1, EnumFlowerType.PINK_TULIP.getMeta()), new ItemStack(Items.DYE, 3, EnumDyeColor.PINK.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.RED_FLOWER, 1, EnumFlowerType.OXEYE_DAISY.getMeta()), new ItemStack(Items.DYE, 3, EnumDyeColor.SILVER.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, powerDye); addRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, EnumPlantType.SUNFLOWER.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.YELLOW.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, EnumPlantType.SYRINGA.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.MAGENTA.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, EnumPlantType.ROSE.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.RED.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); //Better Roses addRecipe(new ItemStack(ModBlocks.roseBush, 1, RoseType.WHITE.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.WHITE.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(ModBlocks.roseBush, 1, RoseType.ORANGE.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.ORANGE.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(ModBlocks.roseBush, 1, RoseType.MAGENTA.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.MAGENTA.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(ModBlocks.roseBush, 1, RoseType.YELLOW.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.YELLOW.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(ModBlocks.roseBush, 1, RoseType.PINK.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.PINK.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(ModBlocks.roseBush, 1, RoseType.CYAN.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.CYAN.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(ModBlocks.roseBush, 1, RoseType.PURPLE.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.PURPLE.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, EnumPlantType.PAEONIA.getMeta()), new ItemStack(Items.DYE, 4, EnumDyeColor.PINK.getDyeDamage()), ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(Items.BEETROOT), new ItemStack(Items.DYE, 2, EnumDyeColor.RED.getDyeDamage()), new ItemStack(Items.BEETROOT_SEEDS), 30, powerDye); addRecipeBothList(OreDictionary.getOres("oreRedstone", false), 1, OreDictionary.getOres("dustRedstone", false), 8, null, 0, 0, 3200); addRecipeBothList(OreDictionary.getOres("coal", false), 1, OreDictionary.getOres("dustCoal", false), 1, null, 0, 0, 2400); addRecipeBothList(OreDictionary.getOres("oreCoal", false), 1, Collections.singletonList(new ItemStack(Items.COAL)), 3, OreDictionary.getOres("dustCoal", false), 1, 60, 3200); addRecipeBothList(OreDictionary.getOres("oreLapis", false), 1, OreDictionary.getOres("gemLapis", false), 8, null, 0, 0, 3200); addRecipeListInput(OreDictionary.getOres("oreDiamond", false), 1, new ItemStack(Items.DIAMOND), new ItemStack(Items.DIAMOND), 25, 3200); addRecipeListInput(OreDictionary.getOres("oreEmerald", false), 1, new ItemStack(Items.EMERALD), new ItemStack(Items.EMERALD), 25, 3200); addRecipeBothList(OreDictionary.getOres("oreQuartz", false), 1, OreDictionary.getOres("gemQuartz", false), 3, OreDictionary.getOres("dustNetherQuartz", false), 1, 10, 3200); addRecipeListOutput(new ItemStack(Items.QUARTZ), OreDictionary.getOres("dustNetherQuartz", false), 1, ItemStackTools.getEmptyStack(), 0, 1600); addRecipe(new ItemStack(Blocks.GLOWSTONE), new ItemStack(Items.GLOWSTONE_DUST, 4), ItemStackTools.getEmptyStack(), 0, 1600); for(GlowstoneType type : GlowstoneType.values()){ addRecipe(new ItemStack(ModBlocks.fancyGlowstone, 1, type.getMeta()), new ItemStack(Items.GLOWSTONE_DUST, 3), ItemStackTools.getEmptyStack(), 0, 1600); } List<ItemStack> flourList = Lists.newArrayList(); flourList.addAll(OreDictionary.getOres("dustWheat", false)); flourList.addAll(OreDictionary.getOres("dustFlour", false)); addRecipeListOutput(new ItemStack(Items.WHEAT), flourList, 1, new ItemStack(Items.WHEAT_SEEDS), 30, 800); addRecipeListOutput(new ItemStack(Items.ENDER_PEARL), OreDictionary.getOres("nuggetEnderpearl", false), 9, ItemStackTools.getEmptyStack(), 0, 1600); addRecipeListOutput(new ItemStack(Blocks.OBSIDIAN), OreDictionary.getOres("dustObsidian", false), 4, ItemStackTools.getEmptyStack(), 0, 4000); searches.add(new OreSearch("gem", 1, 2400)); searches.add(new OreSearch("ingot", 1, 2400)); searches.add(new OreSearch("ore", 2, 3200)); searches.add(new OreSearch("oreNether", 4, 3200)); searches.add(new OreSearch("denseore", 4, 2400, "ore")); searches.add(new OreSearch("ore", 2, 3200, "gem")); }
@Override protected void placeFootprintBlock(EntityTameableDragon dragon, BlockPos blockPos) { World world = dragon.worldObj; // grow mushrooms and plants BlockPos blockPosGround = blockPos.down(); BlockPos blockPosSurface = blockPos; IBlockState blockStateUnderFoot = world.getBlockState(blockPosGround); Block blockUnderFoot = blockStateUnderFoot.getBlock(); boolean plantFlower = false; boolean plantMushroom = false; if (blockUnderFoot == Blocks.GRASS) { // plant flowers on grass plantFlower = true; } else if (blockUnderFoot == Blocks.DIRT) { DirtType dirtType = blockStateUnderFoot.getValue(BlockDirt.VARIANT); if (dirtType != DirtType.DIRT) { // plant mushrooms on special dirt types plantMushroom = true; } else if (world.getLightFromNeighbors(blockPosSurface) >= GRASS_LIGHT_THRESHOLD) { // turn normal dirt green if there's enough light world.setBlockState(blockPosGround, Blocks.GRASS.getDefaultState()); // also add flowers randomly plantFlower = world.rand.nextBoolean(); } } else if (blockUnderFoot == Blocks.MYCELIUM) { // always plant mushrooms on mycelium plantMushroom = true; } // pick plant BlockBush blockPlant = null; IBlockState statePlant = null; if (plantFlower) { EnumFlowerType flower = world.getBiome(blockPosSurface) .pickRandomFlower(world.rand, blockPosSurface); BlockFlower blockFlower = flower.getBlockType().getBlock(); blockPlant = blockFlower; statePlant = blockFlower.getDefaultState() .withProperty(blockFlower.getTypeProperty(), flower); } if (plantMushroom) { blockPlant = (world.rand.nextBoolean() ? Blocks.RED_MUSHROOM : Blocks.BROWN_MUSHROOM); statePlant = blockPlant.getDefaultState(); } // place plant if defined if (blockPlant != null && blockPlant.canBlockStay(world, blockPosSurface, statePlant)) { world.setBlockState(blockPosSurface, statePlant); } }