Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

My Custom furnace recipe is not working...

 

git

https://github.com/Vladan899/MoreIndustries

  • Author

Vanila Furnace Recipe is working fine...i was using same methods to re-create Recipe but different outputs.

 

When i put ironOre it should give me back IronDust.

but no smelting is occurring like it dose not see recipe. Like it dose not exist.

this is entire class.

package com.vladan899.MachinesRecpie;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import net.minecraft.block.Block;
import net.minecraft.block.BlockStoneBrick;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFishFood;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;

import com.google.common.collect.Maps;
import com.vladan899.blocks.BlockList;
import com.vladan899.items.ItemList;

public class SmasherRecpie {
 private static final SmasherRecpie smeltingBase = new SmasherRecpie();
    private Map smeltingList = Maps.newHashMap();
    private Map experienceList = Maps.newHashMap();

    public static SmasherRecpie instance()
    {
        return smeltingBase;
    }

    private SmasherRecpie()
    {
        this.addSmeltingRecipeForBlock(Blocks.iron_ore, new ItemStack(ItemList.IronDust), 0.7F);
        this.addSmeltingRecipeForBlock(Blocks.gold_ore, new ItemStack(ItemList.GoldDust), 1.0F);
        this.addSmeltingRecipeForBlock(BlockList.OreCopper, new ItemStack(ItemList.CopperDust), 1.0F);
        this.addSmeltingRecipeForBlock(BlockList.OreSilver, new ItemStack(ItemList.SilverDust), 1.0F);
        this.addSmeltingRecipeForBlock(BlockList.OreTin, new ItemStack(ItemList.TinDust), 1.0F);
       

    }

    public void addSmeltingRecipeForBlock(Block input, ItemStack stack, float experience)
    {
        this.addSmelting(Item.getItemFromBlock(input), stack, experience);
    }

    public void addSmelting(Item input, ItemStack stack, float experience)
    {
        this.addSmeltingRecipe(new ItemStack(input, 1, 32767), stack, experience);
    }

    public void addSmeltingRecipe(ItemStack input, ItemStack stack, float experience)
    {
        this.smeltingList.put(input, stack);
        this.experienceList.put(stack, Float.valueOf(experience));
    }

    public ItemStack getSmeltingResult(ItemStack stack)
    {
        Iterator iterator = this.smeltingList.entrySet().iterator();
        Entry entry;

        do
        {
            if (!iterator.hasNext())
            {
                return null;
            }

            entry = (Entry)iterator.next();
        }
        while (!this.compareItemStacks(stack, (ItemStack)entry.getKey()));

        return (ItemStack)entry.getValue();
    }

    private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
    {
        return stack2.getItem() == stack1.getItem() && (stack2.getMetadata() == 32767 || stack2.getMetadata() == stack1.getMetadata());
    }

    public Map getSmeltingList()
    {
        return this.smeltingList;
    }

    public float getSmeltingExperience(ItemStack stack)
    {
        float ret = stack.getItem().getSmeltingExperience(stack);
        if (ret != -1) return ret;

        Iterator iterator = this.experienceList.entrySet().iterator();
        Entry entry;

        do
        {
            if (!iterator.hasNext())
            {
                return 0.0F;
            }

            entry = (Entry)iterator.next();
        }
        while (!this.compareItemStacks(stack, (ItemStack)entry.getKey()));

        return ((Float)entry.getValue()).floatValue();
    }
}

1. your code formatting is a total mess and nearly unreadable.

2. you just copied vanilla code and hoped that itll work.

 

private boolean canSmelt() {

        if (this.Total_slots[0] == null)
        {
            return false;
        }
        else
        {
            ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.Total_slots[0]);
            if (itemstack == null) return false;
            if (this.Total_slots[2] == null) return true;
            if (!this.Total_slots[2].isItemEqual(itemstack)) return false;
            int result = Total_slots[2].stackSize + itemstack.stackSize;
            return result <= getInventoryStackLimit() && result <= this.Total_slots[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly.
        }
}

you want to use ur custom recipes, but you are chjecking for FurnaceRecipes.

also where r u registering custom recipes? I wont search your whole repo for that give us some more information if u want help srsly

  • Author

I do not know how or where to register Custom recipe? Where do i do that?

And no i didn't use vanila recipe...

i used from this site....as tutorial.

http://jabelarminecraft.blogspot.com/p/minecraft-modding-containers.html

 

And there i do not see any requirements to register custom recipe.

if you would know a bit about java you would know.. reworking can smelt and smeltitem should do everything

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.