Search in sources :

Example 26 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class VanillaItems method addDiamondBits.

private static void addDiamondBits() {
    final MMDMaterial diamond = Materials.getMaterialByName(MaterialNames.DIAMOND);
    if (Materials.hasMaterial(MaterialNames.DIAMOND)) {
        create(Names.BLEND, diamond);
        create(Names.NUGGET, diamond);
        create(Names.POWDER, diamond);
        create(Names.SMALLBLEND, diamond);
        create(Names.SMALLPOWDER, diamond);
        create(Names.ARROW, diamond);
        create(Names.BOLT, diamond);
        create(Names.BOW, diamond);
        create(Names.CRACKHAMMER, diamond);
        create(Names.CROSSBOW, diamond);
        create(Names.DOOR, diamond);
        create(Names.FISHING_ROD, diamond);
        create(Names.SHEARS, diamond);
        create(Names.SHIELD, diamond);
        create(Names.SLAB, diamond);
        create(Names.ROD, diamond);
        create(Names.GEAR, diamond);
        create(Names.SCYTHE, diamond);
    }
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Example 27 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class VanillaItems method addWoodBits.

private static void addWoodBits() {
    final MMDMaterial wood = Materials.getMaterialByName(MaterialNames.WOOD);
    if (Materials.hasMaterial(MaterialNames.WOOD)) {
        create(Names.CRACKHAMMER, wood);
        create(Names.GEAR, wood);
        create(Names.SCYTHE, wood);
    }
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Example 28 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class FallbackGeneratorData method addMaterial.

/**
 * @param materialName
 * @param blockName
 * @param dimension
 */
public void addMaterial(@Nonnull final String materialName, @Nonnull final String blockName, @Nullable final Integer dimension) {
    final MMDMaterial mat = Materials.getMaterialByName(materialName);
    final int targetDim = dimension != null ? dimension : Integer.MIN_VALUE;
    final Map<MMDMaterial, List<String>> blockMap = materials.getOrDefault(targetDim, new HashMap<MMDMaterial, List<String>>());
    final List<String> blocks = blockMap.getOrDefault(mat, new ArrayList<>());
    if (!blocks.contains(blockName)) {
        blocks.add(blockName);
    }
    blockMap.put(mat, blocks);
    materials.put(targetDim, blockMap);
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) ArrayList(java.util.ArrayList) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList)

Example 29 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class ArmorRepair method parse.

@Override
public IRecipe parse(final JsonContext context, final JsonObject json) {
    final String material = JsonUtils.getString(json, "material");
    final String type = JsonUtils.getString(json, "armorType").toLowerCase();
    final MMDMaterial mat = Materials.getMaterialByName(material.toLowerCase());
    switch(type) {
        case "boots":
            return new BootsRepairRecipe(mat);
        case "leggings":
            return new LeggingsRepairRecipe(mat);
        case "chestplate":
            return new ChestplateRepairRecipe(mat);
        case "helmet":
            return new HelmetRepairRecipe(mat);
        case "shield":
            return new ShieldRepairRecipe(mat);
        default:
            throw new JsonSyntaxException("Unknown Armor Type '" + type + "' specified!");
    }
}
Also used : JsonSyntaxException(com.google.gson.JsonSyntaxException) LeggingsRepairRecipe(com.mcmoddev.lib.recipe.LeggingsRepairRecipe) ShieldRepairRecipe(com.mcmoddev.lib.recipe.ShieldRepairRecipe) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) HelmetRepairRecipe(com.mcmoddev.lib.recipe.HelmetRepairRecipe) BootsRepairRecipe(com.mcmoddev.lib.recipe.BootsRepairRecipe) ChestplateRepairRecipe(com.mcmoddev.lib.recipe.ChestplateRepairRecipe)

Example 30 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class Recipes method initPureVanillaCrusherRecipes.

