Jump to content

[Possible Bug] Hatchet/Hoe Recipe


Huntk23

Recommended Posts

I'm not sure if this is a bug with Forge but I suspect it may be. When I call the ShapedOreRecipe for a hatchet or hoe, it seems to be returning an ItemStack[6] with an incorrect recipe. I've only had a short time to look into it but I have gotten as far as OreDict/ShapeOreRecipe class getting a bad value from CraftingManager. I can post more details when I get home from work, but was wondering if anyone else has ran into or seen this issue? I've searched and haven't really found anything relating. I know OreDict is rather new as well.

Link to comment
Share on other sites

Could you post the code that you're getting the ShapedOreRecipe?

There's an EAQ for a reason. Read it!

"Note that failure to read this will make you look idiotic. You don't want that do you?" -- luacs1998

 

First rule of bug reports: More information is always better.

Oh, and logs OR IT DIDN'T HAPPEN!!

Link to comment
Share on other sites

Sorry for slow reply, always so busy with work.

Okay, may have been wrong to think it was Forge. I don't know why but it seems in RecipesTools.java the recipe was incorrect on Line 5

private String[][] recipePatterns = new String[][] {{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}};

 

Recipe 0 = Picaxe

Recipe 1 = Shovel

Recipe 2 = Hatchet

Recipe 3 = Hoe

 

The recipes are missing spaces and should look like this:

private String[][] recipePatterns = new String[][] {{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX ", "X# ", " # "}, {"XX ", " # ", " # "}};

 

This fixed my issue when CraftingManager called for these recipes and it ended up making them an ItemStack[6] when it should have been ItemStack[9]

 

So I've been out of the loop for a while and only mess around with Minecraft for java practice as I am a C# programmer, is this a MCP issue or actual Minecraft issue? or did I somehow get this isolated to me only?

Link to comment
Share on other sites

Its not an issue...

What gives you the idea that it is supposed to be a 9 in length?

The recipies are just fine, you're just not understanding how crafting works, this isn't a issue.

Note how in minecraft you can craft a hoe like this:

56140525.png

This is because those spaces are not there.

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

Link to comment
Share on other sites

Wow I feel like an idiot now lol I see what's wrong now-

 

rec.items = new ItemStack[9];
					int w = (Integer) ModLoader.getPrivateValue(ShapedOreRecipe.class, (ShapedOreRecipe) irecipe, 4);
					int h = (Integer) ModLoader.getPrivateValue(ShapedOreRecipe.class, (ShapedOreRecipe) irecipe, 5);
					if (w*h > 9) continue;

					Object temp[] = (Object[]) ModLoader.getPrivateValue(ShapedOreRecipe.class, (ShapedOreRecipe) irecipe, 3);

					for (int j = 0 ; j < temp.length ; j++) {
						if (temp[j] instanceof ArrayList) {
							List reqitems = (List) temp[j];
							for (int k = 0 ; k < reqitems.size(); k++) {
								int x = k;
								int y = j;
								if (temp.length <= 3)
									y = j * 3;
								rec.items[y+k] = (ItemStack) reqitems.get(k);
							}

 

It's adding a ItemStack[6] to a ItemStack[9] therefore outputting the wrong recipe.

Thanks for that clarification LexManos. Ugh brain-dead after work.

Link to comment
Share on other sites

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.