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

Hey there, just a quick suggestion (with code that works, just needs to be officially implemented). The ore dictionary recipes should check for a special interface and see if an item that could be different (NBT) from one time to the next to see if it is a potential match for a recipe. The code I have here works:

 

The interface:

public interface IOreDictionary
{
public String getOreName(ItemStack stack);
}

This is to be implemented by Item subclasses that need to have special behavior with ore recipes.

 

In ShapedOreRecipe and ShapelessOreRecipe, there is this line in the checkMatch() method:

matched = matched || checkItemEquals(item, slot);

This simply needs changed to:

matched = matched || checkIOreMatch(item, slot) || checkItemEquals(item, slot);

 

And the method checkIOreMatch() that does all the work (this can be public static somewhere):

private boolean checkIOreMatch(ItemStack target, ItemStack input)
    {
    	if(input == null || target == null)
    	{
    		return false;
    	}
    	if(!(input.getItem() instanceof IOreDictionary))
    	{
    		return false;
    	}
    	int oreID = OreDictionary.getOreID(target);
    	if(oreID != -1)
    	{
    		String name = OreDictionary.getOreName(oreID);
    		boolean ret = name.equals("Unknown") ? false : ((IOreDictionary)input.getItem()).getOreName(input).equals(name);
    		return ret;
    	}
    	return false;
    }

 

Basically, if the item has special cases (might be "ingotIron" at one time and "logWood" another) it will still match, regardless of whether or not it is actually registered.

 

That is all, here's to hoping this becomes official!

No, you really dont need to conserve space THAT bad.

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

It's not about conserving space, it's (more or less) for my mods and mods like them. I have a basic setup that allows for an unlimited number of alloys, and I figured it would be nice to be able to tell the game when my ingots are in the form of Steel Ingots versus when they are in the form of a Bronze Ingot, or when they are just in an undetermined mixture. They use NBT data so it's not currently possible to check for that.

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.