Jump to content

Does anyone have a link explaining the X's for the 3x3 crafting grid?


Recommended Posts

Posted

I know to make recipes n such I need the knowledge of the X's.

 

But I have forgotten this stuff, and I need to find it again... google, bing, yahoo have failed me once again.

(most likely because im typing in the wrong thing)

 

example of what I'm talking about:

GameRegistry.addRecipe(new ItemStack(GuruItems.NETHER_ORB), new Object[] {" X ",  "X X", " X ", 'X', Item.getItemFromBlock(Blocks.OBSIDIAN)});

 

 

I know this results in top right left and down needing to be placed. But I need some kind of visualization of what XX or X is where and what not.

 

the end result being 4 pieces of obsidian in the corners 4 elements in top right left down and a slime ball in the middle taking up all spaces in the crafting grid. Help would be nice, cuz I feel pretty dumb not being able to recall this, or for that matter being able to look it up -.-

Posted

You have 3 Strings, each of size 3, defining row 1, 2 and 3 of the crafting grid. You can see it like this:

GameRegistry.addRecipe(new ItemStack(GuruItems.NETHER_ORB), new Object[] {
" X ",  // top row
"X X", // middle row
" X ", // bottom row
'X', Item.getItemFromBlock(Blocks.OBSIDIAN)});

This is your recipe. After that there is a character (

'X'

) and an Item. This tells the

CraftingManager

that the

'X'

s in the recipe are obsidian.

 

Also, you can omit the

new Object[]

, as it's a varargs parameter.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

I know to make recipes n such I need the knowledge of the X's.

 

But I have forgotten this stuff, and I need to find it again... google, bing, yahoo have failed me once again.

(most likely because im typing in the wrong thing)

 

example of what I'm talking about:

GameRegistry.addRecipe(new ItemStack(GuruItems.NETHER_ORB), new Object[] {" X ",  "X X", " X ", 'X', Item.getItemFromBlock(Blocks.OBSIDIAN)});

 

 

I know this results in top right left and down needing to be placed. But I need some kind of visualization of what XX or X is where and what not.

 

the end result being 4 pieces of obsidian in the corners 4 elements in top right left down and a slime ball in the middle taking up all spaces in the crafting grid. Help would be nice, cuz I feel pretty dumb not being able to recall this, or for that matter being able to look it up -.-

 

Also the X's can be anything you like as in my crafting recipes

		GameRegistry.addRecipe(new ItemStack(ModInfo.blockBlueScreen, 8, 0), new Object[] { "BBB", "BIB", "BBB", Character.valueOf('B'), new ItemStack(Blocks.CLAY, 1, 0), Character.valueOf('I'), new ItemStack(ModInfo.itemBlueScreenPaint.setContainerItem(Items.BUCKET), 1, 0) });

 

also if you set your recipe up for a 2x2 grid it can be crafted in the players inventory.

Posted

Also the X's can be anything you like as in my crafting recipes

		GameRegistry.addRecipe(new ItemStack(ModInfo.blockBlueScreen, 8, 0), new Object[] { "BBB", "BIB", "BBB", Character.valueOf('B'), new ItemStack(Blocks.CLAY, 1, 0), Character.valueOf('I'), new ItemStack(ModInfo.itemBlueScreenPaint.setContainerItem(Items.BUCKET), 1, 0) });

 

also if you set your recipe up for a 2x2 grid it can be crafted in the players inventory.

 

You don't need the "

new Object[]

" as the method wants varargs, like larsgerrits states. Also, what the heck are you doing with the

Character#valueOf()

?

	GameRegistry.addRecipe(new ItemStack(ContentRegistry.GHAST_TEAR_JAR), 
			"TTT",
			"TJT",
			"TTT",
			'T', Items.GHAST_TEAR, 'J', ContentRegistry.JAR
			);

Works just fine and dandy, without all that baggage.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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