Search in sources :

Example 1 with EnumGem

use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.

the class GemsConfig method load.

@Override
public void load() {
    try {
        // @formatter:off
        String comment;
        /*
       * Debug
       */
        config.setCategoryComment(CAT_DEBUG, "Options for debugging. Generally, you should leave these " + "alone unless I tell you to change them. Enabling debug options will likely result in " + "log spam, but may help me track down issues.");
        DEBUG_MODE = config.getBoolean("Debug Mode", CAT_DEBUG, DEBUG_MODE, "Generic debug mode option. May add text to GUIs and WIT HUD.");
        DEBUG_LOG_POTS_AND_LIGHTS = config.getBoolean("Log Pots and Lights", CAT_DEBUG, DEBUG_LOG_POTS_AND_LIGHTS, "Logs the existence of Chaos Flower Pots and Phantom Lights. Their tile entities, to " + "be more precise. Also lists the position of each one.");
        DEBUG_LOT_POTS_AND_LIGHTS_DELAY = config.getInt("Log Pots and Lights - Delay", CAT_DEBUG, DEBUG_LOT_POTS_AND_LIGHTS_DELAY, 600, 72000, "Pot and Light logging will occur every this many ticks. 1200 ticks = 1 minute.");
        /*
       * Blocks
       */
        final String catGlowRose = CAT_BLOCK + split + "Glow Rose";
        GLOW_ROSE_LIGHT_LEVEL = config.getInt("Light Level", catGlowRose, GLOW_ROSE_LIGHT_LEVEL, 0, 15, "The light level glow roses emit.");
        final String catTeleporter = CAT_BLOCK + split + "Teleporter";
        TELEPORTER_ALLOW_DUMB = config.getBoolean("Allow Dumb Teleporters", catTeleporter, TELEPORTER_ALLOW_DUMB, "Allows teleports to happen even if the destination teleporter has been removed.");
        TELEPORTER_COST_CROSS_DIMENSION = config.getInt("Chaos Cost Cross Dimension", catTeleporter, TELEPORTER_COST_CROSS_DIMENSION, 0, Integer.MAX_VALUE, "The amount of Chaos charged for traveling between dimensions.");
        TELEPORTER_COST_PER_BLOCK = config.getInt("Chaos Cost Per Block", catTeleporter, TELEPORTER_COST_PER_BLOCK, 0, Integer.MAX_VALUE, "The amount of Chaos charged per block traveled.");
        TELEPORTER_FREE_RANGE = config.getInt("Free Range", catTeleporter, TELEPORTER_FREE_RANGE, 0, Integer.MAX_VALUE, "The distance that can be teleported for free.");
        TELEPORTER_MAX_CHARGE = config.getInt("Max Chaos", catTeleporter, TELEPORTER_MAX_CHARGE, 0, Integer.MAX_VALUE, "The maximum amount of Chaos a teleporter can store.");
        /*
       * Items
       */
        BURN_TIME_CHAOS_COAL = loadInt("Chaos Coal Burn Time", CAT_ITEM, BURN_TIME_CHAOS_COAL, 0, Integer.MAX_VALUE, "The burn time of Chaos Coal. Regular coal is 1600 ticks.");
        SPAWN_PLAYER_WITH_GUIDE_BOOK = loadBoolean("Spawn with Guide Book", CAT_ITEM, SPAWN_PLAYER_WITH_GUIDE_BOOK, "Should players be given a copy of the guide book when they first spawn?");
        if (ModItems.guideBook != null)
            ModItems.guideBook.giveBookOnFirstLogin = SPAWN_PLAYER_WITH_GUIDE_BOOK;
        // Food
        final String catFood = CAT_ITEM + split + "Food";
        FOOD_SUPPORT_DURATION = loadInt("Support Duration", catFood, FOOD_SUPPORT_DURATION, 0, 72000, "The base duration of potion effects from food. The actual duration will vary by effect.");
        FOOD_SECRET_DONUT_CHANCE = config.getFloat("Secret Donut Effect Chance", catFood, FOOD_SECRET_DONUT_CHANCE, 0.0f, 1.0f, "The chance of secret donuts giving potion effects.");
        FOOD_SECRET_DONUT_TEXT_CHANCE = config.getFloat("Secret Donut Text Chance", catFood, FOOD_SECRET_DONUT_TEXT_CHANCE, 0.0f, 1.0f, "The chance of secrets donuts putting weird text in your chat.");
        // Return Home Charm
        final String catReturnHome = CAT_ITEM + split + "Return Home Charm";
        RETURN_HOME_USE_TIME = loadInt("Use Time", catReturnHome, RETURN_HOME_USE_TIME, 0, Integer.MAX_VALUE, "The number of ticks the Return Home Charm must be 'charged' to use. Set to 0 for instant use.");
        RETURN_HOME_USE_COST = loadInt("Use Cost", catReturnHome, RETURN_HOME_USE_COST, 0, Integer.MAX_VALUE, "The amount of Chaos required to teleport.");
        RETURN_HOME_MAX_CHARGE = loadInt("Max Charge", catReturnHome, RETURN_HOME_MAX_CHARGE, 0, Integer.MAX_VALUE, "The maximum amount of Chaos a charm can hold.");
        /*
       * Tools
       */
        // addAdaptorMapping(0, "Variety Bonus", 0.75);
        VARIETY_BONUS = config.getFloat("Variety Bonus", CAT_TOOLS, VARIETY_BONUS, 0f, 1f, "The \"variety bonus\" for mixed-material tools and armor. Default is a 7.5% bonus for each" + " additional unique part.");
        VARIETY_CAP = config.getInt("Variety Cap", CAT_TOOLS, VARIETY_CAP, 1, 9, "The maximum number of unique parts that can affect the variety bonus");
        TOMAHAWK_MAX_AMMO = loadInt("Tomahawk Max Ammo", CAT_TOOLS, TOMAHAWK_MAX_AMMO, 0, Byte.MAX_VALUE, "The maximum \"ammo\" for tomahawks. This is the number that can be thrown before retrieval/repairs" + " are required. Setting this to 0 will make it so tomahawks cannot be thrown.");
        TOMAHAWK_AMMO_PER_MAT = loadInt("Tomahawk Ammo per Material", CAT_TOOLS, TOMAHAWK_AMMO_PER_MAT, 0, Byte.MAX_VALUE, "The \"ammo\" restored by each material (gem, etc.) when decorating a tomahawk.");
        SWITCH_AXE_SUPER = loadBoolean("Switch Axe Super Skill to Area Miner", CAT_TOOLS, SWITCH_AXE_SUPER, "Change the super skill for axes to Area Miner. Useful if playing with Veinminer installed.");
        sword.loadValue(config);
        dagger.loadValue(config);
        katana.loadValue(config);
        machete.loadValue(config);
        scepter.loadValue(config);
        tomahawk.loadValue(config);
        pickaxe.loadValue(config);
        shovel.loadValue(config);
        axe.loadValue(config);
        paxel.loadValue(config);
        hoe.loadValue(config);
        sickle.loadValue(config);
        bow.loadValue(config);
        shield.loadValue(config);
        /*
       * Tool Souls
       */
        SOULS_GAIN_XP_FROM_FAKE_PLAYERS = loadBoolean("Gain XP From Fake Players", CAT_TOOL_SOULS, false, "If true, tools with souls can gain XP when used by fake players.");
        /*
       * Tool Parts
       */
        String catPartDisable = CAT_TOOL_PARTS + split + "disable";
        config.setCategoryRequiresMcRestart(catPartDisable, true);
        config.setCategoryComment(catPartDisable, "Disable specific tool parts or entire tiers. As a reminder:" + " Mundane includes flint, Regular is ordinary gems, and Super is supercharged gems. Hover" + " over the item for the tool part and hold Ctrl to see the tier.");
        PART_DISABLE_ALL_MUNDANE = config.get(catPartDisable, "All Mundane Tier", false).getBoolean();
        PART_DISABLE_ALL_REGULAR = config.get(catPartDisable, "All Regular Tier", false).getBoolean();
        PART_DISABLE_ALL_SUPER = config.get(catPartDisable, "All Super Tier", false).getBoolean();
        String[] partBlacklistTemp = config.getStringList("Blacklist", catPartDisable, new String[0], "You can disable individual parts by listing the part keys here, if disabling groups with" + " the other settings doesn't cut it. Hover over the item in-game and hold Ctrl+Shift to" + " reveal the part key.");
        for (String str : partBlacklistTemp) PART_BLACKLIST.add(str);
        /*
       * Enchantments
       */
        String enchEnabledComment = "Allow this enchantment to be applied at the enchanting table." + " Enchantment tokens will still work.";
        EnchantmentGravity.ENABLED = loadBoolean("Gravity - Enabled", CAT_ENCHANTMENT, true, enchEnabledComment);
        EnchantmentIceAspect.ENABLED = loadBoolean("Ice Aspect - Enabled", CAT_ENCHANTMENT, true, enchEnabledComment);
        EnchantmentLifeSteal.ENABLED = loadBoolean("Life Steal - Enabled", CAT_ENCHANTMENT, true, enchEnabledComment);
        EnchantmentLightningAspect.ENABLED = loadBoolean("Lightning Aspect - Enabled", CAT_ENCHANTMENT, true, enchEnabledComment);
        EnchantmentMagicDamage.ENABLED = loadBoolean("Concentration - Enabled", CAT_ENCHANTMENT, true, enchEnabledComment);
        // DoT and other effects
        PotionFreezing.CONTINUOUS_DAMAGE_ENABLED = loadBoolean("Ice Aspect - DoT Enabled", CAT_ENCHANTMENT, true, "Allow the damage over time (DoT) of Ice Aspect. Disabling will still apply the slowing effect.");
        PotionShocking.CONTINUOUS_DAMAGE_ENABLED = loadBoolean("Lightning Aspect - DoT Enabled", CAT_ENCHANTMENT, true, "Allow the damage over time (DoT) of Lightning Aspect. Disabling will still apply the slowing effect.");
        PotionShocking.CHAINING_ENABLED = loadBoolean("Lightning Aspect - Chaining Enabled", CAT_ENCHANTMENT, true, "Allow the chaining effect of Lightning Aspect, where the effect spreads to nearby entities.");
        /*
       * Nodes
       */
        CHAOS_NODE_SALT_DELAY = loadBoolean("Salted Delay", CAT_NODES, true, "Adds a extra value to the delays on node activity. The value is not truly random but" + " based on the position of the node. If disabled, all nodes will try the same effect" + " at the same time.");
        CHAOS_NODE_PARTICLE_OVERRIDE = loadInt("Particle Setting Override", CAT_NODES, CHAOS_NODE_PARTICLE_OVERRIDE, -1, 2, "Override vanilla particle settings for chaos nodes. -1 will use vanilla settings, 0 is" + " All, 1 is Decreased, and 2 is Minimal");
        loadNodeItemList(true, config.getStringList("Repair Whitelist", CAT_NODES, new String[0], "Repair packets will try to repair these items, if possible. REMOVING ITEMS REQUIRES A RESTART."));
        loadNodeItemList(false, config.getStringList("Repair Blacklist", CAT_NODES, new String[0], "Repair packets will not try to repair these items. REMOVING ITEMS REQUIRES A RESTART."));
        /*
       * GUI
       */
        SHOW_BONUS_ARMOR_BAR = loadBoolean("Show Bonus Armor Bar", CAT_GUI, SHOW_BONUS_ARMOR_BAR, "Shows armor points beyond 20 on the bar as yellow armor pieces above the normal ones.");
        CHAOS_BAR_SHOW_ALWAYS = loadBoolean("Show Chaos Bar Always", CAT_GUI, CHAOS_BAR_SHOW_ALWAYS, "Show the chaos bar at all times. By default, it only shows when you gain/lose chaos.");
        SHOW_ARROW_COUNT = loadBoolean("Show Arrow Count", CAT_GUI, true, "Show how many arrows you have (and what kind will be fired) when you have a bow" + " equipped. Compatible with quivers!");
        /*
       * Recipes
       */
        config.setCategoryRequiresMcRestart(CAT_RECIPE, true);
        RECIPE_TELEPORTER_DISABLE = loadBoolean("Disable Regular Teleporter Recipes", CAT_RECIPE, RECIPE_TELEPORTER_DISABLE, "Disable recipes for regular gem teleporters.");
        RECIPE_TELEPORTER_ANCHOR_DISABLE = loadBoolean("Disable Teleporter Anchor Recipes", CAT_RECIPE, RECIPE_TELEPORTER_ANCHOR_DISABLE, "Disable recipes for teleporter anchors.");
        RECIPE_TELEPORTER_REDSTONE_DISABLE = loadBoolean("Disable Redstone Teleporter Recipes", CAT_RECIPE, RECIPE_TELEPORTER_REDSTONE_DISABLE, "Disable recipes for redstone gem teleporters.");
        RECIPE_TOKEN_FROST_WALKER_DISABLE = loadBoolean("Disable Frost Walker Token Recipe", CAT_RECIPE, RECIPE_TOKEN_FROST_WALKER_DISABLE, "Disables recipes for Frost Walker enchantment tokens.");
        RECIPE_TOKEN_MENDING_DISABLE = loadBoolean("Disable Mending Token Recipe", CAT_RECIPE, RECIPE_TOKEN_MENDING_DISABLE, "Disables recipes for Mending enchantment tokens.");
        /*
       * Misc
       */
        HIDE_FLAVOR_TEXT_ALWAYS = loadBoolean("Hide Flavor Text - Always", CAT_TOOLTIPS, HIDE_FLAVOR_TEXT_ALWAYS, "Always hide the potentially funny, but useless item descriptions.");
        HIDE_FLAVOR_TEXT_UNTIL_SHIFT = loadBoolean("Hide Flavor Text - Until Shift", CAT_TOOLTIPS, HIDE_FLAVOR_TEXT_UNTIL_SHIFT, "Hide the flavor text until shift is pressed.");
        // Controls - right-click to place
        final String catRctp = CAT_CONTROLS + Configuration.CATEGORY_SPLITTER + "Right-click to place";
        config.setCategoryComment(catRctp, "Mining tools have the ability to place blocks in the slot " + "after them (or in slot 9 if that doesn't work) by right-clicking.");
        RIGHT_CLICK_TO_PLACE_ENABLED = loadBoolean("Enabled", catRctp, RIGHT_CLICK_TO_PLACE_ENABLED, "If set to false, the ability of mining tools to place blocks by right-clicking will be completely disabled.");
        RIGHT_CLICK_TO_PLACE_ON_SNEAK_ONLY = loadBoolean("Only When Sneaking", catRctp, RIGHT_CLICK_TO_PLACE_ON_SNEAK_ONLY, "If set to true and right-click to place is enabled, this ability will only activate " + "while sneaking (holding shift, normally).");
        /*
       * World Generation
       */
        GLOW_ROSE_PER_CHUNK = loadInt("Flowers per Chunk", CAT_WORLD_GEN, GLOW_ROSE_PER_CHUNK, 0, 100, "The number of glow roses to attempt to spawn per chunk.");
        CHAOS_NODES_PER_CHUNK = config.getFloat("Chaos Nodes per Chunk", CAT_WORLD_GEN, CHAOS_NODES_PER_CHUNK, 0.0f, 8.0f, "The number of chaos nodes to try to spawn per chunk. If less than 1 (recommended), you" + " can think of this as the chance to spawn in a chunk.");
        WORLD_GEN_GEMS = new ConfigOptionOreGen("Gems (Overworld)", 0, 10.0f, 8, 5, 45);
        WORLD_GEN_GEMS.loadValue(config, CAT_WORLD_GEN);
        WORLD_GEN_GEMS_DARK = new ConfigOptionOreGen("Dark Gems (Nether)", -1, 12.5f, 10, 30, 100);
        WORLD_GEN_GEMS_DARK.loadValue(config, CAT_WORLD_GEN);
        WORLD_GEN_GEMS_LIGHT = new ConfigOptionOreGen("Light Gems (The End)", 1, 12.5f, 8, 16, 64);
        WORLD_GEN_GEMS_LIGHT.loadValue(config, CAT_WORLD_GEN);
        WORLD_GEN_CHAOS = new ConfigOptionOreGen("Chaos Ore", 0, 1.75f, 16, 5, 20);
        WORLD_GEN_CHAOS.loadValue(config, CAT_WORLD_GEN);
        WORLD_GEN_ENDER = new ConfigOptionOreGen("Ender Essence Ore", 1, 1.0f, 32, 10, 70);
        WORLD_GEN_ENDER.loadValue(config, CAT_WORLD_GEN);
        // Gem weights
        final int weightMax = 1000;
        config.setCategoryComment(CAT_WORLD_GEN_GEM_WEIGHT, "The spawn weights of the gems. If two gems have different weights, the gem with the\n" + "higher weight is more likely to be selected when placing gems in the world.\n" + "Just increasing weights will NOT increase the number of gems that spawn!\n" + "Values must be between 1 and " + weightMax + ", inclusive.");
        for (EnumGem gem : EnumGem.values()) {
            int k = config.get(CAT_WORLD_GEN_GEM_WEIGHT, gem.getGemName(), 10).getInt();
            k = MathHelper.clamp(k, 1, weightMax);
            WeightedRandomItemSG item = new WeightedRandomItemSG(k, gem.ordinal() & 0xF);
            switch(gem.getSet()) {
                case CLASSIC:
                    GEM_WEIGHTS.add(item);
                    break;
                case DARK:
                    GEM_WEIGHTS_DARK.add(item);
                    break;
                case LIGHT:
                    GEM_WEIGHTS_LIGHT.add(item);
                    break;
            }
        }
        // Gem regions
        config.setCategoryComment(CAT_WORLD_GEN_REGIONS, "Settings for \"gem regions\". This will" + " randomly assign one or two gems to spawn in each region in the overworld. This does" + " not consider things like biomes, it's purely random. The usual world gen configs" + " still apply, this only changes which gem type is selected for each vein.");
        GEM_REGIONS_ENABLED = loadBoolean("Enable", CAT_WORLD_GEN_REGIONS, false, "Enables gem regions.");
        GEM_REGIONS_SIZE = loadInt("Region Size", CAT_WORLD_GEN_REGIONS, 12, 1, 256, "Each region is a square of this many chunks on each side.");
        GEM_REGIONS_SECOND_GEM_CHANCE = config.getFloat("Second Gem Chance", CAT_WORLD_GEN_REGIONS, 0.75f, 0f, 1f, "The chance of a second gem being selected to spawn in the region.");
        // Gem geodes
        config.setCategoryComment(CAT_WORLD_GEN_GEODES, "Geodes are deposits of Nether/End gems that" + " spawn rarely in the overworld and similar dimensions. They are large, but encased in" + " a tough shell.");
        GEODE_DARK_FREQUENCY = config.getFloat("Dark Geode Frequency", CAT_WORLD_GEN_GEODES, 0.0125f, 0f, 1f, "The chance a geode of Nether (dark) gems will spawn in any given chunk.");
        GEODE_LIGHT_FREQUENCY = config.getFloat("Light Geode Frequency", CAT_WORLD_GEN_GEODES, 0.0125f, 0f, 1f, "The chance a geode of End (light) gems will spawn in any given chunk.");
        GEODE_FILL_RATIO = config.getFloat("Fill Ratio", CAT_WORLD_GEN_GEODES, 0.6f, 0f, 1f, "The ratio of geodes that will attempt to fill with gems.");
        GEODE_GEM_DENSITY = config.getFloat("Gem Density", CAT_WORLD_GEN_GEODES, 0.75f, 0f, 1f, "The density of gems in the filled region of the geode.");
        GEODE_MIN_Y = loadInt("Min Y", CAT_WORLD_GEN_GEODES, 20, 0, 255, "The minimum height geodes will attempt to spawn at.");
        GEODE_MAX_Y = loadInt("Max Y", CAT_WORLD_GEN_GEODES, 40, 0, 255, "The maximum height geodes will attempt to spawn at.");
        GEODE_SEAL_BREAKS = loadBoolean("Seal Breaks", CAT_WORLD_GEN_GEODES, true, "If the geode is \"broken\" (intersects with a cave or something), the world generator" + " will seal the break.");
        GemsConfigHC.load(this);
    // @formatter:on
    } catch (Exception e) {
        System.out.println("Oh noes!!! Couldn't load configuration file properly!");
    }
}
Also used : EnumGem(net.silentchaos512.gems.lib.EnumGem) WeightedRandomItemSG(net.silentchaos512.gems.util.WeightedRandomItemSG)