protected static void initPureVanillaCrusherRecipes() {
    CrusherRecipeRegistry.addNewCrusherRecipe(Oredicts.STONE, // Stone to Cobblestone
    new ItemStack(net.minecraft.init.Blocks.COBBLESTONE, 1));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.STONEBRICK, // Stone Bricks to Cobblestone
    new ItemStack(net.minecraft.init.Blocks.COBBLESTONE, 1));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.STONE_SLAB, 1, 0), // Stone Slab to Cobblestone Slab
    new ItemStack(net.minecraft.init.Blocks.STONE_SLAB, 1, 3));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.STONE_SLAB, 1, 5), // Stone Bricks Slab to Cobblestone Slab
    new ItemStack(net.minecraft.init.Blocks.STONE_SLAB, 1, 3));
    CrusherRecipeRegistry.addNewCrusherRecipe(Oredicts.COBBLESTONE, // Cobblestone to Gravel
    new ItemStack(net.minecraft.init.Blocks.GRAVEL, 1));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.MOSSY_COBBLESTONE, // Mossy Cobblestone to Gravel
    new ItemStack(net.minecraft.init.Blocks.GRAVEL, 1));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.COBBLESTONE_WALL, 1, 0), // Cobblestone Wall to Gravel
    new ItemStack(net.minecraft.init.Blocks.GRAVEL, 1));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.COBBLESTONE_WALL, 1, 1), // Mossy Cobblestone Wall to Gravel
    new ItemStack(net.minecraft.init.Blocks.GRAVEL, 1));
    // Gravel
    CrusherRecipeRegistry.addNewCrusherRecipe(Oredicts.GRAVEL, new ItemStack(net.minecraft.init.Blocks.SAND, 1));
    // to
    // Sand
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.SANDSTONE, // Sandstone to Sand
    new ItemStack(net.minecraft.init.Blocks.SAND, 4));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.STONE_SLAB, 1, 1), // Sandstone Slab to 2 Sand
    new ItemStack(net.minecraft.init.Blocks.SAND, 2));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.GLASS, // Glass to Sand
    new ItemStack(net.minecraft.init.Blocks.SAND, 1));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.RED_SANDSTONE, // Red Sandstone to Red Sand
    new ItemStack(net.minecraft.init.Blocks.SAND, 4, 1));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.STONE_SLAB2, 1, 0), // Red Sandstone Slab to 2 Red Sand
    new ItemStack(net.minecraft.init.Blocks.SAND, 2, 1));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.STAINED_GLASS, // Red Stained Glass to Red Sand
    new ItemStack(net.minecraft.init.Blocks.SAND, 4, 1));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.GLOWSTONE, // Glowstone to 4 Glowstone Dust
    new ItemStack(net.minecraft.init.Items.GLOWSTONE_DUST, 4));
    final MMDMaterial lapis = Materials.getMaterialByName(MaterialNames.LAPIS);
    // Lapis Ore to 8 Lapis
    CrusherRecipeRegistry.addNewCrusherRecipe(Oredicts.ORE_LAPIS, lapis.getItemStack(Names.INGOT, 8));
    // Lapis Block to 9 Lapis
    CrusherRecipeRegistry.addNewCrusherRecipe(Oredicts.BLOCK_LAPIS, lapis.getItemStack(Names.INGOT, 9));
    final MMDMaterial redstone = Materials.getMaterialByName(MaterialNames.LAPIS);
    CrusherRecipeRegistry.addNewCrusherRecipe(Oredicts.ORE_REDSTONE, // Redstone Ore to 8 Redstone
    redstone.getItemStack(Names.POWDER, 8));
    CrusherRecipeRegistry.addNewCrusherRecipe(Oredicts.BLOCK_REDSTONE, // Redstone Block to 9 Redstone
    redstone.getItemStack(Names.POWDER, 9));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Items.REEDS, // Sugar Cane to 2 Sugar
    new ItemStack(net.minecraft.init.Items.SUGAR, 2));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.BONE_BLOCK, // Bone Block to 9 Bonemeal
    new ItemStack(net.minecraft.init.Items.DYE, 9, 15));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Items.BONE, // Bone to 3 Bonemeal
    new ItemStack(net.minecraft.init.Items.DYE, 3, 15));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Items.BLAZE_ROD, // Blaze Rod to 2 Blaze Powder
    new ItemStack(net.minecraft.init.Items.BLAZE_POWDER, 2));
    final MMDMaterial quartz = Materials.getMaterialByName(MaterialNames.QUARTZ);
    CrusherRecipeRegistry.addNewCrusherRecipe(Oredicts.ORE_QUARTZ, // Nether Quartz Ore to 2 Quartz
    quartz.getItemStack(Names.INGOT, 2));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.QUARTZ_BLOCK, // Quartz Block to 4 Quartz
    quartz.getItemStack(Names.INGOT, 4));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.STONE_SLAB, 1, 7), // Quartz Slab to 2 Quartz
    quartz.getItemStack(Names.INGOT, 2));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.PRISMARINE, 1, 0), // Prismarine to Prismarine Shard
    new ItemStack(net.minecraft.init.Items.PRISMARINE_SHARD, 4));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.PRISMARINE, 1, 1), // Brismarine Bricks to Prismarine Shard
    new ItemStack(net.minecraft.init.Items.PRISMARINE_SHARD, 9));
    CrusherRecipeRegistry.addNewCrusherRecipe(new ItemStack(net.minecraft.init.Blocks.PRISMARINE, 1, 2), // Dark Prismarine to Prismarine Shard
    new ItemStack(net.minecraft.init.Items.PRISMARINE_SHARD, 8));
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.SEA_LANTERN, // Sea Lantern to 5 Prismarine Crystals
    new ItemStack(net.minecraft.init.Items.PRISMARINE_CRYSTALS, 5));
    // to Prismarine Shard
    CrusherRecipeRegistry.addNewCrusherRecipe(net.minecraft.init.Blocks.SLIME_BLOCK, // Slime Block to 9 Slime Balls
    new ItemStack(net.minecraft.init.Items.SLIME_BALL, 9));
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) ItemStack(net.minecraft.item.ItemStack)

Aggregations

MMDMaterial (com.mcmoddev.lib.material.MMDMaterial)45 List (java.util.List)9 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)9 BaseMetals (com.mcmoddev.basemetals.BaseMetals)8 Arrays (java.util.Arrays)8 MaterialNames (com.mcmoddev.basemetals.data.MaterialNames)7 Names (com.mcmoddev.lib.data.Names)7 Materials (com.mcmoddev.lib.init.Materials)7 ItemStack (net.minecraft.item.ItemStack)6 RegistryEvent (net.minecraftforge.event.RegistryEvent)6 IIntegration (com.mcmoddev.lib.integration.IIntegration)5 MMDPlugin (com.mcmoddev.lib.integration.MMDPlugin)5 IMMDObject (com.mcmoddev.lib.material.IMMDObject)5 Oredicts (com.mcmoddev.lib.util.Oredicts)5 MinecraftForge (net.minecraftforge.common.MinecraftForge)5 ImmutableList (com.google.common.collect.ImmutableList)4 Options (com.mcmoddev.lib.util.Config.Options)4 Item (net.minecraft.item.Item)4 IRecipe (net.minecraft.item.crafting.IRecipe)4 ThermalExpansionHelper (cofh.api.util.ThermalExpansionHelper)2