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

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

  • Author

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?

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

  • Author

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.

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.