Example 2 with EnumGem

use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.

the class GuideBookGems method initChapters.

@SuppressWarnings("unused")
@Override
public void initChapters() {
    RecipeMaker rec = SilentGems.registry.recipes;
    // @formatter:off
    // Getting Started
    // Introduction
    new GuideChapter(this, "introduction", entryGettingStarted, new ItemStack(ModItems.gem, 1, SilentGems.random.nextInt(32)), 1000, new PageTextOnly(this, 1), new PageTextOnly(this, 2), new PageTextOnly(this, 3)).setSpecial();
    // Progression
    ItemStack flintPickaxe = ModItems.pickaxe.constructTool(false, new ItemStack(Items.FLINT));
    ToolHelper.setOriginalOwner(flintPickaxe, TOOL_OWNER_NAME);
    ItemStack flintPickaxeBroken = StackHelper.safeCopy(flintPickaxe);
    flintPickaxeBroken.setItemDamage(ToolHelper.getMaxDamage(flintPickaxeBroken));
    ItemStack ironTipUpgrade = new ItemStack(ModItems.tipUpgrade);
    ItemStack flintPickaxeIronTips = ModItems.tipUpgrade.applyToTool(flintPickaxe, ironTipUpgrade);
    ItemStack gravel = new ItemStack(Blocks.GRAVEL);
    ItemStack gemPickaxe = ModItems.pickaxe.constructTool(new ItemStack(Items.STICK), EnumGem.RUBY.getItem(), EnumGem.SAPPHIRE.getItem(), EnumGem.RUBY.getItem());
    ToolHelper.setOriginalOwner(gemPickaxe, TOOL_OWNER_NAME);
    ItemStack diamondTipUpgrade = new ItemStack(ModItems.tipUpgrade, 1, 2);
    ItemStack gemPickaxeDiamondTips = ModItems.tipUpgrade.applyToTool(gemPickaxe, diamondTipUpgrade);
    ItemStack katana = ModItems.katana.constructTool(true, EnumGem.LEPIDOLITE.getItemSuper(), EnumGem.OPAL.getItemSuper(), EnumGem.BLACK_DIAMOND.getItemSuper());
    ToolHelper.setOriginalOwner(katana, TOOL_OWNER_NAME);
    new GuideChapter(this, "progression", entryGettingStarted, flintPickaxeIronTips, 100, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapeless(new ItemStack(Items.FLINT), gravel, gravel)), new PageCrafting(this, 3, rec.makeShapedOre(flintPickaxe, "fff", " s ", " s ", 'f', Items.FLINT, 's', "stickWood")), new PageTextOnly(this, 4), new PageCrafting(this, 5, rec.makeShapeless(flintPickaxe, flintPickaxeBroken, Items.FLINT, Items.FLINT)), new PageTextOnly(this, 6), new PageCrafting(this, 7, rec.makeShapelessOre(flintPickaxeIronTips, flintPickaxe, ironTipUpgrade)), new PageCrafting(this, 8, rec.makeShapedOre(gemPickaxe, "rsr", " t ", " t ", 'r', EnumGem.RUBY.getItem(), 's', EnumGem.SAPPHIRE.getItem(), 't', "stickWood")), new PageTextOnly(this, 9), new PageCrafting(this, 10, rec.makeShapeless(gemPickaxeDiamondTips, gemPickaxe, diamondTipUpgrade)), new PageTextOnly(this, 11), new PageCrafting(this, 12, rec.makeShapedOre(katana, "lo", "d ", "r ", 'l', EnumGem.LEPIDOLITE.getItemSuper(), 'o', EnumGem.OPAL.getItemSuper(), 'd', EnumGem.BLACK_DIAMOND.getItemSuper(), 'r', ModItems.craftingMaterial.toolRodGold)), new PageTextOnly(this, 13)).setImportant();
    // Tools, Armor, and Parts
    // Parts
    // List<IGuidePage> pagesParts = Lists.newArrayList();
    // pagesParts.add(new PageTextOnly(this, 1));
    // for (ToolPart part : ToolPartRegistry.getMains()) {
    // pagesParts.add(new PageToolPart(this, 0, part));
    // }
    // new GuideChapter(this, "toolParts", entryTools, EnumGem.getRandom().getItem(), 100,
    // pagesParts.toArray(new IGuidePage[pagesParts.size()]));
    // Axes
    ItemStack toolsEntryRod = SilentGems.random.nextFloat() < 0.67f ? ModItems.craftingMaterial.toolRodGold : ModItems.craftingMaterial.toolRodSilver;
    ItemStack chAxeGem = EnumGem.getRandom().getItemSuper();
    ItemStack chAxe = makeTool(ModItems.axe, toolsEntryRod, chAxeGem, 3);
    new GuideChapter(this, "axe", entryTools, chAxe, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chAxe, "gg", "gr", " r", 'g', chAxeGem, 'r', toolsEntryRod)).setNoText());
    // Bows
    ItemStack chBowGem = EnumGem.getRandom().getItemSuper();
    ItemStack chBow = makeTool(ModItems.bow, toolsEntryRod, chBowGem, 3);
    new GuideChapter(this, "bow", entryTools, chBow, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chBow, "rgs", "g s", "rgs", 'g', chBowGem, 'r', toolsEntryRod, 's', ModItems.craftingMaterial.gildedString)));
    // Daggers
    ItemStack chDaggerGem = EnumGem.getRandom().getItemSuper();
    ItemStack chDagger = makeTool(ModItems.dagger, toolsEntryRod, chDaggerGem, 1);
    new GuideChapter(this, "dagger", entryTools, chDagger, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chDagger, "g", "r", "f", 'g', chDaggerGem, 'r', toolsEntryRod, 'f', "ingotGold")));
    // Hoes
    ItemStack chHoeGem = EnumGem.getRandom().getItemSuper();
    ItemStack chHoe = makeTool(ModItems.hoe, toolsEntryRod, chHoeGem, 2);
    new GuideChapter(this, "hoe", entryTools, chHoe, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chHoe, "gg", " r", " r", 'g', chHoeGem, 'r', toolsEntryRod)).setNoText());
    // Katana
    ItemStack chKatanaGem = EnumGem.getRandom().getItemSuper();
    ItemStack chKatana = makeTool(ModItems.katana, toolsEntryRod, chKatanaGem, 3);
    new GuideChapter(this, "katana", entryTools, chKatana, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chKatana, "gg", "g ", "r ", 'g', chKatanaGem, 'r', toolsEntryRod)).setNoText());
    // Machetes
    ItemStack chMacheteGem = EnumGem.getRandom().getItemSuper();
    ItemStack chMachete = makeTool(ModItems.machete, toolsEntryRod, chMacheteGem, 3);
    new GuideChapter(this, "machete", entryTools, chMachete, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chMachete, " gg", " g ", "r  ", 'g', chMacheteGem, 'r', toolsEntryRod)).setNoText(), new PageTextOnly(this, 3), new PageTextOnly(this, 4));
    // Paxels
    ItemStack chPaxelGem = EnumGem.getRandom().getItemSuper();
    ItemStack chPaxel = makeTool(ModItems.paxel, toolsEntryRod, chPaxelGem, 6);
    new GuideChapter(this, "paxel", entryTools, chPaxel, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chPaxel, "ggg", "grg", "gr ", 'g', chPaxelGem, 'r', toolsEntryRod)).setNoText());
    // Pickaxes
    ItemStack chPickaxeGem = EnumGem.getRandom().getItemSuper();
    ItemStack chPickaxe = makeTool(ModItems.pickaxe, toolsEntryRod, chPickaxeGem, 3);
    new GuideChapter(this, "pickaxe", entryTools, chPickaxe, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chPickaxe, "ggg", " r ", " r ", 'g', chPickaxeGem, 'r', toolsEntryRod)).setNoText());
    // Scepters
    ItemStack chScepterGem = EnumGem.getRandom().getItemSuper();
    ItemStack chScepter = makeTool(ModItems.scepter, toolsEntryRod, chScepterGem, 5);
    new GuideChapter(this, "scepter", entryTools, chScepter, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chScepter, " g ", "grg", "grg", 'g', chScepterGem, 'r', toolsEntryRod)).setNoText(), new PageTextOnly(this, 3));
    ItemStack chShieldGem = EnumGem.getRandom().getItemSuper();
    ItemStack chShield = makeTool(ModItems.shield, toolsEntryRod, chShieldGem, 3);
    new GuideChapter(this, "shield", entryTools, chShield, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chShield, "gwg", "wrw", " g ", 'g', chShieldGem, 'r', toolsEntryRod, 'w', "plankWood")).setNoText());
    // Shovels
    ItemStack chShovelGem = EnumGem.getRandom().getItemSuper();
    ItemStack chShovel = makeTool(ModItems.shovel, toolsEntryRod, chShovelGem, 1);
    new GuideChapter(this, "shovel", entryTools, chShovel, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chShovel, "g", "r", "r", 'g', chShovelGem, 'r', toolsEntryRod)).setNoText());
    // Sickles
    ItemStack chSickleGem = EnumGem.getRandom().getItemSuper();
    ItemStack chSickle = makeTool(ModItems.sickle, toolsEntryRod, chSickleGem, 3);
    new GuideChapter(this, "sickle", entryTools, chSickle, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chSickle, " g", "gg", "r ", 'g', chSickleGem, 'r', toolsEntryRod)).setNoText());
    // Swords
    ItemStack chSwordGem = EnumGem.getRandom().getItemSuper();
    ItemStack chSword = makeTool(ModItems.sword, toolsEntryRod, chSwordGem, 2);
    new GuideChapter(this, "sword", entryTools, chSword, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chSword, "g", "g", "r", 'g', chSwordGem, 'r', toolsEntryRod)).setNoText());
    // Tomahawks
    ItemStack chTomahawkGem = EnumGem.getRandom().getItemSuper();
    ItemStack chTomahawk = makeTool(ModItems.tomahawk, toolsEntryRod, chTomahawkGem, 4);
    new GuideChapter(this, "tomahawk", entryTools, chTomahawk, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapedOre(chTomahawk, "ggg", "gr ", " r ", 'g', chTomahawkGem, 'r', toolsEntryRod)).setNoText());
    // Armor
    ItemStack chHelmetGem = EnumGem.getRandom().getItemSuper();
    ItemStack chHelmet = ModItems.gemHelmet.constructArmor(EnumMaterialTier.SUPER, chHelmetGem);
    ItemStack chHelmetFrame = ModItems.armorFrame.getFrameForArmorPiece(ModItems.gemHelmet, EnumMaterialTier.SUPER);
    ArmorHelper.setOriginalOwner(chHelmet, TOOL_OWNER_NAME);
    new GuideChapter(this, "armor", entryTools, chHelmet, -10, new PageTextOnly(this, 1), new PageCrafting(this, 2, ModItems.craftingMaterial.recipeLatticeMundane).setNoText(), new PageCrafting(this, 3, ModItems.craftingMaterial.recipeLatticeRegular).setNoText(), new PageCrafting(this, 4, ModItems.craftingMaterial.recipeLatticeSuper).setNoText(), new PageCrafting(this, 5, rec.makeShaped(chHelmetFrame, "lll", "l l", 'l', ModItems.craftingMaterial.armorLatticeSuper)), new PageCrafting(this, 6, rec.makeShapedOre(chHelmet, " g ", "gfg", " g ", 'g', chHelmetGem, 'f', chHelmetFrame)));
    // Blocks
    // Ores
    new GuideChapter(this, "ores", entryBlocks, new ItemStack(ModBlocks.gemOre, 1, SilentGems.random.nextInt(16)), 10, new PageTextOnly(this, 1), new PageOreSpawn(this, 2, GemsConfig.WORLD_GEN_GEMS), new PageOreSpawn(this, 3, GemsConfig.WORLD_GEN_GEMS_DARK), new PageOreSpawn(this, 4, GemsConfig.WORLD_GEN_CHAOS), new PageFurnace(this, 5, ModItems.craftingMaterial.chaosEssence), new PageOreSpawn(this, 6, GemsConfig.WORLD_GEN_ENDER), new PageFurnace(this, 7, ModItems.craftingMaterial.enderEssence)).setImportant();
    // Chaos Altar
    new GuideChapter(this, "chaosAltar", entryBlocks, new ItemStack(ModBlocks.chaosAltar), new PageCrafting(this, 1, ModBlocks.chaosAltar.recipe), new PageTextOnly(this, 2), new PageTextOnly(this, 3), new PageTextOnly(this, 4));
    // Chaos Flower Pot
    new GuideChapter(this, "chaosFlowerPot", entryBlocks, new ItemStack(ModBlocks.chaosFlowerPot), new PageCrafting(this, 1, ModBlocks.chaosFlowerPot.recipe), new PageTextOnly(this, 2));
    // Chaos Node
    new GuideChapter(this, "chaosNode", entryBlocks, new ItemStack(ModBlocks.chaosNode), new PagePicture(this, 1, new ResourceLocation(SilentGems.MODID, "textures/guide/chaosnode.png"), 125), new PageTextOnly(this, 2));
    // Chaos Pylons
    new GuideChapter(this, "chaosPylon", entryBlocks, new ItemStack(ModBlocks.chaosPylon), new PageTextOnly(this, 1), new PageTextOnly(this, 2));
    // Fluffy Blocks
    new GuideChapter(this, "fluffyBlocks", entryBlocks, new ItemStack(ModBlocks.fluffyBlock), new PageCrafting(this, 1, rec.makeShaped(new ItemStack(ModBlocks.fluffyBlock), "ff", "ff", 'f', ModItems.craftingMaterial.fluffyFabric)), new PageTextOnly(this, 2));
    // Glow Rose
    new GuideChapter(this, "glowRose", entryBlocks, new ItemStack(ModBlocks.glowRose), new PageTextOnly(this, 1));
    // Material Grader
    new GuideChapter(this, "materialGrader", entryBlocks, new ItemStack(ModBlocks.materialGrader), new PageTextOnly(this, 1));
    // Decorative Gem Blocks
    new GuideChapter(this, "gemDecoBlocks", entryBlocks, new ItemStack(ModBlocks.gemBrickCoated, 1, SilentGems.random.nextInt(16)), -10, new PageTextOnly(this, 1));
    // Items
    // Crafting Materials
    List<IGuidePage> pages = Lists.newArrayList();
    pages.add(new PageTextOnly(this, 1));
    for (String str : ItemCrafting.SORTED_NAMES) {
        ItemStack stack = ModItems.craftingMaterial.getStack(str);
        IRecipe recipe = ModItems.craftingMaterial.guideRecipeMap.get(stack.getItemDamage());
        if (stack.isItemEqual(ModItems.craftingMaterial.chaosEssence) || stack.isItemEqual(ModItems.craftingMaterial.enderEssence) || stack.isItemEqual(ModItems.craftingMaterial.chaosIron))
            pages.add(new PageFurnace(this, 100 + stack.getItemDamage(), stack));
        else if (recipe != null)
            pages.add(new PageCrafting(this, 100 + stack.getItemDamage(), recipe));
        else
            pages.add(new PageTextOnly(this, 100 + stack.getItemDamage()));
    }
    new GuideChapter(this, "craftingMaterial", entryItems, ModItems.craftingMaterial.chaosEssence, pages.toArray(new IGuidePage[pages.size()]));
    // Chaos Gems
    ItemStack chChaosGem = new ItemStack(ModItems.chaosGem, 1, EnumGem.getRandom().ordinal());
    ModItems.chaosGem.receiveCharge(chChaosGem, ModItems.chaosGem.getMaxCharge(chChaosGem), false);
    ItemStack chChaosGemWithBuffs = StackHelper.safeCopy(chChaosGem);
    ItemStack chChaosGemRuneStrength = new ItemStack(ModItems.chaosRune);
    ModItems.chaosRune.setBuff(chChaosGemRuneStrength, ChaosBuff.STRENGTH);
    ItemStack chChaosGemRuneResistance = new ItemStack(ModItems.chaosRune);
    ModItems.chaosRune.setBuff(chChaosGemRuneResistance, ChaosBuff.RESISTANCE);
    ModItems.chaosGem.addBuff(chChaosGemWithBuffs, ChaosBuff.STRENGTH);
    ModItems.chaosGem.addBuff(chChaosGemWithBuffs, ChaosBuff.STRENGTH);
    ModItems.chaosGem.addBuff(chChaosGemWithBuffs, ChaosBuff.RESISTANCE);
    ModItems.chaosGem.addBuff(chChaosGemWithBuffs, ChaosBuff.RESISTANCE);
    new GuideChapter(this, "chaosGem", entryItems, chChaosGem, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapeless(chChaosGemWithBuffs, chChaosGem, chChaosGemRuneStrength, chChaosGemRuneStrength, chChaosGemRuneResistance, chChaosGemRuneResistance)), new PageTextOnly(this, 3));
    // Chaos Orbs
    ItemStack chChaosOrb = new ItemStack(ModItems.chaosOrb, 1, ItemChaosOrb.Type.SUPREME.ordinal());
    ModItems.chaosOrb.receiveCharge(chChaosOrb, ModItems.chaosOrb.getMaxCharge(chChaosOrb), false);
    new GuideChapter(this, "chaosOrb", entryItems, chChaosOrb, new PageTextOnly(this, 1), new PageTextOnly(this, 2));
    // Drawing Compass
    ItemStack chDrawingCompass = new ItemStack(ModItems.drawingCompass);
    new GuideChapter(this, "drawingCompass", entryItems, chDrawingCompass, new PageTextOnly(this, 1), new PageTextOnly(this, 2));
    // Enchantment Tokens
    ItemStack chEnchantmentToken = new ItemStack(ModItems.enchantmentToken, 1, ItemEnchantmentToken.BLANK_META);
    ItemStack tokenSharpness = ModItems.enchantmentToken.constructToken(Enchantments.SHARPNESS);
    ItemStack chEnchantmentTokenPickaxe = ToolRandomizer.INSTANCE.randomize(new ItemStack(ModItems.pickaxe), 0.75f);
    ItemStack chEnchantmentTokenPickaxeEnchanted = StackHelper.safeCopy(chEnchantmentTokenPickaxe);
    ItemStack tokenUnbreaking = ModItems.enchantmentToken.constructToken(Enchantments.UNBREAKING);
    ItemStack tokenFortune = ModItems.enchantmentToken.constructToken(Enchantments.FORTUNE);
    for (int i = 0; i < 3; ++i) {
        ModItems.enchantmentToken.applyTokenToTool(tokenFortune, chEnchantmentTokenPickaxeEnchanted);
        ModItems.enchantmentToken.applyTokenToTool(tokenUnbreaking, chEnchantmentTokenPickaxeEnchanted);
    }
    new GuideChapter(this, "enchantmentToken", entryItems, chEnchantmentToken, new PageTextOnly(this, 1), new PageTextOnly(this, 2), new PageCrafting(this, 3, rec.makeShapedOre(new ItemStack(ModItems.enchantmentToken, 12, ItemEnchantmentToken.BLANK_META), "ggg", "lcl", "ggg", 'g', "ingotGold", 'l', "gemLapis", 'c', "gemChaos")), new PageCrafting(this, 4, rec.makeShapedOre(tokenSharpness, "r r", "fbf", "fff", 'r', "gemRuby", 'f', Items.FLINT, 'b', chEnchantmentToken)), new PageTextOnly(this, 5), new PageCrafting(this, 6, rec.makeShapeless(chEnchantmentTokenPickaxeEnchanted, chEnchantmentTokenPickaxe, tokenUnbreaking, tokenUnbreaking, tokenUnbreaking, tokenFortune, tokenFortune, tokenFortune)));
    // Fluffy Puffs
    new GuideChapter(this, "fluffyPuff", entryItems, new ItemStack(ModItems.fluffyPuff), new PageTextOnly(this, 1));
    // Gems
    EnumGem chGem = EnumGem.getRandom();
    ItemStack craftedShards = StackHelper.setCount(StackHelper.safeCopy(chGem.getShard()), 9);
    new GuideChapter(this, "gem", entryItems, chGem.getItem(), new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapelessOre(craftedShards, chGem.getItem())), new PageCrafting(this, 3, rec.makeShapedOre(chGem.getItemSuper(), "cgc", "cdc", "cgc", 'c', ModItems.craftingMaterial.chaosEssence, 'g', chGem.getItem(), 'd', "dustGlowstone")));
    // Holding Gem
    ItemStack chHoldingGem = ModItems.holdingGem.construct(EnumGem.getRandom());
    ItemStack chHoldingGemIcon = StackHelper.safeCopy(chHoldingGem);
    chHoldingGemIcon.setItemDamage(0);
    ItemStack chHoldingGemSet = StackHelper.safeCopy(chHoldingGem);
    ModItems.holdingGem.setBlockPlaced(chHoldingGemSet, Blocks.COBBLESTONE.getDefaultState());
    chHoldingGemSet.setItemDamage(chHoldingGemSet.getMaxDamage() - 1);
    new GuideChapter(this, "holdingGem", entryItems, chHoldingGemIcon, new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShapeless(chHoldingGemSet, chHoldingGem, new ItemStack(Blocks.COBBLESTONE))), new PageTextOnly(this, 3));
    // Tip upgrades
    ItemStack chTipUpgrade = new ItemStack(ModItems.tipUpgrade, 1, 2);
    pages = Lists.newArrayList();
    pages.add(new PageTextOnly(this, 1));
    pages.add(new PageTextOnly(this, 2));
    pages.add(new PageCrafting(this, 3, rec.makeShapelessOre(ModItems.craftingMaterial.upgradeBase, Items.FLINT, Items.FLINT, "stickWood", "plankWood")));
    for (IRecipe recipe : ItemTipUpgrade.RECIPES) {
        pages.add(new PageCrafting(this, 0, recipe).setNoText());
    }
    new GuideChapter(this, "tipUpgrade", entryItems, chTipUpgrade, pages.toArray(new IGuidePage[pages.size()]));
    // Torch Bandolier
    ItemStack chTorchBandolier = new ItemStack(ModItems.torchBandolier);
    new GuideChapter(this, "torchBandolier", entryItems, chTorchBandolier, new PageTextOnly(this, 1), new PageTextOnly(this, 2));
    /**
     *****************
     * Souls and Skills
     ******************
     */
    // Important Notice
    new GuideChapter(this, "soulsImportant", entrySouls, new ItemStack(Items.DIAMOND), new PageTextOnly(this, 1)).setImportant();
    // Tool Souls
    new GuideChapter(this, "toolSoul", entrySouls, new ItemStack(ModItems.toolSoul), new PageTextOnly(this, 1), new PageCrafting(this, 2, rec.makeShaped(new ItemStack(ModItems.toolSoul), " s ", "sds", " s ", 's', ModItems.soulGem, 'd', ModItems.craftingMaterial.soulShell)));
    // Soul Skills (includes a page for each skill!)
    pages = new ArrayList<>();
    pages.add(new PageTextOnly(this, 1));
    pages.add(new PageTextOnly(this, 2));
    for (SoulSkill skill : SoulSkill.getSkillList()) {
        pages.add(new PageSoulSkill(this, skill));
    }
    new GuideChapter(this, "soulSkills", entrySouls, new ItemStack(ModItems.skillOrb), pages.toArray(new IGuidePage[pages.size()]));
    // Enchantments
    // Gravity
    new GuideChapter(this, "enchantmentGravity", entryEnchantments, ModItems.enchantmentToken.constructToken(ModEnchantments.gravity), new PageTextOnly(this, 1));
    // Ice Aspect
    new GuideChapter(this, "enchantmentIceAspect", entryEnchantments, ModItems.enchantmentToken.constructToken(ModEnchantments.iceAspect), new PageTextOnly(this, 1));
    // Life Steal
    new GuideChapter(this, "enchantmentLifeSteal", entryEnchantments, ModItems.enchantmentToken.constructToken(ModEnchantments.lifeSteal), new PageTextOnly(this, 1), new PageTextOnly(this, 2));
    // Lightning Aspect
    new GuideChapter(this, "enchantmentLightningAspect", entryEnchantments, ModItems.enchantmentToken.constructToken(ModEnchantments.lightningAspect), new PageTextOnly(this, 1));
    // Magic Damage (Concentration)
    new GuideChapter(this, "enchantmentMagicDamage", entryEnchantments, ModItems.enchantmentToken.constructToken(ModEnchantments.magicDamage), new PageTextOnly(this, 1));
    if (entryDebug != null) {
        // Tool test
        new GuideChapter(this, "toolTest", entryDebug, ModItems.craftingMaterial.ironPotato, new PageDebugTool(this, 1), new PageDebugTool(this, 2));
    }
