Search in sources :

Example 1 with ForgeRegistry

use of net.minecraftforge.registries.ForgeRegistry in project BetterWithAddons by DaedalusGame.

the class InteractionQuark method modifyRecipes.

@Override
public void modifyRecipes(RegistryEvent.Register<IRecipe> event) {
    ForgeRegistry<IRecipe> reg = (ForgeRegistry<IRecipe>) event.getRegistry();
    Block midoriBlock = Block.REGISTRY.getObject(new ResourceLocation(modid, "midori_block"));
    if (MIDORI_BLOCKS_NEED_CHUNKS)
        removeRecipeByOutput(reg, new ItemStack(midoriBlock, 4), modid);
}
Also used : ForgeRegistry(net.minecraftforge.registries.ForgeRegistry) IRecipe(net.minecraft.item.crafting.IRecipe) ResourceLocation(net.minecraft.util.ResourceLocation) Block(net.minecraft.block.Block) ItemStack(net.minecraft.item.ItemStack)

Example 2 with ForgeRegistry

use of net.minecraftforge.registries.ForgeRegistry in project Almura by AlmuraDev.

the class BiomeServerFeature method getBiomeConfigs.

private Map<Integer, BiomeConfig> getBiomeConfigs() {
    final ForgeRegistry<Biome> registry = (ForgeRegistry<Biome>) ForgeRegistries.BIOMES;
    final List<Biome> values = registry.getValues();
    final Map<Integer, BiomeConfig> biomes = new HashMap<>(values.size());
    for (Biome biome : values) {
        biomes.put(registry.getID(biome), BiomeConfig.of(biome));
    }
    return biomes;
}
Also used : ForgeRegistry(net.minecraftforge.registries.ForgeRegistry) Biome(net.minecraft.world.biome.Biome) HashMap(java.util.HashMap)

Example 3 with ForgeRegistry

use of net.minecraftforge.registries.ForgeRegistry in project BetterWithAddons by DaedalusGame.

the class InteractionWheat method modifyRecipes.

@Override
void modifyRecipes(RegistryEvent.Register<IRecipe> event) {
    ForgeRegistry<IRecipe> reg = (ForgeRegistry<IRecipe>) event.getRegistry();
    if (THRESH_WHEAT) {
        event.getRegistry().register(new ThreshingRecipe(new ResourceLocation(Reference.MOD_ID, "thresh_wheat"), new ItemStack(Items.WHEAT_SEEDS), new OreIngredient("cropWheat")).setRegistryName(new ResourceLocation(Reference.MOD_ID, "thresh_wheat")));
    }
    if (CHANGE_HAY_BALES) {
        removeRecipeByOutput(reg, new ItemStack(Blocks.HAY_BLOCK), "minecraft");
        removeRecipeByOutput(reg, new ItemStack(Items.WHEAT, 9), "minecraft");
        if (Loader.isModLoaded("quark")) {
            Block thatch = Block.getBlockFromName("quark:thatch");
            if (thatch != null) {
                removeRecipeByOutput(reg, new ItemStack(thatch), "quark");
                removeRecipeByOutput(reg, new ItemStack(Items.WHEAT, 4), "quark");
            }
        }
    }
}
Also used : ForgeRegistry(net.minecraftforge.registries.ForgeRegistry) IRecipe(net.minecraft.item.crafting.IRecipe) ResourceLocation(net.minecraft.util.ResourceLocation) Block(net.minecraft.block.Block) OreIngredient(net.minecraftforge.oredict.OreIngredient) ItemStack(net.minecraft.item.ItemStack) ThreshingRecipe(betterwithaddons.crafting.recipes.ThreshingRecipe)

Example 4 with ForgeRegistry

use of net.minecraftforge.registries.ForgeRegistry in project BetterWithAddons by DaedalusGame.

the class InteractionCondensedOutputs method modifyRecipes.

