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

I am adding my own crafting requirements to some tools, including this one.  I've made a way to automate a process so that I would not have to re-enter all of the crafting recipes for each and every item.  This automation grabs the recipe from the IRecipe like so.

 

//My recipe String.  It is later separated every 3 places into 3 separate Strings.

//Used to define where and what an item is in the recipe
char letters[] = {'a','b','c','d','e','f','g','h','i'};

String recipeData = "";

//Gets list of Items within 
Object[] locationNumbers = ((ShapedOreRecipe)recipe).getInput();

for(int i = 0; i < locationNumbers.length; i++)
{
    //Null Checks and instanceChecks
    //Add to the crafting recipe (It would look similar to this , 
    //"abc", "def", "ghi"  ... But not in this case.  Read notes below...)
    recipeData += letters[i];
}

 

in the end, the recipeData looks like...  "abc" , "d f", "".

When it should look like... "ab " , "cd " , " f "

 

And after Everything is finished, it would look like this...

 

"aa " , "ad" , " d " , 'a', new ItemStack(Blocks.Blocks.planks), 'd', new ItemStack(Items.stick);  ... Which happens to be the recipe for the axe, more or less.

 

 

More information:

locationNumbers is an array of data (0 through 8, with some being null for blank spots)

 

for the axe, locationNumbers holds datas (0,1,2,3,5) numbers 4,6,7,8 are null.

or in other words, my recipe would look like this if I stored numbers from directly above.  "012", "3 5", ""

AND that's not the axe shape.

 

Another thing to note is that this works on about a hundred other recipes.

 

 

And for the question if you haven't guessed it.

Anyone have any clue as to why locationNumbers have datas (0,1,2,3,5) and not (0,1,3,4,7)? or ("01 " , "34 " , " 7 ")

 

 

Fore reference

I tried to simplify what was being asked, so information in paste bin is slightly different.

http://pastebin.com/isxPNT8z

  • Author

I am adding my own crafting requirements to some tools, including this one.  I've made a way to automate a process so that I would not have to re-enter all of the crafting recipes for each and every item.  This automation grabs the recipe from the IRecipe like so.

 

//My recipe String.  It is later separated every 3 places into 3 separate Strings.

//Used to define where and what an item is in the recipe
char letters[] = {'a','b','c','d','e','f','g','h','i'};

String recipeData = "";

//Gets list of Items within 
Object[] locationNumbers = ((ShapedOreRecipe)recipe).getInput();

for(int i = 0; i < locationNumbers.length; i++)
{
    //Null Checks and instanceChecks
    //Add to the crafting recipe (It would look similar to this , 
    //"abc", "def", "ghi"  ... But not in this case.  Read notes below...)
    recipeData += letters[i];
}

 

in the end, the recipeData looks like...  "abc" , "d f", "".

When it should look like... "ab " , "cd " , " f "

 

And after Everything is finished, it would look like this...

 

"aa " , "ad" , " d " , 'a', new ItemStack(Blocks.Blocks.planks), 'd', new ItemStack(Items.stick);  ... Which happens to be the recipe for the axe, more or less.

 

 

More information:

locationNumbers is an array of data (0 through 8, with some being null for blank spots)

 

for the axe, locationNumbers holds datas (0,1,2,3,5) numbers 4,6,7,8 are null.

or in other words, my recipe would look like this if I stored numbers from directly above.  "012", "3 5", ""

AND that's not the axe shape.

 

Another thing to note is that this works on about a hundred other recipes.

 

 

And for the question if you haven't guessed it.

Anyone have any clue as to why locationNumbers have datas (0,1,2,3,5) and not (0,1,3,4,7)? or ("01 " , "34 " , " 7 ")

 

 

Fore reference

I tried to simplify what was being asked, so information in paste bin is slightly different.

http://pastebin.com/isxPNT8z

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.