// @formatter:on
}
Also used : SoulSkill(net.silentchaos512.gems.lib.soul.SoulSkill) PageSoulSkill(net.silentchaos512.gems.guide.page.PageSoulSkill) IRecipe(net.minecraft.item.crafting.IRecipe) EnumGem(net.silentchaos512.gems.lib.EnumGem) PageFurnace(net.silentchaos512.lib.guidebook.page.PageFurnace) GuideChapter(net.silentchaos512.lib.guidebook.chapter.GuideChapter) PageOreSpawn(net.silentchaos512.gems.guide.page.PageOreSpawn) PageTextOnly(net.silentchaos512.lib.guidebook.page.PageTextOnly) PageSoulSkill(net.silentchaos512.gems.guide.page.PageSoulSkill) PageCrafting(net.silentchaos512.lib.guidebook.page.PageCrafting) ResourceLocation(net.minecraft.util.ResourceLocation) PagePicture(net.silentchaos512.lib.guidebook.page.PagePicture) ItemStack(net.minecraft.item.ItemStack) PageDebugTool(net.silentchaos512.gems.guide.page.PageDebugTool) RecipeMaker(net.silentchaos512.lib.registry.RecipeMaker) IGuidePage(net.silentchaos512.lib.guidebook.IGuidePage)

