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

Something like with the crafting handler where you can search through each item on the entire list of fuels and remove ones by Item.name or Block.name

 

Like this

static void removeRecipesWithResult(ItemStack resultItem)
    {
        ArrayList recipes = (ArrayList) CraftingManager.getInstance().getRecipeList();

        for (int scan = 0; scan < recipes.size(); scan++)
        {
            IRecipe tmpRecipe = (IRecipe) recipes.get(scan);
            if (ItemStack.areItemStacksEqual(resultItem, tmpRecipe.getRecipeOutput()))
            {
                recipes.remove(scan);
            }//if
        }//for
    }//removeRecipesWithResult

 

but with these changes:

 

static void removeFuelsWithResult(ItemStack Fuel)
    {
        ArrayList fuels = (ArrayList) FuelManager.getInstance().getFuelHandlerList();

        for (int scan = 0; scan < fuels.size(); scan++)
        {
            IFuelHandler tmpFuel = (IFuelHandler) fuels.get(scan);
            if (ItemStack.areItemStacksEqual(fuel, tmpFuel.getItemStack()))
            {
                fuels.remove(scan);
            }//if
        }//for
    }//removeRecipesWithResult

 

 

With this addition, the IFuelHandler would also have ".getFuelTime()"

  • Author

private static void removeFuelHandlerWithResult(ItemStack resultItem)
    {
        Map fuels = FurnaceRecipes.smelting().getSmeltingList();
        Map test = (Map) fuels.get(resultItem); 
        if (test != null)
        {
        	fuels.remove(test);
        }//if
    }//removeRecipesWithResult

 

Why doesn't this work then, am I missing something?

Because the map isnt based on result, but input?

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

  • Author

So should I instead be using '.containskey()' or would that not work either?

Guest
This topic is now closed to further replies.

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.