Crafting Recipe Code Bug

Started by 810Teams on Tue, 10/25/2016 - 18:31

Topic category: Bugs and solutions

Last seen on 05:43, 11. Nov 2018
Joined Mar 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Crafting Recipe Code Bug
Tue, 10/25/2016 - 18:31

MCreator is a great tool for building mods, but it can also waste your time again. I faced 2 types of bug, but let me show you something first.
I usually edit the code of an item or block after I created them with crafting recipe, because the crafting recipe code will always count empty box and add them into your code. For example:

        GameRegistry.addRecipe(new ItemStack(block, 1),
                new Object[]{"XXX", "X45", "X78", Character.valueOf('4'), new ItemStack(Items.DYE, 1, 7), Character.valueOf('5'),
                        new ItemStack(Blocks.WOOL, 1, 7), Character.valueOf('7'), new ItemStack(Blocks.WOOL, 1, 7), Character.valueOf('8'),
                        new ItemStack(Items.DYE, 1, 7),});

Just as you see. I have to edit the code to "45", "78", to make the item/block able to be crafted better.
Now let's start what bugs I faced, more than twice.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[First Bug]
The first bug is "All codes in the workspace were reset for no reason". Look at the code I mentioned before, I edited the codes almost the whole workspace. They were reset for no reason. I have to edit them all once again. The problem is I have about more than 40 mod elements to edit.

[Second Bug]

The second bug is "Empty crafting recipe code appeared". This code sometimes appears in the mod element's code. This bug often occurs the same time as the first bug occurs. It sometimes appears right after I created an item or a block. Later, I found out that this code will make the launcher not able to start Minecraft, but still MCreator won't get an error when compiling the code. The code is:

        GameRegistry.addRecipe(new ItemStack(block, 1),
                new Object[]{"XXX", "XXX", "XXX",});

As you see, the code adds the recipe of an item or a block which requires 9 empty space ("XXX", "XXX", "XXX") to craft. That didn't make any sense, although this code still appears.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

If the developer saw this, please reconsider fixing these bugs.
Thank you for reading.