Example 3 with EnumGem

use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.

the class ModRecipes method registerAll.

@Override
public void registerAll(SRegistry reg) {
    RecipeMaker recipes = reg.recipes;
    // Chaos Essence creation.
    SilentGemsAPI.addAltarRecipe(ModItems.craftingMaterial.chaosEssence, ModItems.craftingMaterial.getStack(Names.CHAOS_ESSENCE_SHARD, 4), 240000, new ItemStack(Items.DIAMOND));
    // Ender Essence creation.
    // SilentGemsAPI.addAltarRecipe(ModItems.craftingMaterial.enderEssence,
    // ModItems.craftingMaterial.getStack(Names.ENDER_ESSENCE_SHARD, 4), 240000,
    // ModItems.craftingMaterial.enderSlimeBall);
    // Light <--> Dark gem conversion.
    ItemStack slimeBall = new ItemStack(Items.SLIME_BALL);
    ItemStack magmaCream = new ItemStack(Items.MAGMA_CREAM);
    ItemStack enderSlime = ModItems.craftingMaterial.enderSlimeBall;
    for (int i = 0; i < 16; ++i) {
        EnumGem classic = EnumGem.values()[i];
        EnumGem dark = EnumGem.values()[i + 16];
        EnumGem light = EnumGem.values()[i + 32];
        ItemStack classicShards = new ItemStack(ModItems.gemShard, 6, classic.ordinal());
        ItemStack darkShards = new ItemStack(ModItems.gemShard, 6, dark.ordinal());
        ItemStack lightShards = new ItemStack(ModItems.gemShard, 6, light.ordinal());
        SilentGemsAPI.addAltarRecipe(darkShards, classic.getItem(), 80000, magmaCream);
        SilentGemsAPI.addAltarRecipe(classicShards, dark.getItem(), 80000, slimeBall);
        SilentGemsAPI.addAltarRecipe(lightShards, classic.getItem(), 80000, enderSlime);
        SilentGemsAPI.addAltarRecipe(classicShards, light.getItem(), 80000, slimeBall);
    }
    // @formatter:off
    // Axe
    recipes.addCustomRecipe("multipart_axe", new RecipeMixedMaterialItem(null, ModItems.axe, "hh", "hr", " r"));
    // Bow
    recipes.addCustomRecipe("multipart_bow_mundane", new RecipeMixedMaterialItem(MUNDANE, ModItems.bow, "rhs", "h s", "rhs", 's', Items.STRING));
    recipes.addCustomRecipe("multipart_bow_regular", new RecipeMixedMaterialItem(REGULAR, ModItems.bow, "rhs", "h s", "rhs", 's', Items.STRING));
    recipes.addCustomRecipe("multipart_bow_super", new RecipeMixedMaterialItem(SUPER, ModItems.bow, "rhs", "h s", "rhs", 's', ModItems.craftingMaterial.gildedString));
    // Dagger
    recipes.addCustomRecipe("multipart_dagger", new RecipeMixedMaterialItem(null, ModItems.dagger, "h", "r"));
    // Hoe
    recipes.addCustomRecipe("multipart_hoe", new RecipeMixedMaterialItem(null, ModItems.hoe, "hh", " r", " r"));
    // Katana
    recipes.addCustomRecipe("multipart_katana", new RecipeMixedMaterialItem(null, ModItems.katana, "hh", "h ", "r "));
    // Machete
    recipes.addCustomRecipe("multipart_machete", new RecipeMixedMaterialItem(null, ModItems.machete, " hh", " h ", "r  "));
    // Paxel
    recipes.addCustomRecipe("multipart_paxel", new RecipeMixedMaterialItem(null, ModItems.paxel, "hhh", "hrh", "hr "));
    // Pickaxe
    recipes.addCustomRecipe("multipart_pickaxe", new RecipeMixedMaterialItem(null, ModItems.pickaxe, "hhh", " r ", " r "));
    // Scepter
    recipes.addCustomRecipe("multipart_scepter", new RecipeMixedMaterialItem(null, ModItems.scepter, " h ", "hrh", "hrh"));
    // Shield
    recipes.addCustomRecipe("multipart_shield", new RecipeMixedMaterialItem(null, ModItems.shield, "hwh", "wrw", " h ", 'w', "plankWood"));
    // Shovel
    recipes.addCustomRecipe("multipart_shovel", new RecipeMixedMaterialItem(null, ModItems.shovel, "h", "r", "r"));
    // Sickle
    recipes.addCustomRecipe("multipart_sickle", new RecipeMixedMaterialItem(null, ModItems.sickle, " h", "hh", "r "));
    // Sword
    recipes.addCustomRecipe("multipart_sword", new RecipeMixedMaterialItem(null, ModItems.sword, "h", "h", "r"));
    // Tomahawk
    recipes.addCustomRecipe("multipart_tomahawk", new RecipeMixedMaterialItem(null, ModItems.tomahawk, "hhh", "hr ", " r "));
    // Helmet
    recipes.addCustomRecipe("multipart_helmet", new RecipeMixedMaterialItem(null, ModItems.gemHelmet, " h ", "hfh", " h "));
    // Chestplate
    recipes.addCustomRecipe("multipart_chestplate", new RecipeMixedMaterialItem(null, ModItems.gemChestplate, " h ", "hfh", " h "));
    // Leggings
    recipes.addCustomRecipe("multipart_leggings", new RecipeMixedMaterialItem(null, ModItems.gemLeggings, " h ", "hfh", " h "));
    // Boots
    recipes.addCustomRecipe("multipart_boots", new RecipeMixedMaterialItem(null, ModItems.gemBoots, " h ", "hfh", " h "));
    // @formatter:on
    recipes.addCustomRecipe("decorate_tool", new RecipeDecorateTool());
    recipes.addCustomRecipe("decorate_armor", new RecipeDecorateArmor());
    recipes.addCustomRecipe("apply_enchantment_token", new RecipeApplyEnchantmentToken());
    recipes.addCustomRecipe("chaos_gem_upgrade", new RecipeChaosGemUpgrade());
    recipes.addCustomRecipe("name_plate_use", new RecipeNamePlate());
    recipes.addCustomRecipe("holding_gem_set_block", new RecipeHoldingGemSetBlock());
    if (ADD_SOUL_RECIPES) {
        recipes.addCustomRecipe("craft_tool_soul", new RecipeToolSoul());
        recipes.addCustomRecipe("apply_tool_soul", new RecipeApplyToolSoul());
    }
}
Also used : RecipeMixedMaterialItem(net.silentchaos512.gems.recipe.RecipeMixedMaterialItem) RecipeNamePlate(net.silentchaos512.gems.recipe.RecipeNamePlate) RecipeApplyEnchantmentToken(net.silentchaos512.gems.recipe.RecipeApplyEnchantmentToken) EnumGem(net.silentchaos512.gems.lib.EnumGem) RecipeToolSoul(net.silentchaos512.gems.recipe.RecipeToolSoul) RecipeChaosGemUpgrade(net.silentchaos512.gems.recipe.RecipeChaosGemUpgrade) RecipeApplyToolSoul(net.silentchaos512.gems.recipe.RecipeApplyToolSoul) RecipeDecorateArmor(net.silentchaos512.gems.recipe.RecipeDecorateArmor) RecipeDecorateTool(net.silentchaos512.gems.recipe.RecipeDecorateTool) RecipeHoldingGemSetBlock(net.silentchaos512.gems.recipe.RecipeHoldingGemSetBlock) ItemStack(net.minecraft.item.ItemStack) RecipeMaker(net.silentchaos512.lib.registry.RecipeMaker)