@Override
void modifyRecipes(RegistryEvent.Register<IRecipe> event) {
    ForgeRegistry<IRecipe> registry = (ForgeRegistry<IRecipe>) event.getRegistry();
    bagStack = betterwithmods.common.items.ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.HEMP_CLOTH, 1);
    crateStack = new ItemStack(Blocks.PLANKS, 1);
    congealedStack = new ItemStack(Items.SLIME_BALL, 1);
    boltStack = new ItemStack(BWMBlocks.WOOD_MOULDING, 1);
    bundleStack = betterwithmods.common.items.ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.HEMP_FIBERS, 1);
    addBaggingRecipe(registry, "seed", new ItemStack(Items.WHEAT_SEEDS));
    addBaggingRecipe(registry, "seed_hemp", new ItemStack(BWMBlocks.HEMP));
    addBaggingRecipe(registry, "seed_melon", new ItemStack(Items.MELON_SEEDS));
    addBaggingRecipe(registry, "seed_pumpkin", new ItemStack(Items.PUMPKIN_SEEDS));
    addBaggingRecipe(registry, "seed_beets", new ItemStack(Items.BEETROOT_SEEDS));
    addBaggingRecipe(registry, "cocoa", new ItemStack(Items.DYE, 1, EnumDyeColor.BROWN.getDyeDamage()));
    addBaggingRecipe(registry, "redstone", new ItemStack(Items.REDSTONE));
    addBaggingRecipe(registry, "glowstone", new ItemStack(Items.GLOWSTONE_DUST));
    addBaggingRecipe(registry, "sugar", new ItemStack(Items.SUGAR));
    addBaggingRecipe(registry, "gunpowder", new ItemStack(Items.GUNPOWDER));
    addBaggingRecipe(registry, "flour", new ItemStack(BWMBlocks.RAW_PASTRY, 1, BlockRawPastry.EnumType.BREAD.getMetadata()));
    addBaggingRecipe(registry, "sulfur", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.BRIMSTONE));
    addBaggingRecipe(registry, "nitre", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.NITER));
    addBaggingRecipe(registry, "sawdust", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SAWDUST));
    addBaggingRecipe(registry, "sawdust_soul", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SOUL_DUST));
    addBaggingRecipe(registry, "potash", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.POTASH));
    addBaggingRecipe(registry, "hellfire", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.HELLFIRE_DUST));
    addBaggingRecipe(registry, "kibble", new ItemStack(BWMItems.KIBBLE));
    addCratingRecipe(registry, "pork", new ItemStack(Items.COOKED_PORKCHOP));
    addCratingRecipe(registry, "pork_raw", new ItemStack(Items.PORKCHOP));
    addCratingRecipe(registry, "steak", new ItemStack(Items.COOKED_BEEF));
    addCratingRecipe(registry, "steak_raw", new ItemStack(Items.BEEF));
    addCratingRecipe(registry, "chicken", new ItemStack(Items.COOKED_CHICKEN));
    addCratingRecipe(registry, "chicken_raw", new ItemStack(Items.CHICKEN));
    addCratingRecipe(registry, "mutton", new ItemStack(Items.COOKED_MUTTON));
    addCratingRecipe(registry, "mutton_raw", new ItemStack(Items.MUTTON));
    addCratingRecipe(registry, "rabbit", new ItemStack(Items.COOKED_RABBIT));
    addCratingRecipe(registry, "rabbit_raw", new ItemStack(Items.RABBIT));
    addCratingRecipe(registry, "egg", new ItemStack(Items.EGG));
    addCratingRecipe(registry, "slime", new ItemStack(Items.SLIME_BALL));
    addCratingRecipe(registry, "enderpearl", new ItemStack(Items.ENDER_PEARL));
    addCratingRecipe(registry, "cactus", new ItemStack(Blocks.CACTUS));
    addCratingRecipe(registry, "inksac", new ItemStack(Items.DYE, 1, EnumDyeColor.BLACK.getDyeDamage()));
    addCongealingRecipe(registry, "mushroom", new ItemStack(Blocks.BROWN_MUSHROOM));
    addCongealingRecipe(registry, "amanita", new ItemStack(Blocks.RED_MUSHROOM));
    addCongealingRecipe(registry, "bone", new ItemStack(Items.BONE));
    addCongealingRecipe(registry, "flesh", new ItemStack(Items.ROTTEN_FLESH));
    addCongealingRecipe(registry, "eye", new ItemStack(Items.SPIDER_EYE));
    addCongealingRecipe(registry, "wart", new ItemStack(Items.NETHER_WART));
    addRollupRecipe(registry, "fabric", "fabricHemp", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.HEMP_CLOTH));
    addRollupRecipe(registry, "vine", new ItemStack(Blocks.VINE));
    addRollupRecipe(registry, "paper", "paper", new ItemStack(Items.PAPER));
    addRollupRecipe(registry, "leather", new ItemStack(Items.LEATHER));
    addRollupRecipe(registry, "scoured_leather", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SCOURED_LEATHER));
    addRollupRecipe(registry, "tanned_leather", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.TANNED_LEATHER));
    addRollupRecipe(registry, "string", "string", new ItemStack(Items.STRING));
    addBundlingRecipe(registry, "feather", new ItemStack(Items.FEATHER));
    addBundlingRecipe(registry, "blazerods", new ItemStack(Items.BLAZE_ROD));
    addBundlingRecipe(registry, "arrows", new ItemStack(Items.ARROW));
    addBundlingRecipe(registry, "oak", new ItemStack(Blocks.SAPLING, 1, BlockPlanks.EnumType.OAK.getMetadata()));
    addBundlingRecipe(registry, "birch", new ItemStack(Blocks.SAPLING, 1, BlockPlanks.EnumType.BIRCH.getMetadata()));
    addBundlingRecipe(registry, "spruce", new ItemStack(Blocks.SAPLING, 1, BlockPlanks.EnumType.SPRUCE.getMetadata()));
    addBundlingRecipe(registry, "jungle", new ItemStack(Blocks.SAPLING, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()));
    addBundlingRecipe(registry, "acacia", new ItemStack(Blocks.SAPLING, 1, BlockPlanks.EnumType.ACACIA.getMetadata()));
    addBundlingRecipe(registry, "darkoak", new ItemStack(Blocks.SAPLING, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata()));
}
Also used : ForgeRegistry(net.minecraftforge.registries.ForgeRegistry) IRecipe(net.minecraft.item.crafting.IRecipe) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ForgeRegistry (net.minecraftforge.registries.ForgeRegistry)4 ItemStack (net.minecraft.item.ItemStack)3 IRecipe (net.minecraft.item.crafting.IRecipe)3 Block (net.minecraft.block.Block)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 ThreshingRecipe (betterwithaddons.crafting.recipes.ThreshingRecipe)1 HashMap (java.util.HashMap)1 Biome (net.minecraft.world.biome.Biome)1 OreIngredient (net.minecraftforge.oredict.OreIngredient)1