Search in sources :

Example 1 with AltarRecipe

use of com.mart.solar.api.recipes.AltarRecipe in project Solar by Martacus.

the class ModRecipes method registerRecipes.

@SubscribeEvent
public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
    OreDictionary.registerOre("oreSilver", ModBlocks.SILVER_ORE);
    OreDictionary.registerOre("ingotSilver", ModItems.SILVER_INGOT);
    OreDictionary.registerOre("nuggetSilver", ModItems.SILVER_NUGGET);
    GameRegistry.addSmelting(ModBlocks.SILVER_ORE, new ItemStack(ModItems.SILVER_INGOT, 1), 1.5f);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(Items.BLAZE_POWDER, RuneType.FIRE, 2), "blaze_powder_fire", true);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(Items.COAL, RuneType.FIRE, 1), "coal_fire", true);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(Items.GUNPOWDER, RuneType.FIRE, 3), "gunpowder_fire", true);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(Items.POTIONITEM, RuneType.WATER, 1), "water_bottle_water", true);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(ItemBlock.getByNameOrId("stone"), RuneType.EARTH, 1), "stone_earth", true);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(Items.FEATHER, RuneType.WIND, 1), "feather_wind", true);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(Items.DIAMOND, RuneType.TIME, 2), "diamond_time", true);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(Items.BONE, RuneType.LIFE, 1), "bone_life", true);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(Items.GOLD_NUGGET, RuneType.SUN, 1), "gold_nugget_sun", true);
    InfuserReagentRegistry.registerReagent(new InfuserReagent(ModItems.SILVER_NUGGET, RuneType.MOON, 1), "silver_nugget_sun", true);
    AltarRecipeRegistry.registerRecipe(new AltarRecipe(Ingredient.fromItem(ModItems.DULL_AMULET), new ItemStack(ModItems.RITUAL_AMULET), 500), "ritual_amulet", true);
    AltarRecipeRegistry.registerRecipe(new AltarRecipe(Ingredient.fromItem(Item.getItemFromBlock(Blocks.PLANKS)), new ItemStack(ModItems.RUNES), 100), "rune", true);
    AltarRecipeRegistry.registerRecipe(new AltarRecipe(Ingredient.fromItem(Items.BOOK), new ItemStack(ModItems.JOURNAL), 100), "journal", true);
    AltarRecipeRegistry.registerRecipe(new AltarRecipe(Ingredient.fromItem(Item.getItemFromBlock(Blocks.STONE)), new ItemStack(Item.getItemFromBlock(ModBlocks.SUNBURNT)), 50), "sunburnt_stone", true);
    AltarRecipeRegistry.registerRecipe(new AltarRecipe(Ingredient.fromItem(Items.GOLD_INGOT), new ItemStack(ModItems.INFUSED, 1, 0), 400), "infused_gold", true);
    AltarRecipeRegistry.registerRecipe(new AltarRecipe(Ingredient.fromItem(ModItems.SILVER_INGOT), new ItemStack(ModItems.INFUSED, 1, 1), 400), "infused_silver", true);
    OfferingRecipeRegister.registerRecipe(new OfferingRecipe(new ItemStack(ModItems.RING_FLIGHT), Items.FEATHER, Items.FEATHER, Items.FEATHER, Items.FEATHER, Items.FEATHER, Items.FEATHER, Items.FEATHER, Items.FEATHER), "ring_of_flight", true);
}
Also used : OfferingRecipe(com.mart.solar.api.recipes.OfferingRecipe) InfuserReagent(com.mart.solar.api.infusing.InfuserReagent) AltarRecipe(com.mart.solar.api.recipes.AltarRecipe) ItemStack(net.minecraft.item.ItemStack) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with AltarRecipe

use of com.mart.solar.api.recipes.AltarRecipe in project Solar by Martacus.

the class AltarIH method insertItem.

@Nonnull
@Override
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
    AltarRecipe altarRecipe = AltarRecipeRegistry.findMatchingInput(stack);
    if (altarRecipe == null) {
        return stack;
    }
    ItemStack item = this.getStackInSlot(slot);
    if (!item.isEmpty()) {
        return stack;
    }
    tileAltar.startAltarRecipe(altarRecipe);
    return super.insertItem(slot, stack, simulate);
}
Also used : AltarRecipe(com.mart.solar.api.recipes.AltarRecipe) ItemStack(net.minecraft.item.ItemStack) Nonnull(javax.annotation.Nonnull)

Example 3 with AltarRecipe

use of com.mart.solar.api.recipes.AltarRecipe in project Solar by Martacus.

the class TileAltar method insertItem.

public void insertItem(EntityPlayer player, EnumHand hand) {
    this.playerLastUsed = player.getUniqueID();
    if (world.isRemote) {
        return;
    }
    ItemStack heldStack = player.getHeldItem(hand);
    ItemStack insertStack = heldStack.copy();
    insertStack.setCount(1);
    AltarRecipe altarRecipe = AltarRecipeRegistry.findMatchingInput(heldStack);
    if (altarRecipe == null) {
        return;
    }
    ItemStack returnStack = this.itemStackHandler.insertItem(0, insertStack, false);
    if (returnStack == insertStack) {
        return;
    }
    heldStack.setCount(heldStack.getCount() - 1);
}
Also used : AltarRecipe(com.mart.solar.api.recipes.AltarRecipe) ItemStack(net.minecraft.item.ItemStack)

Aggregations

AltarRecipe (com.mart.solar.api.recipes.AltarRecipe)3 ItemStack (net.minecraft.item.ItemStack)3 InfuserReagent (com.mart.solar.api.infusing.InfuserReagent)1 OfferingRecipe (com.mart.solar.api.recipes.OfferingRecipe)1 Nonnull (javax.annotation.Nonnull)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1