Example 4 with EnumGem

use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.

the class ColorHandlers method init.

public static void init() {
    ItemColors itemColors = Minecraft.getMinecraft().getItemColors();
    // Tools
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            return ToolRenderHelper.getInstance().getColor(stack, ToolPartPosition.forRenderPass(tintIndex));
        }
    }, ModItems.tools.toArray(new Item[ModItems.tools.size()]));
    // Shields
    itemColors.registerItemColorHandler(new IItemColor() {

        int[] passes = { ToolRenderHelper.PASS_HEAD, ToolRenderHelper.PASS_ROD };

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            if (tintIndex < 0 || tintIndex >= passes.length)
                return 0xFFFFFF;
            return ToolRenderHelper.getInstance().getColor(stack, ToolPartPosition.forRenderPass(tintIndex));
        }
    }, ModItems.shield);
    // Armor (temp)
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            // FIXME: Multiple passes needed?
            return ArmorHelper.getRenderColor(stack, ArmorPartPosition.NORTH);
        }
    }, ModItems.gemHelmet, ModItems.gemChestplate, ModItems.gemLeggings, ModItems.gemBoots);
    // Enchantment Tokens
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            if (tintIndex == 1)
                return ModItems.enchantmentToken.getOutlineColor(stack);
            return 0xFFFFFF;
        }
    }, ModItems.enchantmentToken);
    // Return Home Charm
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            if (tintIndex == 0) {
                int meta = stack.getItemDamage();
                if (meta >= 0 && meta < EnumGem.values().length) {
                    EnumGem gem = EnumGem.values()[meta];
                    return gem.color;
                }
            }
            return 0xFFFFFF;
        }
    }, ModItems.returnHomeCharm);
    // Node Mover
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            return tintIndex != 1 ? 0xFFFFFF : ClientTickHandler.nodeMoverColor.getColor();
        }
    }, ModItems.nodeMover);
    // Drawing Compass
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            return tintIndex == 0 ? ModItems.drawingCompass.getColor(stack).getColor() : 0xFFFFFF;
        }
    }, ModItems.drawingCompass);
    // Chaos Runes
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            if (tintIndex == 1) {
                ChaosBuff buff = ModItems.chaosRune.getBuff(stack);
                if (buff != null) {
                    return buff.getColor();
                }
            }
            return 0xFFFFFF;
        }
    }, ModItems.chaosRune);
    // Holding Gem
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            if (tintIndex == 1) {
                if (stack.hasTagCompound()) {
                    int id = stack.getTagCompound().getShort(ItemHoldingGem.NBT_GEM_ID);
                    if (id >= 0 && id < EnumGem.values().length)
                        return EnumGem.values()[id].color;
                }
            } else if (tintIndex == 2) {
                IBlockState state = ModItems.holdingGem.getBlockPlaced(stack);
                if (state != null) {
                    return 0xFFFFFF;
                // return state.getMapColor().colorValue;
                }
            }
            return 0xFFFFFF;
        }
    }, ModItems.holdingGem);
    // Soul Gems
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            Soul soul = ModItems.soulGem.getSoul(stack);
            if (soul == null) {
                return 0xFFFFFF;
            } else if (tintIndex == 1) {
                return soul.colorSecondary;
            } else {
                return soul.colorPrimary;
            }
        }
    }, ModItems.soulGem);
    // Tool Soul
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            // TODO Auto-generated method stub
            ToolSoul soul = ModItems.toolSoul.getSoul(stack);
            if (soul == null)
                return tintIndex == 1 ? 0xFF00FF : tintIndex == 2 ? 0x0 : 0xFFFFFF;
            switch(tintIndex) {
                case 0:
                    float ratio = 0.5f + MathHelper.sin((float) ClientTickHandler.ticksInGame / 15) / 6;
                    return Color.blend(soul.getPrimaryElement().color, soul.getSecondaryElement().color, ratio);
                case 1:
                    return soul.getPrimaryElement().color;
                case 2:
                    return soul.getSecondaryElement().color;
                default:
                    return 0xFFFFFF;
            }
        }
    }, ModItems.toolSoul);
    // Arrows
    itemColors.registerItemColorHandler(new IItemColor() {

        @Override
        public int getColorFromItemstack(ItemStack stack, int tintIndex) {
            // TODO Auto-generated method stub
            return 0xFFFFFF;
        }
    }, ModItems.arrow);
}
Also used : IItemColor(net.minecraft.client.renderer.color.IItemColor) Item(net.minecraft.item.Item) ToolSoul(net.silentchaos512.gems.lib.soul.ToolSoul) IBlockState(net.minecraft.block.state.IBlockState) ToolSoul(net.silentchaos512.gems.lib.soul.ToolSoul) Soul(net.silentchaos512.gems.item.ItemSoulGem.Soul) ItemColors(net.minecraft.client.renderer.color.ItemColors) ItemStack(net.minecraft.item.ItemStack)

Example 5 with EnumGem

use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.

the class ModParts method init.

public static void init() {
    // Head and deco
    ToolPartRegistry.putPart(new ToolPartFlint());
    // ToolPartRegistry.putPart(new ToolPartGlass());
    for (EnumGem gem : EnumGem.values()) ToolPartRegistry.putPart(new ToolPartGem(gem, false));
    for (EnumGem gem : EnumGem.values()) ToolPartRegistry.putPart(new ToolPartGem(gem, true));
    // Rods @formatter:off
    ToolPartRegistry.putPart(new ToolPartRodGems("RodWood", EnumMaterialTier.MUNDANE, new ItemStack(Items.STICK), 0x896727, "stickWood", 1.0f, 1.0f, 1.0f, 1.0f, 0.8f));
    ToolPartRegistry.putPart(new ToolPartRodGems("RodBone", EnumMaterialTier.MUNDANE, new ItemStack(Items.BONE), 0xFFFDE9, 1.1f, 0.9f, 1.1f, 0.9f, 1.0f));
    ToolPartRegistry.putPart(new ToolPartRodGems("RodStone", EnumMaterialTier.MUNDANE, ModItems.craftingMaterial.toolRodStone, 0x777777, "stickStone", 0.9f, 1.1f, 1.0f, 1.0f, 0.7f));
    ToolPartRegistry.putPart(new ToolPartRodGems("RodIron", EnumMaterialTier.REGULAR, ModItems.craftingMaterial.toolRodIron, 0xA2A2A2, "stickIron", 1.25f, 1.0f, 1.0f, 1.0f, 0.9f));
    ToolPartRegistry.putPart(new ToolPartRodGems("RodGold", EnumMaterialTier.SUPER, ModItems.craftingMaterial.toolRodGold, 0xC8AE09, "stickGold", 1.15f, 1.0f, 1.15f, 1.0f, 1.0f));
    ToolPartRegistry.putPart(new ToolPartRodGems("RodSilver", EnumMaterialTier.SUPER, ModItems.craftingMaterial.toolRodSilver, 0xF2F2F2, "stickSilver", 1.0f, 1.15f, 1.0f, 1.15f, // @formatter:on
    1.0f));
    // Tips
    ToolPartRegistry.putPart(new ToolPartTipGems("TipIron", EnumTipUpgrade.IRON));
    ToolPartRegistry.putPart(new ToolPartTipGems("TipGold", EnumTipUpgrade.GOLD));
    ToolPartRegistry.putPart(new ToolPartTipGems("TipDiamond", EnumTipUpgrade.DIAMOND));
    ToolPartRegistry.putPart(new ToolPartTipGems("TipEmerald", EnumTipUpgrade.EMERALD));
    // Armor Frames
    for (EnumMaterialTier tier : EnumMaterialTier.values()) {
        for (EntityEquipmentSlot slot : EntityEquipmentSlot.values()) {
            if (slot.getSlotType() == EntityEquipmentSlot.Type.ARMOR) {
                String key = "frame_" + slot.name().toLowerCase() + "_" + tier.name().toLowerCase();
                ToolPartRegistry.putPart(new ArmorPartFrameGems(key, slot, tier));
            }
        }
    }
}
Also used : EntityEquipmentSlot(net.minecraft.inventory.EntityEquipmentSlot) EnumGem(net.silentchaos512.gems.lib.EnumGem) EnumMaterialTier(net.silentchaos512.gems.api.lib.EnumMaterialTier) ItemStack(net.minecraft.item.ItemStack)

Aggregations

EnumGem (net.silentchaos512.gems.lib.EnumGem)27 ItemStack (net.minecraft.item.ItemStack)16 IBlockState (net.minecraft.block.state.IBlockState)4 BlockPos (net.minecraft.util.math.BlockPos)3 Random (java.util.Random)2 IArmor (net.silentchaos512.gems.api.IArmor)2 WeightedRandomItemSG (net.silentchaos512.gems.util.WeightedRandomItemSG)2 RecipeMaker (net.silentchaos512.lib.registry.RecipeMaker)2 Predicate (com.google.common.base.Predicate)1 Block (net.minecraft.block.Block)1 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)1 IItemColor (net.minecraft.client.renderer.color.IItemColor)1 ItemColors (net.minecraft.client.renderer.color.ItemColors)1 EntityEquipmentSlot (net.minecraft.inventory.EntityEquipmentSlot)1 Item (net.minecraft.item.Item)1 IRecipe (net.minecraft.item.crafting.IRecipe)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 EnumFacing (net.minecraft.util.EnumFacing)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 WeightedRandom (net.minecraft.util.WeightedRandom)1